微软校园招聘笔试题
using namespace std;
struct Item
{
char c;
Item *next;
};
Item *Routine1(Item *x)
{
Item *prev = NULL,
*curr = x;
while(curr)
{
Item *next = curr->next;
curr->next = prev;
prev = curr;
curr = next;
}
return prev;
}
void Routine2(Item *x)
{
Item *curr = x;
while(curr)
{
cout<
curr = curr->next;
}
}
int main(void)
{
Item *x,
d = {'d' , NULL},
c = {'c' , &d},
b = {'b' , &c},
a = {'a' , &b};
x = Routine1( &a );
Routine2( x );
return 0;
}
#include
using namespace std;
struct Item
{
char c;
Item *next;
};
Item *Routine1(Item *x)
{
Item *prev = NULL,
*curr = x;
while(curr)
{
Item *next = curr->next;
curr->next = prev;
prev = curr;
curr = next;
}
return prev;
}
void Routine2(Item *x)
{
Item *curr = x;
while(curr)
{
cout<
curr = curr->next;
}
}
int main(void)
{
Item *x,
d = {'d' , NULL},
c = {'c' , &d},
b = {'b' , &c},
a = {'a' , &b};
x = Routine1( &a );
Routine2( x );
return 0;
}
A、 c b a d
B、 b a d c
C、 d b c a
D、 a b c d
E、 d c b a
微软2012年9月22日校园招聘笔试题
1、数据库
基于某个条件选出一个订单列表,考的是最基本的数据库语言select * from * where *
2、不能用于进程间通信的是
A、Named event
B、Named pipe
C、Critical section
D、Shared memory
3、shallow copying (浅拷贝)的特征
英文太烂不知道shallow copying怎么翻译不敢选
4、 Functional programming(函数式编程)的特点
完全不了解functional programing
考了”没有副作用”,“不修改状态”,“引用透明”引用透明的概念类似于可重入
5、以下算法用到贪婪算法的是
A、Dijkstra
B、Prim
C、Kruskal
D、Floyd- Warshall
E、KMP string match
6、1,2,3,…1000 一共出现了多少个0
A、189
B、191
C、193
D、195
算出来是192个可是没有这个答案估计题目出错了。
7、T(x)=1 (x<=1), T(n)=25*T(n/5)+n^2 求T(n)的时间复杂度
A、O(n*log(n))
B、O(log(n))
C、O(n^2*log(n))
D、O(n^3*log(n))
T(n)=25*(25*T(n/25)+(n/5)^2)+n^2=25^2*T(n/(5^2))+2*n^2=25^(log(n)/log5)+(log(n)/log5)*n^2=n^2+n^2*log(n) =O(n^2*log(n))
8、下列属于设计模式中 ”creational pattern” (创建型)的是?
A、Facade
B、Singleton
C、Bridge
D、Composite
Facade composite bridge 都属于Structural(结构型)
9、建立一个TCP连接的过程?
三次握手http://baike.baidu.com/view/1003841.htm
答案中好像没有SYN,SYN+ACK,ACK,于是我就选了 E、None of above
上一页 [1] [2] [3] [4] [5] [6] 下一页