Microsoft Placement Paper : Microsoft Placement Paper HR Interview 2012
Microsoft Placement Paper : Microsoft Placement Paper Tech Interview 2012
Microsoft Placement Paper : Microsoft Placement Paper Technical 2012
Microsoft Placement Paper : AIT Pune ,22 December 2010
Microsoft Placement Paper : Mumbai ,24 May 2008
Microsoft Placement Paper : DA - IICT, Gandhinagar ,26 July 2007
Microsoft Placement Paper : Microsoft Placement Paper November 2010
Microsoft Placement Paper : General - Interview
These Are one of the Microsoft Interview Questions
Well i gave a the some weird eg where the struct was not a Binary tree but if passed through the test will give positive results.then he asked me to solve for that too.
Round 2:
The interviewer gets a bit serious with each stage. He will test ur work for all possible set of inputs.
Prologue: Well in my case he started with how they require not only a programmer but a designer and coder who writes perfect code.
"aabbccdef" and o/p "a2b2c2def" or "a4bd2g4" for "aaaabddgggg"
write it perfectly as if it should ready to be shipped after you code it.
Round 3:
For me some Qs on DB Lock Manager?
Microsoft Interview Questions and Answers
1. How could you determine if a linked list contains a cycle in it, and, at what node the cycle starts?
There are a number of approaches. The approach I shared is in time N (where N is the number of nodes in your linked list). Assume that the node definition contains a boolean flag, bVisited.
struct Node
{
...
bool bVisited;
};
Then, to determine whether a node has a loop, you could first set this flag to false for all of the nodes:
// Detect cycle
// Note: pHead points to the head of the list (assume already exists)
Node *pCurrent = pHead;
while (pCurrent)
{
pCurrent->bVisited = false;
pCurrent = pCurrent->pNext;
}
A much better approach was submitted by 4Guys visitor George R., a Microsoft interviewer/employee. He recommended using the following technique, which is in time O(N) and space O(1).
Use two pointers.
// error checking and checking for NULL at end of list omitted
p1 = p2 = head;
do {
p1 = p1-gt;next;
p2 = p2-gt;next->next;
} while (p1 != p2);
p2 is moving through the list twice as fast as p1. If the list is circular, (i.e. a cycle exists) it will eventually get around to that sluggard, p1.
2. How would you reverse a doubly-linked list?
This problem isn,t too hard. You just need to start at the head of the list, and iterate to the end. At each node, swap the values of pNext and pPrev. Finally, set pHead to the last node in the list.
Node * pCurrent = pHead, *pTemp;
while (pCurrent)
{ pTemp = pCurrent-gt;pNext;
pCurrent-gt;pNext = pCurrent->pPrev;
pCurrent-gt;pPrev = temp;
pHead = pCurrent;
pCurrent = temp;
}
3. Assume you have an array that contains a number of strings (perhaps char * a[100]). Each string is a word from the dictionary. Your task, described in high-level terms, is to devise a way to determine and display all of the anagrams within the array (two words are anagrams if they contain the same characters; for example, tales and slate are anagrams.)
Begin by sorting each element in the array in alphabetical order. So, if one element of your array was slate, it would be rearranged to form aelst (use some mechanism to know that the particular instance of aelst maps to slate). At this point, you slate and tales would be identical: aelst.
Next, sort the entire array of these modified dictionary words. Now, all of the anagrams are grouped together. Finally, step through the array and display duplicate terms, mapping the sorted letters (aelst) back to the word (slate or tales).
4. Given the following prototype:
int compact(int * p, int size);
write a function that will take a sorted array, possibly with duplicates, and compact the array, returning the new length of the array. That is, if p points to an array containing: 1, 3, 7, 7, 8, 9, 9, 9, 10, when the function returns, the contents of p should be: 1, 3, 7, 8, 9, 10, with a length of 5 returned.
A single loop will accomplish this.
int compact(int * p, int size)
{
int current, insert = 1;
for (current=1; current < size; current++)
if (p[current] != p[insert-1])
{
p[insert] = p[current];
current++;
insert++;
} else
current++;
}
Microsoft Placement Paper : Whole Testpaper DA - IICT, Gandhinagar - 26 July 2007
MICROSOFT PAPER ON 26th JULY
Selection procedure and interview questions of Microsoft at Dhirubhai Ambani Institute of Information and Communication Technology (DA-IICT)
There were 4 rounds for selection procedure. First round was a written test, second round was group interview and 3rd and 4th rounds were technical interview. Each round had eliminations. Total 143 students were eligible for written test and 16 students were selected for the next round, ie. group interview. Only 8 students were able to go for 3rd round of technical interview. In 3rd round 4 more students were eliminated and remaining 4 students went for final round of technical interview. Only 1 student got an offer finally from Microsoft.
Following is the detail about each round.
Note: All examples which I will give here are just for your understanding. Interviewer was not giving any examples. Hardly 2 – 3 time interviewer gave examples.
Round 1: Written test
Paper style: 3 subjective questions
Time limit: 1˝ hour
Question 1: Finding output....
It was string cruncher program. First remove all repeated consecutive substring with length 1, then delete substring of length 2 and so on...
Example : string is “abcabeccced”
After removing repeated substring of length 1: “abcababceccced” --> “abcababceced” (2 ,c, are removed)
After removing repeated substring of length 2: “abcababceced” --> “abcabceced” (substring “ab” is removed)
and so on...
Question 2: Writing a program.
Definition: You are given 3 integer arrays A, B and C of length n1, n2 and n3 respectively. All arrays are sorted. We define triplet of these 3 arrays as (x,y,z) where x is any integer from A, y from B and z from C. We define distance of triplet as maximum difference among triplet elements, i.e. Maximum of x – y, y – z or z – x. Write a program to find minimum triplet distance. (means there are n1*n2*n3 number of possible triplets are possible...among all triplets which triplet has minimum distance...Give only distance, but not triplet elements). Your program must be as much efficient as possible.
Question 3: Writing program.
Definition: You are given 2 integer numbers in linked list form. Add those 2 numbers.
Example: First number is 234 and second number is 35. So, you are provided with 2 linked lists 2->3->4 and 3->5. Your answer must be 2->6->9. (Make sure to take care of carry number). This example was given in paper.
Round 2: Group Interview
All candidates who had cleared the written test were called for group interview. Here we were given 3 problems one by one. Time limit was between 15 to 20 minutes. Once they gave problem definition we were supposed to think on it and discuss our ideas and logic about solving that problem with one of the representatives from Microsoft. Once that representative was convinced with our logic then we had to write code for that problem on paper.
Problem 1: You are given a string. Develop a function to remove duplicate characters from that string. String could be of any length. Your algorithm must be in space. If you wish you can use constant size extra space which is not dependent any how on string size. Your algorithm must be of complexity of O(n). Example: Given string is BANANAS. Output must be BANS. All repeated characters are removed.
Problem 2: You have a tree and address of its root. Write an efficient program to test whether a given tree is Binary search Tree or not. (Hint: In-order traversal of binary search tree is sorted in increasing order. Use this property to develop program)
Problem 3: You have 2 sorted lists and a function that merge that 2 lists such that output is again sorted and duplicates are removed. That means output is union of those 2 lists in sorted form.
Example: First list is 2->3->5->6->8 and second list is 4->5->6->7 and output of function is 2->3->4->5->6->7->8.
Develop test cases to test given function such that your test cases ensures that given function works for every situation. That is if inputs are valid then it gives proper output in any case or otherwise it shows error message.
Round 3: First Technical Interview
All those who had cleared group interview were called for first technical interview. They were taking minimum 2 hours for first interview. Some of us also faced interview for 3 or more hours.
Round 4: Second Technical Interview
All those who had cleared first technical interview were called for second interview. This was last round of interview. They took 1˝ to 2 hours for this second interview.
I don,t remember all the questions which were asked to me in both interviews. But still some of the questions which I can remember (almost 80 to 90% questions) are listed below.
In both interview they ask questions from C/C++, java, OS, Data structure and algorithms, Microprocessors and compiler constructions. With this, they also asked me to develop more than 6 to 8 programs. You can develop all programs in 5 to 7 minutes. But after writing program they asked to find its complexity and try to reduce the complexity and write the program again. In this way it took almost 15 to 20 min for each program. Some took less than 15 minutes also.
Some of the interview questions are as follows:
You are given a linked list and block size k. Reverse block of size k from list.
For example you are given linked list of 1000 nodes and block size is 5 then instead of reversing whole list, reverse first 5 elements, then 6 to 10 elements, then 11 to 15 elements, and so on...You have singly linked list and your algorithm which you will implement must be in space, that is no extra space is allowed.
You are given a tree and any 2 nodes of that tree. Find common parent of both nodes. Develop as much efficient program as you can.
In unix there is a command called “tail”. Implement that command in C.
Some questions about race condition (OS)
Questions related to semaphores.
Questions related to mutex. Applications of mutex. How to implement mutex in OS?
Questions about Critical region (OS).
How to ensure that race condition doesn,t occur. Give your view as you are OS designer.
How to ensure that each process lock the critical region before they enter in it. As OS designer How will you force the process to do this?
Questions on IPC
Questions on Shared memory and Message passing mechanism.
Difference between system call and API call
How system call works? What happens when system call is invoked?
Different types of system calls?
Some questions from microprocessor. About Interrupts
Types of Interrupts. What happened when interrupt is called?
You are given a hard copy of a program which contains some errors. Your job is to find all types of errors from it. And discuss why is it an error. Write correct program for the same.
You are given a linked list and a number n. You also have a function to delete all nodes from that list which are at position which multiple of n in the list.
Example: if number is 3 then delete 3rd, 6th, 9th ,...nodes form the list. Develop a program that tests whether given function works properly or not. (In short they are asking me to develop general program for all test cases. By running that program all tests can be performed.)
Questions on java. Exception handling
Need of catch and finally block in java exception handling..
How will you create your own exception.. Explain with example.
Some questions on compiler construction. What is parser? What is input to the parser and what is output of parser? Difference between top down and bottom up parser.
F(1) = 1.
You are given a string which contains some special characters. You also have set of special characters. You are given other string (call it as pattern string). Your job is to write a program to replace each special characters in given string by pattern string. You are not allowed to create new resulting string. You need to allocate some new memory to given existing string but constraint is you can only allocate memory one time. Allocate memory exactly what you need not more not less.
Assume that your friend is writing a book . He gives you a file that contains that book. Your job is to develop an algorithm for indexing of that book. In every book there is one index at end which contains some words which are not there in normal vocabulary dictionary. It also contains page number for reference. You can use any data structure you want. You need to justify why you have used that data structure and also need to justify your logic.
Question from my B.E. final semester project. Asked me to explain whole project.
Question from everything written on my resume.
Question from my every project I did. They asked me to explain each project and then how to do some modification? That modification will be suggested by interviewer himself.
My experience in Teaching assistantship.
They had my written test answer sheet. They opened it and asked me to explain why I gave that output or why I implement that logic. How did I arrive to that solution which I had written in answer sheet.
In written test, for second question I had implement a program which was not much efficient. During interview they ask me to optimize my program. They also gave hint to optimize it.
During group interview, in second problem I was only able to discuss logic I was unable to develop program in given time limit. Interviewer knew this. She asked me to develop that program during interview.
Which is your favorite software tool? If you are allowed to add any feature in it which feature you will add?
Which is your favorite subject? Some questions from that subject.
Something about yourself , your hobbies, interests, strengths and weakness.
Microsoft Placement Paper : Whole Testpaper Ohio College of Technological Studies - 29 January 2007
MICROSOFT PAPER ON 29th JANUARY
1) Coldest planet:Pluto
2) INS Shivali is the first:
3) Which one of the following was NOT indegineously developed?:Prithvi/Akash/Agni
4) Full form of SARS
5) Anthrax is a :Virus/Bacteria/.../...
6) Dakshina Gangothri is:Ganga,s origin/Indian camp @ antartica/.../...
7) Which of the following is a chemical weapon:Mustard Gas/Marsh Gas/.../...
8) A question based on Coding and Decoding
9) Another question similar to above
10) Question on series completion
11) Another series completion question
12) Where is Institute of Forensic Science?:Hyderabad
13)A G.K question based on chromosomes in males and females
Sample technical questions asked in test last year in CSE :
1) Banker,s algorithm is used for: Deadlock Avoidance
2) A LOT of questions were based on generating strings from a given grammar.
3) A circle(dot) shown in the PCB is:Vcc/Grnd/Pin 1/Pin 14
4) Program Segment Prefix in MS-DOS 5.0 is:
5) Some IP addresses were given and the question was to select the private addess from it(?)
6) 10Base2 and 10Base5 wires refers to:
7) A question on sliding-window protocol
8) Which of the following require a driver?:disk/cache/ram/cpu
9) A LOT of mathematical questions which were asked from calculus,trigonometry...
The questions asked in ECE were mainly from Control Systems, Communications EMT and microprocessor
Make sure that u know the fundas of microprocessors useful in interview also: see if u know these questions
1. Which type of architecture 8085 has?
2. How many memory locations can be addressed by a microprocessor with 14 address lines?
3. 8085 is how many bit microprocessor?
4. Why is data bus bi-directional?
5. What is the function of accumulator?
6. What is flag, bus?
7. What are tri-state devices and why they are essential in a bus oriented system?
8. Why are program counter and stack pointer 16-bit registers?
9. What does it mean by embedded system?
10. What are the different addressing modes in 8085?
11.What is the difference between MOV and MVI?
12. What are the functions of RIM, SIM, IN?
13. What is the immediate addressing mode?
14. What are the different flags in 8085?
15. What happens during DMA transfer?
16. What do you mean by wait state? What is its need?
17. What is PSW?
18. What is ALE? Explain the functions of ALE in 8085.
19. What is a program counter? What is its use?
20. What is an interrupt?
21.Which line will be activated when an output device require attention fromCPU?
Then comes the interview questions asked in ECE interview were fundamental.Qustions asked in my interview were:
Director
1. Which college and university are you coming from?
2. Did you appear for GATE? Why are you not interested in higher studies?
3. Did you appear for IES?
4. Did you appear for any other board interview of public sector?
5. The subjects you have learned in college can be divided into three- basic electronics, communi-cation and digital logic. Tell me any five subjects you like.
(I told radar and navigational aids, electronic warfare, satellite communication, biomedical instrumentation, fuzzy electronics and basic digital electronics as my subjects)
Board member1 (QUESTION LEVEL- MODERATE)
1. Write the truth table for full adder and implement it in NAND gate only.
2. What,s the difference between looping 0s and 1s in K map?
3. Difference between microprocessor and micro controller
4. Microprocessors you are familiar with
5. How will you send and receive data to a micro-processor? (One method is I/O mapped I/O which is the other one?)
6. Radar range equation?
7. Does the radar range depend upon the frequency of the signal transmitted?
8. What is Doppler shift? What is its importance?
BOARD MEMBER -2 QUESTION LEVEL- TOUGH)
1. I will make two fuzzy statements. Pencil is long. Table is long. What is the term long signify?
2. What is a membership function?
3. What are the design criteria for very low frequency amplifier?
4. Can you measure distance with the help of CW radar? If so how?
5. How will you design a stable oscillator? (Not with crystal oscillator because temperature affects it)
6. You have designed an amplifier. After few days it is found that its gain have changed. What might be the reason?
BOARD MEMBER-3 (QUESTION LEVEL- MODERATE)
1. A plane is moving in a circular path around the transmitter of the radar. Will there be Doppler shift detected in the radar?
2. State Keplers laws
3. Why there is more geo synchronous satellite?
4. The angular difference between two satellites is 2 degree. What is the maximum number of satellites needed to cover the whole earth?
5. What is the minimum number of satellites needed to cover the whole earth?
BOARD MEMBER-4 QUESTION LEVEL- MODERATE)
1. Which is the law of conservation involved in the second of Keplers?
2. Why do you explain elliptical orbit while stating Kepler,s law? Why not circular orbit?
3. What are the advantages of optical communication?
4. What are the invasive and non-invasive methods of instrumentation?
For CS guys they started with this question: What is a key board? Where u will connec? What will happen if you press the keys?..
For maths guys they asked some questions on series.. I don,t know muchSome guys were selected just by describing the final year project.
1. How can you design a phase detector using a XOR gate?
2. Questions abt differentiator and integrator. What will happen if we increase/decrease the values of R/C?
3. how will a low/high pass filters behave to different signals –ramp, pulse etc
4. questions on flip flops
5. Johnson counter
6. Questions on microprocessors- what is SIM?
7. Abt your project. What will happen when this/that happens to your project?
8. Radar, antenna and satellite communication.
9. Which is the first/latest communication satellite?
10. What is apogee /perigee?