Years of Experience : 5
On 11th March 2022, I appeared for Microsoft Hiring Drive for Bangalore location. Unfortunately I was eliminated on 3rd round, where I was grilled on Synchronization, Pointers and Semaphores.
Codility (Level - Easy): 3 questions. This was 2 days before hiring drive day.
Round 1 (Level - Easy) : I was asked two coding questions
I was given two strings S1 & S2 and needed to write a function to tell if we can rearrange the strings to make them equal.
String modification was not allowed.
Strings will have lower case alphabets only.
Interviewer wanted a constant space and linear time complexity solution. Solved it quickly.[Update] 2nd Question : Backspace String Compare Leetcode
This question was again on strings, I was told that there is faulty keyboard
and we can type only Upper case Alphabets and if we want to have a backspace then we can use $ symbol.
Basically it was a string question, I had to write a function
which will parse the two strings passed as inputs and tell whether the strings are equal or not.I came up with a stack approach, but again Interviewer asked for constant memory, so I implemented the solution using two pointers.
Interviewer was happy and the round ended.
Round 2 (Level - Intermeditate) : I was asked only one coding question in this round.
The question was like, I have a rooted binary tree and I need to tell the maximum width of the binary tree.
Width means number of nodes that can come in between two leaf nodes.
Example:
a a a a a
/ \ / \ / \ / \
b d b d b c b c
/ \ \ \ \
c e c e f
Ans : 4 (Between c & e) Ans:3 (Between c & e) Ans: 2 (Between b & c) Ans : 2 Ans: 1The question was a little vague, but I hope you guys will understand by test cases shown above, also in case of full binary tree the ans will be Math.pow(2, height of binary tree).
I implemented few approaches like level order traversal and height of tree methods, all approaches missed a few corner cases.
Round 3 (Level - Intermeditate): I was not sure I was going to get this round as I screwed up in last round by not giving the 100% accurate solution.
This round started with deep dive into my professional journeys, lot of discussion about my current project & previous projects and few behavioural questions.
The came the topic which I dread the most.
He started with few threading questions and found me in a little uncomfortable position with
multithreading.
But anyway he started asking some pointer base lock questions ( FYI : I am a java guy, rarely come across pointers).
He asked if you have two object refrences pointing to same memory in heap and
if we take a lock using one of the object reference, then can I change the object using
another reference variable using another pointer having location of the object in heap.
Next he asked about Semaphores, I gave the definition but then he asked me implement a working
semaphore.
Here I wrote a class and methods to acquire and release locks but he wasn't happy with
the implementation. (I know I didn't implement it correctly, this question was like out of syllabus for me :(After this round I received a mail saying they have decided not to go any further with my candidature this time.
My opinion : Microsoft interviews are not very hard and please brush up on threading and different locking mechanisims. These topics seem to be microsofts favourite.
Today is 12th March and I have already applied to Microsoft again :p . I dont care about the cooling period so nothing wrong with trying.
I understand this post may be a little verbose, hope it helps anyone.
LeetCode status : 
I know I need to practice more and that's what I am doing. And yeah if you liked the post please upvote.
Happy coding :)
Update : Interviewed again in May and got an offer this time :)