2015有道实习生研发笔试
来源:互联网 发布:淘宝囤货一族 编辑:程序博客网 时间:2024/05/02 15:54
回忆版:有些题记不清了
基础题:
1、下一段代码输出什么
int a[5] = {1,2,3,4,5};int * b = (int *)(&a+1);cout<<*(a+1)<<" "<<*(b-1);return 0;2、宏
#define FUC(a) ((a++)*(a++))int x = 5;x = FUNC(x);cout<<x<<endl;
求输出的值是多少
3、中序遍历为abcde,前序遍历不可能为什么
4、概率题
大致意思是有两个桶,每个桶里都有红球篮球若干个,先随机从两个桶里取两个球,问第一次取的红球的概率?已知第二次取的篮球,求第一次取的是篮球的概率
5、DNS协议是基于传输层什么协议上的
6、Android是基于什么操作系统开发的
7、排序算法中稳定的有哪些
8、有n个人n张火车票,现在随机把n张火车票分配给n个人,问拿到自己的车票的有多少人
9、同一个进程中的线程共享哪些资源
A、堆B、栈C、寄存器 D、静态变量
10、引用的题
有指针引用什么的,具体记不清了
算法编程题:
1、用23456789TJQKA来计数,其中2表示十进制中的2,
22
33
...
K13
A14
2215
2316
...
2A27
3228
...
函数原型为 char * pokToDec(char * str);
char * pokToDec(char * str){int len = strlen(str);long long int total = 0;long long int val = 1;char res[64];for(int i = len-1; i>=0; i--){int temp = 0;if(str[i] >= '2' && str[i] <= '9'){temp = str[i]-'0';}else{switch(str[i]){case 'T': temp = 10; break;case 'J': temp = 11; break;case 'Q': temp = 12; break;case 'K': temp = 13; break;case 'A': temp = 14; break;default: cout<<"error input"<<endl;break;}}if(i == len-1) total = total + temp*val;else{total = total + (temp-1)*val; }val = val*13;}lltoa(total,res,10);return res;}以上程序只能处理long long int 型的数据
2、链表加法
给你两个链表a,b,如下所示:
input:4->0->5
3->1->5
output: 7->2->0
链表节点定义:
struct Node{char data;Node * next;};
函数原型为 Node* ListAdd(Node * a,Node * b);
Node* ListAdd(Node * a,Node * b){if(a == NULL) return b;if(b == NULL) return a;stack<char> s1,s2,sum;Node * pa = a;Node * pb = b;while(pa != NULL && pb != NULL){s1.push(pa->data);s2.push(pb->data);pa = pa->next;pb = pb->next;}while(pa != NULL){s1.push(pa->data);pa = pa->next;}while(pb != NULL){s2.push(pb->data);pb = pb->next;}int tmp1,tmp2;int carry = 0;while(!s1.empty() && !s2.empty()){tmp1 = s1.top()-'0';tmp2 = s2.top()-'0';int num = (tmp1 + tmp2 + carry)%10;carry = (tmp1 + tmp2)/10;sum.push('0' + num);s1.pop();s2.pop();}while(!s1.empty()){tmp1 = s1.top()-'0';int num = (tmp1 + carry)%10;carry = (tmp1 + carry)/10;sum.push('0' + num);s1.pop();}while(!s2.empty()){tmp2 = s2.top()-'0';int num = (tmp2 + carry)%10;carry = (tmp2 + carry)/10;sum.push('0' + num);s2.pop();}if(carry == 1)sum.push('1');Node ans;ans.data = '0';ans.next = NULL;Node * ret = &ans;Node * ptr = ret;while(!sum.empty()){Node temp;temp.data = sum.top();temp.next = NULL;ptr->next = &temp;ptr = ptr->next;sum.pop();}return ret->next;}
0 0
- 2015有道实习生研发笔试
- 阿里2015实习生笔试C++研发
- 阿里巴巴实习生笔试研发工程师
- 一道有道实习生笔试算法题分析
- 2015年阿里巴巴实习生招聘笔试题详细解析(研发大类:Java研发/C++研发)
- 阿里巴巴2015基础平台研发工程师实习生笔试卷
- 阿里巴巴2015基础平台研发工程师实习生笔试卷
- 阿里2015基础平台研发工程师实习生笔试卷
- 北邮某同学面试网易有道研发实习生的面试题
- 阿里巴巴2014研发实习生笔试解析
- 阿里巴巴2014研发实习生笔试解析
- 群硕20170515Java研发实习生笔试题
- 网易有道移动端实习生笔试(2014)
- 网易有道客户端开发工程师实习生笔试题
- 阿里2015年4月实习生招聘研发岗笔试题——RPC题解
- 阿里笔试部分题目分析(2015实习生 C/C++研发)
- 百度地图2015年实习生招聘(研发)笔试题浅析
- 2014-04-17-网易有道-研发类-笔试题&参考答案
- Android中的枚举
- 工作快一年了,我做了些什么
- jeecg公开课今晚主题:新版本功能介绍、online原理和代码生成器,欢迎大家报名
- 创业周
- C++指针数组、数组指针、数组名及二维数组技巧汇总
- 2015有道实习生研发笔试
- 解决微信内嵌浏览器无法响应上传文件(图片)
- Swift vs Objective-C:未来看好 Swift 的十个理由
- 判断textview的字节数
- 资料收集
- 开通快乐
- 1.3. 关于注释
- spring技术总结
- Android错误提示及解决方案(持续更新)