MSRA Interview Written Exam (December 2003, Time: 2.5 Hours)
1 Write the time complexity of the following algorithm.
(1) Bubbling ordering;
(2) Select sort;
(3) Insert sorting;
(4) Quick sorting;
(5) Pile sorting;
(6) Multiple sorting;
2 Write the following procedure to run the results on x86.
Struct mybitfields
{
UNSIGNED SHORT A: 4;
UNSIGNED SHORT B: 5;
UNSIGNED SHORT C: 7;
} Test
Void main (void)
{
INT I;
Test.a = 2;
Test.b = 3;
Test.c = 0;
i = * (short *) & test);
Printf ("% d / n", i);
}
3 Write the results of the following programs.
Unsigned INT I = 3;
COUT << i * -1;
4 Write out the following procedures possible operational results.
Int a;
INT B;
INT C;
Void f1 ()
{
B = a * 2;
A = B;
}
Void F2 ()
{
C = a 1;
A = C;
}
Main ()
{
A = 5;
// Start F1, F2 in Parallel
F1 (); f2 ();
Printf ("A =% D / N", A);
}
5 略, operate the string.
6 Treatment of 16 BITS Colors, requirement:
(1) When Byte is converted to RGB, he retains high 5,6bits;
(2) When the RGB is converted to BYTE, the second, 3 position is zero.
7 A linked list of operations, pay attention to the robustness and security of the code. Claim:
(1) Add an element;
(2) Get head elements;
(3) pop-up elements (values and delete).
8 A given value is upgraded from the left to the right nth, such as
0010 << 1 == 0100
or
0001 0011 << 4 == 0011 0000
Please use C or C or other programs that can run on X86.
Additional questions (only after completing the above questions)
IN C , what does "explicit" mean? What does "protected"
* What's The Difference Between a Linked List and an Array?
* Implement an algorithm to sort a linked list. Why did you pick the method
YOU DID?
* Implement an algorithm to sort an array. Why did you pick the method you d
ID?
* Implement strstr () (or some other string library function).
* Reverse a string. Optimize for speed. Optimize for space.
* Count the number of set bits in a number. Now Optimize for speed. Now Optimize for size.
* How Would you find a cycle in a linked list?
* Give me an algorithm to shuffle a deck of cards, Given That The Cards Are
Stored in an array of INTS.
* Write a Function That Takes in A String Parameter and Checks to see WHETHE
R or not it is an in turnr, and if it is the reburn the integer value.
* Write a Function to Print All of the permutations of a string.
* Implement malloc.
* Write a Function to Print The Fibonacci Numbers.
* Write a Function to Copy Two Strings, A and B. The Last Few Bytes Of Strin
G A overlap the first few Bytes of string B.
* How Would You Print Out The Data In a Binary Tree, Level by Level, Startin
g at the top?
1. The difference in processes and threads.
2. The difference between HEAP and Stack.
3. How is the memory under Windows management?
4. Introduce the security of .NET and .NET.
5. How does the client access .NET component implementation web service?
6. How is the virtual table to complete in the C / C compiler?
7. Talking about the thread model of COM. Then discuss the difference between the internal / outer assembly.
8. Talk about the paging mechanism under IA32.
9. Give two variables, how to find out where a loop mono table is ringing?
10. How many ways in IA32 jump from the user state to the kernel state?
11. If you just want to have an instance to run, you cannot run two. Like Winamp, you can only open a window
How to achieve?
12. How to intercept the response of the keyboard, let all 'a' become 'b'?
13. What is the use of Apartment in COM? Why is it to introduce?
14. What is the storage process? What is the use? What is the advantage?
15. What is the characteristics of Template? When is it?
16. Talking about the Characteristics and Benefits of the Windows DNA Structure.