微軟 2021 暑期實習面試題
小編:管理員 2096閱讀 2021.10.11
Selection sort 80 items, after 32 iterations, how many positions of items are determined?
第2題:
?Which is used in sync process//thread in operation system?
A. Mutex? ? ? ? ? ? ?B.mailbox? ? ? ? C.Semaphore? ? ? ? D.local procedure call
第3題:
?Size of a stack is 5, input is a sequence 1, 2, …, 7, which is possible output?
A. 1234567? ? ? ?B. 7654321? ? ? ?C.5643721? ? ? ?D. 1765432? ? ? ?E. 3217564
第4題:
010111001 * 011001 + 1101110 = ?
A. 0001010000111111? ? ? ?B. 0101011101110011? ? ? ?C. 0011010000110101?
第5題:
What is the output of the follow code?
void main(int argc, char* argv[]) {
int i = 11;
int const *p = &i;
p++;? ? ? ??
cout<<*p<
第6題:
Which number has difference 78633 after 180-degree rotation?
A. 60918? ? ? ? ? ? ? ? B.91086? ? ? ? ? ? ? ? C. 18609? ? ? ? ? ? ? ? D. 10968? ? ? ? ? ? ? ? E.86901
第7題:
Which statement is true?
A. Inorder and preorder can determine a Binary tree
B. Postorder and preorder can determine a Binary tree
C. For almost sorted array, Insertion sort is more efficient than Quicksort
D. If T(n)=2T(n/2)+?(n), Then T(n)=?(nLogn)
E. none of above
第8題:
Which statement is true?
A. Insertion and buble sort are not effient for large data sets
B. The complexity of Quick Sort is O(n2) in worst case
C. It is needed 6 swap operations to sort sequence 7,6,5,4,3,2,1(ascending) by Selection sort
D. Heap sort has two operations: Insertion and root deletion
E. None of above
第9題:
The output of the following code is 0 20 1 20, what are the type of a and b?
class Test{
____ int a;
____ int b;
Test(int _a, int _b) {a = _a; b=_b;}
}
void main() {
Test t1(0, 0), t2(1,1);
t1.b = 10;
t2.b = 20;
cout<
A. static/const? ? ? ? B. const/static? ? ? ? C. __/static? ? ? ? D. const static/static? ? ? ? E. None of
above
第10題:
?A 3-order B-tree has 2047 key words, what is the maximum height?
A. 11? ? ? ? ? B. 12? ? ? ? ? C. 13? ? ? ? ? D. 14
第11題:
?Which can be used both to variable and function?
A. static? ? ? ? B. virtual? ? ? ? ? ? ? ? C. extern? ? ? ? D. inline? ? ? ? E. const
第12題:
?What is the output of the follow code?
char * f(char *str, char ch) {
char *it1 = str;
char *it2 = str;
while(*it2 != '\0') {
while(*it2 == ch)
{
it2++;
}
*it1++ = *it2++;
}
return str;
}
int main(int argc, char* argv[]) {
char *a = new char[10];
strcpy(a, "abcdcccd");
cout<
}
A. abdcccd? ? ? ? B. abdd? ? ? ? C. abcc? ? ? ? D. abddcccd? ? ? ? E. Access violation
第13題:
What is the complexity of the result call of power(b, e) in the follow code?
int power(int b, int e) {
if(e==0) return 1;
if(e%2 == 0) return power(b*b, e/2);
? ? ? ? return b*power(b*b,e/2);
}
A. logarithmic? ? ? ? ? ? ? ? B. linear? ? ? ? C. quadratic? ? ? ? D. exponentical
第14題:
Take 2 cards from one full poker(52 cards, 26 red and 26 black) and half poker each, what is the probability of the event that two cards are both red?
A. 1/2,1/2? ? ? ? B. 25/102,12/50? ? ? ? C. 50/51, 24/25? ? ? ? D. 25/51,12/25? ? ? ? E. 25/51,1/2
第15題:
How many kinds of output of stack with the input 1,2,…,n?
B. C_2n^n-C_2n^(n+1)? ? ? ? ? ? ? ? C. ((2n)!)/(n+1)n!n!? ? ? ? D. n!? ? ? ? E. none
第16題:
What is the minimum time and space complexity to compute the Largest Increased Subsequence(LIS) of array?
A. N^2,N^2? ? ? ? ? B. N^2,N? ? ? ? ? ? ? ? ? C. NlogN,N? ? ? ? ? ? D. N, N? ? ? ? E. N,C
第17題:
What is the output of the follow code?
struct Item{
char c;
Item *next;
};
Item* f1(Item* x){
Item *prev = NULL;
Item *curr = x;? ? ? ??
while(curr) {? ? ? ? ? ? ? ? Item *next = curr->next;? ? ? ? ? ? ? ??
curr->next = prev;? ? ? ? ? ? ? ??
prev = curr;
? ? ? ? ? ? ? ? curr = next;
}? ? ? ??
return prev;
}
void f2(Item *x){
while(x){
cout<
x = x->next;? ? ? ??
}
}
int main(int argc, char* argv[]){
Item *x, d = {'d', NULL}, c = {'c', &d}, b = {'b', &c}, a = {'a', &b};? ? ? ??
x = f1(&a);
f2(x);? ? ? ??
return 0;
}
相關推薦
- 2021年博世(中國)實習生面試題 第1題: 填空題:1、博世,來自德國,它有三個著名的第一:汽車技術世界第一!電動工具世界第一!家電歐洲第一!2、汽車上的ABS、ESP和火花塞,眾人皆知的電鉆,都是博世發明的!3、博世家電在25個國家的知名度,19個國家超過80%,13個國家排名前三!4、1984年洛杉磯…
- 微軟 2021 機械類面試題 第1題:Briefly describe what is blanking(cutting), forming, coining and embosing in stamping process.第2題:What is metal clading?第3題:What is the purpose of adding glass fiber to thermoplastic material?第4題:In contrast with metal and …
- 經典筆試題-JDBC及Hibernate篇 五、JDBC 及Hibernate:(共12 題:基礎10 道,中等難度2 道)110、數據庫,比如100 用戶同時來訪,要采取什么技術解決?【基礎】 答:可采用連接池。111、什么是ORM?【基礎】 答:對象關系映射(Object—Relational Mapping,簡稱ORM)是一種為了解決面向對象…