I interviewed with Microsoft at Redmond office this Friday (10/25). I enjoyed the experience, however it did not go as good as I wanted it to go but it was okay! I thought I’ll share it here for anyone who might find it useful!
I got to speak with four different people, One of them was just mostly discussing my resume and questions were based on what I had in there, rest of them asked me to do whiteboard programming, one problem with each person. If you were wondering about the questions, it was all leetcode questions. I could only practice so many leetcode questions right? I wasn’t surprised that two of the three problems were the ones that I didn’t get a chance to look at while practicing!
Here’s what I did with each interviewer:
First: just talking about me and my resume! It felt like an ice breaker to me! Though there were few small details I messed up, I THINK this one went good!
Second: (Programming question - rotated sorted array, find the index of the rotation)
I discussed two approaches, one that runs in O(n) time and then a O(log n) solution. While I started coding out the second approach since it was better runtime, I think I got stuck with a bug in my code and before I could figure out what it was we ran out of time. But I enjoyed speaking with the interviewer!
Third: (Programming question - clone linked list with a random pointer)
The interviewer was expecting a O(n) solution and what was unusual for me was that I was immediately provided with a hint to solve the problem upfront before even I could start processing/understanding the problem. I honestly don’t know what the intentions were and I am still wondering from an interviewer’s prescriptive why would they do that? Anyway, after I understood what the problem was and considering the hint, It did not ring any bell. So I mentioned I am going to try solving it in a different direction and was not using the hint just yet. I was only able to solve it in O(n^2) time (didn’t have time to code it) and until the end I couldn’t figure out how to solve it in liner time using the hint since we ran out of time. I am happy at least I came up with a quadratic solution in the last fifteen minutes. (Phew!!!)
Fourth: (Programming question - serialize and deserialize a binary tree)
The interviewer was expecting for a O(n) solution. I was trying and discussing a few different ways while eventually figured out a O(n) solution. The interviewer was excited that my approach was a different one from theirs and was interesting. When I was coding it out, I missed a few edge cases and the interviewer was pointing it out. It felt like we were solving it together. I kept fixing it and finally coded it fully well ahead of time. In the last ten minutes I was asked about a small poorly designed/written code snippet that complies fine to figure what could be done to improve it. I couldn’t figure out and we ran out time. I was told then told what the solution was!
Thanks!