2019各大IT公司校招笔试题整理 精

发布 2024-04-17 02:50:11 阅读 9400

2011阿里云计算研发中心笔试题(45minutes

应聘职位:软件开发工程师-数据平台。

1.状态转换图,有限自动机,正则表达式。

2.最小堆,删除堆根节点,画出任意结果。

与stack在进程中的区别。

4.硬盘概率问题,对立事件,独立事件,平均分布,一季度,一年。

5.工厂分布距离最小问题。

6.多线程输出变量的所以可能值。

7.补充题,堆排序补充。

8.整数数组中求相加和最大的子数组,时间复杂度为o(n,编程语言不限(c/c /j**a

附加知识:一个由c/c++编译的程序占用的内存分为以下几个部分。

1、栈区(stack)— 由编译器自动分配释放 ,存放函数的参数值,局部变量的值等。其操作方式类似于数据结构中的栈。

2、堆区(heap) —一般由程序员分配释放, 若程序员不释放,程序结束时可能由os** 。注意它与数据结构中的堆是两回事,分配方式倒是类似于链表。

3、全局区(静态区)(static)—,全局变量和静态变量的存储是放在一块的,初始化的全局变量和静态变量在一块区域, 未初始化的全局变量和未初始化的静态变量在相邻的另一块区域。 -程序结束后有系统释放。

4、文字常量区 —常量字符串就是放在这里的。 程序结束后由系统释放。

5、程序**区—存放函数体的二进制**。

heap:今天在冶金馆中心考场3参加2011校招笔试了,题目太长啦,感觉不错就打出来分享一下,希望大家早早拿到心仪的offer!

一。编程题。

1.用c语言写一个函数来执行一串任务。任务是互相依赖的。

比如b任务依赖a任务,则a完成b才能执行。不考虑并发限制,假设所有的任务都能一次执行成功,所有的任务执行时间都相等。任务数据结构原型为:

typedef struct {

int id;//该任务的id

int *child;//该任务依赖的任务的id

int child_num;//该任务依赖的任务的个数。

task;函数原型:

bool doschedule(task*pask,int task_num );

以下函数可以直接调用:

void dotask(int id);/执行一个进程。

int waittask(int timeout);/等待timeout时间,并返回一个执行成功的任务的id,如果没有任务在时间片内完成,则返回-1

bool killtask(int id);/杀掉一个进程。

2.如果考虑并发限制,应该怎么改进?

二。简答题。

1.阐述栈和堆在生命周期、速度、内存性能等方面的不同点。假如现在有一个缓冲区域绝大多数只需要1kb空间,极少数极端情况下需要100mb,怎么样合理分配内存?

2.说明以下包含const修饰符的语句的意义。

a. double * ptr=&value;

b. const double * ptr=&value;

c. double *const ptr =&value;

double *const ptr=&value;

3.请问c语言中怎么去除const修饰?

比如:const double value=0.2f;

double *ptr;

ptr怎么样获取value的值?

三。算法设计题。

1.在一维坐标轴上存在许多条线段,用最简单的算法找出重合长度最长得两条线段。比如线段a(1,5)、b(2,8)、c(3,9),则b和c的重合长度最长,为5.

2.是一道求最短路径的问题,例子给出了一个包含5个节点的有向图,标有权值,求始点到终点的距离,图就不画了 。

这两道题都需要详细写明算法与函数设计 -_

四。系统设计题。

的某某服务机制类似于cs(customer-server),有时候大量用户访问服务器s,导致s运行效率缓慢。为了提升效率,拟在c上利用一些空余的结果空间作为缓存。已知在c的一台客户机上,每天接收1000w query,其中500w uniq query,每个query 5kb,客户机内存3gb,硬盘500gb。

做出一个方案,说明系统结构、存储结构、性能优化等方面的设计。

将一句话里面的单词进行倒置,标点符号不倒换,如“i come from tianjin.”,倒换后位"tianjin. from come i",**实现如下:

#include

#include

char* convert(char* pure

char *temp = malloc(strlen(pure + 1;

int i = 0;

int j = strlen(pure - 1;

int pre = 0;

int k = 0;

for(i = 0; i < strlen(pure; i++

temp[j--]pure[i];

printf("%d",strlen(temp;

for(i = 0; i < strlen(temp; i++

printf("i is %d", i;

if(temp[i] =

k = i;

printf("here is %d", i;

for(j = pre; j < i; j++

pure[j] =temp[--k];

pure[j] =

pre = i + 1;

if(i ==strlen(temp - 1

k = i;

printf("i is %d, j is %d, pre is %d", i, j, pre;

for(j = pre; j <=i; j++

pure[j] =temp[k--]

return pure;

int main(

char a iam love you, baby.";

convert(a;

printf("%s", a;

xdyang 于2011-9-16 于东大ic学院302

一共三道题,第一题为数字到字符的转换,不解释,加'0'即可。

第二道为单链表的逆序,继续不解释,看宝典或搜索。

第三道题是,读入一个文本,返回文本内出现次数最多的单词,和出现最少的单词。单词部分大小写,单词以逗号,句号或空格分隔。

个人实现如下,感觉还是得花一个小时左右才能调试好。

#include

#include

#include

typedef struct test

char word[20];

struct test* next;

int len;

int count;

test;

void find(char* pure, char *max_string, char *min_string

int len = strlen(pure;

int i = 0;

int pre = 0;

test* head = struct test*malloc(sizeof(struct test;

test* pre_point = head;

test* temp = null;

test* sec_temp = null;

int max = 0;

int max_count = 0;

int min = 0;

int min_count = 0;

int j = 0;

int panduan = 0;

printf("len is %d", len;

for(i = 0; i < len; i++

if((pure[ipure[ipure[i] =

if(i - pre !=0

temp = struct test*malloc(sizeof(struct test;

temp->len = i - pre;

for(j = 0; j < temp->len; j++

temp->word[j] =pure[pre + j];

temp->word[j] =0';

temp->count = 1;

pre_point->next = temp;

temp->next = null;

pre_point = temp;

pre = i + 1;

strcpy(max_string, head->next->word;

strcpy(min_string, head->next->word;

min = len;

for(temp = head->next; temp->next !=null; temp = temp->next

for(sec_temp = head->next; sec_temp->next !=null; sec_temp = sec_temp->next

panduan = 0;

#if 0if(!strcmp(temp->word, sec_temp->word

temp->count++;

#endif

if(temp->len ==sec_temp->len

for(i = 0; i < temp->len; i++

if((temp->word[i] !sec_temp->word[i] &temp->word[i] !sec_temp->word[i] +a' -a' &temp->word[i] !

sec_temp->word[i] +a' -a'

panduan = 1;

break;

if(!panduan

temp->count++;

if(temp->count > max

max = temp->count;

strcpy(max_string, temp->word;

if(temp->count < min

min = temp->count;

strcpy(min_string, temp->word;

int main(

char* test = hello, everybody. hello boy, hello boy love.";

公司笔试题

inta,b,c请写函数实现c a b,不可以改变数据类型,如将c改为longint,关键是如何处理溢出问题。booladd inta,intb,int c 溢出返回11 简述操作系统内存管理方式和区别。段式,页式,段页式。区别 段式,内存分为若干大小不等的段 页式,内存分为大小等同的页 段页式,先...

IT公司笔试题

部分it公司笔试算法题 算法,笔试。部分it公司笔试算法题。1 将一整数逆序后放入一数组中 要求递归实现 void convert int result,int n convert result,n printf d n for int i 0 i 9 i printf d result 2 求高于...

2024年各大院校美术校考考题

2012年华东理工大学美术考题。素描 题目 同班男生。要求 1 默写一位高中男同学的头像 2 构图 光线自行安排 3 注意结构 比例 构图 形态 表情 光影和艺术处理 工具 铅笔 碳笔。时间 2.5小时。色彩 题目 静物组合 默写 内容 一瓶葡萄酒 一只玻璃高脚酒杯 内盛半杯红酒 两只苹果 一串香蕉...