Tip 1 : Practice at least 300 coding questions.
Tip 2 : Be confident during the interview and never hesitate to ask if you are stuck. They will definitely help you out.
Tip 1 : Mention some good projects on your resume.
Tip 2 : Don't put false things on your resume.
Conducted on https://tests.mettl.com/ and contains 3 coding questions with different difficulty levels – Basic, Easy, and Medium and carrying marks accordingly.
Those who had solved at least 2 questions were selected for the next round. I was able to solve all of them and around 90 students were selected for the next round.
1. It is guaranteed that division X / Y is always finite.
Consider X = 5, Y = 4 and N = 5, then you should return “1.25000”.
Note, here we add 3 trailing zeros so that it has exactly 5 digits after decimals.
str = "ababc"
The longest palindromic substring of "ababc" is "aba", since "aba" is a palindrome and it is the longest substring of length 3 which is a palindrome.
There is another palindromic substring of length 3 is "bab". Since starting index of "aba" is less than "bab", so "aba" is the answer.
Let S = “abdd” and X = “bd”.
The windows in S which contain all the characters in X are: 'abdd', 'abd', 'bdd', 'bd'.
Out of these, the smallest substring in S which contains all the characters present in X is 'bd'.
All the other substring have a length larger than 'bd'.
It was a pen and paper-based round. 2 questions were given, and we have to solve them efficiently and specify our approach clearly.
Those who had solved both the problems efficiently and able to explain their ideas clearly were shortlisted for further rounds. 24 students selected for the interviews.
class BinaryTreeNode {
int data; // Value of the node.
BinaryTreeNode *left; // Pointer to left child node.
BinaryTreeNode *right; // Pointer to right child node.
BinaryTreeNode *next; // Pointer to next right node at same level.
}
Consider the figure shown below. The left part represents the initial binary tree and right part represents the binary tree after connecting adjacent nodes at the same level.
In the tree shown in the picture above -:
The ‘next’ pointer of the node having value 2 is connected to the node having value 3.
The ‘next’ pointer of the node having value 4 is connected to the node having value 5.
The ‘next’ pointer of the node having value 5 is connected to the node having value 6.
The ‘next’ pointer of nodes having value 1, 3, 6 will have a value NULL as there are no next right nodes in their cases.
1. The structure of the ‘Node’ of a binary tree is already defined. You should not change it.
2. The root of the binary tree is known to you.
3. There is at least one node in the given binary tree.
4. You may only use constant extra space.
1. Every train will depart on the same day and the departure time will always be greater than the arrival time. For example, A train with arrival time 2240 and departure time 1930 is not possible.
2. Time will be given in 24H format and colons will be omitted for convenience. For example, 9:05AM will be given as "905", or 9:10PM will be given as "2110".
3. Also, there will be no leading zeroes in the given times. For example, 12:10AM will be given as “10” and not as “0010”.
The interview started with a brief introduction about myself, the interviewer told me to continue for straight 5 mins (I only prepared for 2-3 mins so I started telling about what I have done in the college… So be prepared for it )
Then he moved on to the previous round question (2nd que of the group fly around). He had my solution and told me to validate my code for different test cases. The interviewer was trying to prove that my approach is incorrect by adding new edge cases every time but in the end, he was satisfied with the approach. He also asked about the implementation of Min-Heap since I have used it in my code.
This discussion went around 30- 35 mins then he asked me about the different technologies that I have worked upon and a little discussion about them. In the end, I asked him a few questions about Microsoft life and the culture of Microsoft.
The interviewer was very cool, he was looking at my resume and I have written web series and cricket in the hobbies section, so he asked a few ques-
Can you name all the web series that you’ve watched? (He asked a few character’s names from GOT maybe he was just checking that I’ve watched it or not)
Fav player in cricket and why?
What do I do bowling or batting?
He told me since I have to manage lectures, labs, assignments, web series, cricket, and many other things so let’s do the job scheduling problem. . I took some time and came up with a recursive approach. He pointed out some edge cases that I was missing and asked me to correct them and I did so. Now he asked if I can use DP to further optimize this solution. I tried but not getting the correct approach then I asked him for help and finally, after 2 tries I was able to write it, and he seems satisfied as well.
What is a Binary tree?
What is a binary search tree?
He asked many questions, I asked a few-
-> Areas of improvement.
-> Technologies that I/everybody should know.
-> About work-life balance at Microsoft.
The interviewer asked, What is the name of your previous interviewers? I only remember the 2nd interviewer’s name since the 1st one didn’t tell me his name and I didn’t ask. She said You should have asked his name. (I made sure that I’ll ask her name in the end) then some quick questions-
Fav Data structure and why do you think this is your fav?
What is an abstraction in java?
Draw the class structure of an ATM.
Write the methods that you have used in the class structure of the ATM machine.
Write some strings. (Yeah you read it correctly!!!) I don’t know what kind of ques is this but I wrote some uppercase string, lowercase string, and a string with the value “String”.
Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
How do you create a function in JavaScript?