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-
- Online Coding Round
- Written Coding Round
- Interviews
- 1st Coding Round
- 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.
- 2nd Coding Round
- 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.
- Interviews
- 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.
- 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?
It was an online coding round with 3 questions and hosted on cocubes.com. Just a matter of fact, everyone got a different set of three questions, better run-time and space complexity was awarded higher marks.
The set of three questions for me was -
It was an offline written coding round with 2 questions. Do write clean and correct codes, with appropriate names for variables and proper indentation.
The questions were -
I went through three rounds of interviews with different persons, with around 2 questions in each round. The third round also had a discussion over my projects.
The standard ones -
The standard ones -