I recently attended an interview at Microsoft. Following was my experience:
This was a written round. Everyone was given the following two questions:
- Find all the nodes at a distance k from a given node
- Given an array, arrange the elements such that the number formed by concatenating the elements is highest. E.g.: input = [9, 93, 24, 6], the output should be: [9,93,6,24]. This is because if you concatenate all the numbers, 993624 is the highest number that can be formed.
40 minutes was given for this round. However, if you request, they were giving extra time. After this round, lunch was served.
This was a face to face round. Almost everyone from first round was called in for the F2F interview. After a brief introduction, he asked me this question:
- Given an array with huge data (say n, where n can be upto a million), the values in the array are in the range of 1-k where k<<<n, sort the array. I gave a solution with binary trees but then he asked for more solutions and finally was satisfied when I gave him a solution with
O(k) extra space.
- He asked another question about thread safe singleton class and asked me to write a code for it and explain it.
- Then a few questions were asked about why Microsoft and similar stuff.
I don’t remember the question properly but it was something about arrays and swapping and finding the minimum cost possible.
- Longest Palindrome Substring set 1
However, the interviewer wasn’t interested in the code. He asked me to do a TDD for this problem. So he asked me to write test cases for this problem. He wanted to see if I can really analyze and find the various possible cases for this problem. After some struggle, I was able to find various different type of test cases. I gave a brute force solution.
- Maximum difference between two elements such that larger element appears after the smaller number
However, I gave a different solution than the one mentioned in this page.
- Write the implementation of String class. Implement any four methods of your choice.
- Write a code for the tail method of linux where you have to read some x lines of huge files from the end without reading the entire file. I gave some solutions based on indexing. The interviewer was very friendly and helped a lot in arriving at the solution.
Since it was quite late by the time this interview was over, they arranged a cab for me to go back home.
Overall, the experience was very nice. The interviewers and the HR were very friendly.
If you like GeeksforGeeks and would like to contribute, you can also write an article and mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
- Microsoft Interview experience for full time position of software engineer at Microsoft Ireland Research
- Microsoft Interview Experience | Set 151 (SDE-2 3.5 years experience)
- Microsoft Interview Experience | Set 169 (SDE 2 for 3.5 years experience)
- Microsoft Interview Experience (Full Time 2018 Washington DC - with 2.5 years of experience)
- Microsoft IDC Interview Experience | Set 38 (For Internship)
- Microsoft IDC Interview Experience | Set 37B
- Microsoft Interview Experience | Set 39 (On-Campus)
- Microsoft Interview Experience | Set 40 (Off-Campus)
- Microsoft Interview Experience | Set 41 (On-Campus)
- Microsoft Interview Experience | Set 42 (For SDE1)
- Microsoft Interview Experience | Set 43
- Microsoft IDC Interview Experience| Set 44
- Microsoft Interview Experience | Set 45
- Microsoft Interview Experience | Set 46 (Onsite)
- Microsoft IDC interview Experience | Set 47 (For 1.7 Years Experienced)
- Microsoft interview Experience | Set 48 (For 1.5 Years Experienced)
- Microsoft interview Experience | Set 49 (For Internship)
- Microsoft interview Experience | Set 50
- Microsoft Interview Experience | Set 51 (For SDE Intern)
- Microsoft Interview Experience | Set 62 (On-Campus for IDC)