╨╧рб▒с>■ -/■ , ье┴q` Ё┐КbjbjqPqP ."::К дRRRRRRRfо
о
о
о
║
fс╢┌
┌
┌
┌
┌
┌
┌
┌
`bbbbbb$Чh FЖR┌
┌
┌
┌
┌
ЖRR┌
┌
Ы000┌
R┌
R┌
`0┌
`00RR0┌
╬
аяЛ╔ХH╠о
Ё
@0`▒0с0E0E00ERD┌
┌
0┌
┌
┌
┌
┌
ЖЖ0┌
┌
┌
с┌
┌
┌
┌
fffд
дfff
fffRRRRRR 36 Microsoft interview questions about Algorithms
I. Introduction about algorithms Microsoft interviews
Questions below will help you interview candidates about algorithms elements
II. Interview questions of algorithms
1. Describe advantages and disadvantages of the various stock sorting algorithms?
2. Implement an algorithm to reverse a linked list. Now do it without recursion?
3. Implement an algorithm to insert a node into a circular linked list without traversing it?4. Implement malloc?
5. Write a function to print the Fibonacci numbers?
6. Write a function to copy two strings, A and B. The last few bytes of string A overlap the first few bytes of string B?
7. How would you write qsort?
8. How would you print out the data in a binary tree, level by level, starting at the top?
9. Find a substring. Optimize for speed. Optimize for space?
10. Compare two strings using O(n) time with constant space?
11. Suppose you have an array of 1001 integers. The integers are in random order, but you know each of the integers is between 1 and 1000 (inclusive). In addition, each number appears only once in the array, except for one number, which occurs twice. Assume that you can access each element of the array only once. Describe an algorithm to find the repeated number. If you used auxiliary storage in your algorithm, can you find an algorithm that does not require it?
12. Count the number of set bits in a number. Now optimize for speed. Now optimize for size.13. Implement an algorithm to sort an array. Why did you pick the method you did?
14. Implement an algorithm to do wild card string matching.
15. Implement strstr() (or some other string library function).
16. Reverse a string. Optimize for speed. Optimize for space.
17. Reverse the words in a sentence, i.e. УMy name is ChrisФ becomes УChris is name My.Ф Optimize for speed. Optimize for space.
18. Multiple by 8 without using multiplication or addition. Now do the same with 7.
19. Add numbers in base n (not any of the popular ones like 10, 16, 8 or 2 Ч I hear that Charles Simonyi, the inventor of Hungarian Notation, favors -2 when asking this question).
20. Write routines to read and write a bounded buffer.
21. Write routines to manage a heap using an existing array.
22. Implement an algorithm to take an array and return one with only unique elements in it.
23. Implement an algorithm that takes two strings as input, and returns the intersection of the two, with each letter represented at most once. Now speed it up. Now test it.
24. WhatТs the difference between a linked list and an array?
25. Implement a linked list. Why did you pick the method you did?
26. Implement an algorithm to sort a linked list. Why did you pick the method you did? Now do it in O(n) time.
27. Implement an algorithm to print out all files below a given root node.
28. Given that you are receiving samples from an instrument at a constant rate, and you have constant storage space, how would you design a storage algorithm that would allow me to get a representative readout of data, no matter when I looked at it? In other words, representative of the behavior of the system to date.
29. How would you find a cycle in a linked list?
30. Give me an algorithm to shuffle a deck of cards, given that the cards are stored in an array of ints.
31. The following asm block performs a common math function, what is it?Х cwd xor ax, dxХ sub ax, dx
32. Imagine this scenario:I/O completion ports are communictaions ports which take handles to files, sockets, or any other I/O. When a Read or Write is submitted to them, they cache the data (if necessary), and attempt to take the request to completion. Upon error or completion, they call a user-supplied function to let the users application know that that particular request has completed. They work asynchronously, and can process an unlimited number of simultaneous requests.Design the implementation and thread models for I/O completion ports. Remember to take into account multi-processor machines.
33. Write a function that takes in a string parameter and checks to see whether or not it is an integer, and if it is then return the integer value.
34. Write a function to print all of the permutations of a string.
'1ч ░ ╕ ╬
╫
,6К№Ў№Ў№Ў№Ў№Ў№Ў№
hqб0Jhqб
2h╡█- ~ ё %
Я
╜
UТe
PР╬OгWО╦'╒U─·ї·ї························gdqбgdqбК¤─OАъQ▒FЙК········°gdqб ,1Рh░╨/ ░р=!░"░#Ра$Ра%░░╨░╨Р╨ЖЬ@@ё @NormalCJ_HaJmH sH tH F`BFqб Heading 4дdдd@&[$\$5Б\БDA@Є бDDefault Paragraph FontRi@є │RTable NormalЎ4╓
l4╓aЎ(k@Ї ┴(No ListB^`ЄBqбNormal (Web)дdдd[$\$"■oв"qбil_adК" 2h╡█-~ё%Я╜UТePР╬OгWО╦' ╒
U
─
OАъQ
▒FЙМI╚0АI╚0АI╚0АI╚0АI╚0АI╚0АI╚0АI╚0АI╚0АI╚0АI╚0АI╚0АI╚0АI╚0АI╚0АI╚0АI╚0АI╚0АI╚0АI╚0АI╚0АI╚0АI╚0АI╚0АI╚0АI╚0АI╚0АI╚0АI╚0АI╚0АI╚0АI╚0АI╚0АI╚0АI╚0АI╚0АI╚0А2h╡█-~ё%Я╜UТePР╬OгWО╦' ╒
U
─
OАъQ
▒FЙМK╚0ЯK╚0ЯK╚0ЯK╚0ЯK╚0ЯK╚0ЯK╚0ЯK╚0ЯK╚0ЯK╚0ЯK╚0ЯK╚0ЯK╚0ЯK╚0ЯK╚0ЯK╚0ЯK╚0ЯK╚0ЯK╚0ЯK╚0ЯK╚0ЯK╚0ЯK╚0ЯK╚0ЯK╚0ЯK╚0ЯK╚0ЯK╚0ЯK╚0ЯK╚0ЯK╚0ЯK╚0ЯK╚0ЯI╚0АI╚0АI╚0А
0ЙК
─ККkМъ5
8
j
k
ШЭFЙМ333Яp┴хqб @АЙЙp'4ЙЙК@@ Unknown GРЗz А Times New Roman5РАSymbol3&РЗz А Arial"1ИЁ╨hв▓ўжг▓ўжww!Ёа┤┤ББ4ВВЁHPЁ ?ф qб2 innov-8innov-8■ рЕЯЄ∙OhлС+'│┘0TИРЬи╕─╘ фЁ
(4<DLфinnov-8Normalinnov-82Microsoft Office Word@F├#@tаКХH╠@║cоХH╠w■ ╒═╒Ь.УЧ+,∙о0шhp|ДМФЬдм┤
╝╔фВцTitle
■ ■ !"#■ %&'()*+■ ¤ .■ ■ ■ Root Entry └FРУ╔ХH╠0А1Table EWordDocument ."SummaryInformation( DocumentSummaryInformation8 $CompObj q ■ ■
└FMicrosoft Office Word Document
MSWordDocWord.Document.8Ї9▓q