Microsoft | SDE2 | 11th March 2022 [Reject]

Difficulty: MEDIUMCategory: InterviewExperienceFrequency: 1Asked On 2022-03-12Added By Anonymous
Source: Link

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.

1.One was to debug an issue with the given code
2.Second Problem : https://leetcode.com/problems/count-good-nodes-in-binary-tree/
3.Third Problem : https://www.linkedin.com/pulse/best-solutions-microsoft-interview-tasks-max-inserts-3-molchevskyi/


Round 1 (Level - Easy) : I was asked two coding questions

1I was given two strings S1 & S2 and needed to write a function to tell if we can rearrange the strings to make them equal. 2String modification was not allowed. 3Strings will have lower case alphabets only. 4Interviewer wanted a constant space and linear time complexity solution. Solved it quickly.

[Update] 2nd Question : Backspace String Compare Leetcode

1This question was again on strings, I was told that there is faulty keyboard 2and we can type only Upper case Alphabets and if we want to have a backspace then we can use $ symbol. 3Basically it was a string question, I had to write a function 4which 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.

1 2The question was like, I have a rooted binary tree and I need to tell the maximum width of the binary tree. 3Width means number of nodes that can come in between two leaf nodes. 4Example: 5 6 a a a a a 7 / \ / \ / \ / \ 8 b d b d b c b c 9 / \ \ \ \ 10 c e c e f 11 Ans : 4 (Between c & e) Ans:3 (Between c & e) Ans: 2 (Between b & c) Ans : 2 Ans: 1

The 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.

1He started with few threading questions and found me in a little uncomfortable position with 2multithreading. 3But anyway he started asking some pointer base lock questions ( FYI : I am a java guy, rarely come across pointers). 4He asked if you have two object refrences pointing to same memory in heap and 5if we take a lock using one of the object reference, then can I change the object using 6another reference variable using another pointer having location of the object in heap. 7 8Next he asked about Semaphores, I gave the definition but then he asked me implement a working 9semaphore. 10Here I wrote a class and methods to acquire and release locks but he wasn't happy with 11the 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 :)

Comments