Microsoft Interview experience | Set 119 (For Internship)
Microsoft visits our campus every year as a part of the intern hiring program in the Day 1 slot. The procedure consists for three major steps- Now, moving up the ladder in sequential steps-
Note:I am writing just the questions such that you literally visualize yourself into this interview. I will be discussing the answers if there arises a demand for so.
Microsoft visits our campus every year as a part of the intern hiring program in the Day 1 slot. The procedure consists for three major steps-
Now, moving up the ladder in sequential steps-
The set of three questions for me was –
- Given n and m, find the nearest number to n which is divisible by m. If there exist two numbers at same distance, output the greater one.
- Given an integer n, if the binary representatino of this number is a palindrome, then find the number of ones. You are required to accomplish the task without using any data structure.
- Given a binary tree, find the length of the smallest path from the root to a leaf node with a given sum, in constant space.
A lot of students were shortlisted from this round as doing all the three questions wasn’t too tough here.
The questions were –
- Given a string as “Being in an IIT worths a lot”, convert it to “lot a worths IIT an in Being”. Don’t use string library functions.
- Given an array of integers, find the subsrray with the maximum product.
35 students were shortlisted from this round. An alert to be ready for surprises – the selection procedure wasn’t transparent enough for you to be confident in getting an entry to the next round. What I mean to say is, many among those who were shortlisted did it Wrong, and many others who did everthing fine weren’t granted an entry.
The standard ones –
- Join all nodes at same level in a binary tree. Do this iteratively with constant extra space.
- Find whether u and v are connected in a directed graph, if yes, print the path.
A bit interesting than those above-
- Do the first question of the written coding round without using ANY extra space, in O(length of string).
It’s intersting just bcoz it’s something different.
- How would you implement a LRU cache?
Apart from these things, they also considerd the CGPA for the final shortlisting.
This article is contributed by Shivam Dubey. If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more, please refer Complete Interview Preparation Course. In case you are prepared, test your skills using TCS, Wipro, Amazon. Google , E-Litmus and Microsoft Test Serieses.