Home Company Questions Microsoft Interview Questions Microsoft Interview Questions - 1

Login Form




Microsoft Interview Questions - 1 Print E-mail

1. Given a string 'abcdef' and another string 'efg' remove all occurences of the characters in 'efg' from 'abcdef'. Write 'to ship' code and give test cases. Design a program to test any implementation of this problem

 

2. This contained series of questions on C++.
-What are virtual functions? Why are they used? Give examples.
-What are pure virtual functions and abstract classes? When do we use it?
-Where are virtual functions stored in the memory? How does the object knows
that the virtual function to be called is from base class or derived class?
-What is VTable (virtual table) and what does it do?

 

3. I have an array consisting of 2n+1 elements. n elements in it are married, i.e they occur twice in the array, however there is one element which only appears once in the array. I need to find that number in a single pass using constant memory. {assume all are positive numbers}

Example : - 3 4 1 3 1 7 2 2 4
Answer : - 7

 

4. Given a BST (Binary search Tree) how will you find median in that?

Constraints:
-No extra memory.
-Function should be reentrant (No static, global variables allowed.)
-Median for even no of nodes will be the average of 2 middle elements and for odd no of terms will be middle element only.
-Algorithm should be efficient in terms of complexity.

Write a solid secure code for it.

 

5. There is a central server and some clients connected to it. All the changes made to data occur at the server, and all the clients have just read access. You have two options:-


1. Push :- The server keeps pushing data to the clients.
2. Pull :- The client keeps requesting the server to send data.


What are the advantages and disadvantages of each type.
Design a system which uses both the push as well as pull strategy.

 

6. Given a set of numbers find the number that occurs more than N/2 number of times.

 

7: Given a NxN matrix with 0s and 1s. now whenever you encounter a 0 make the corresponding row and column elements 0. Flip 1 to 0 and 0 remains as they are.

Example 

1 0 1 1 0
0 1 1 1 0
1 1 1 1 1
1 0 1 1 1
1 1 1 1 1


results in

0 0 0 0 0
0 0 0 0 0
0 0 1 1 0
0 0 0 0 0
0 0 1 1 0

 

8. Difference between a 32-bit OS and a 64-bit OS. Some questions on address space and fetch cycles/ Instruction Set of a processor.

 

9. Given a file with a lot of words (10 million) find out the top 10% most frequently occuring words.

 

10. Whats the diff b/w a thread and a process? Are Word and Powerpoint different processes or threads of a single process?