Preparing for an interview? Check out Cracking the Coding Interview
Published on

Microsoft | SDE 2 | Interview Experience

Author
  • Shared Anonymously

I was contacted by Microsoft based on my applications on their career portal. I would advice, if you're looking for a job at any MNC, keep your profile on their career site updated with a good resume and always trust that it might get selected some or the other time so be prepared and keep applying.

My Background: Masters from Tier I colleger, Working for a US based unicorn AI startup. Experience of around 4 years, and have worked for Google, Qualcomm and Intel (1 year intern) before this.

Online Assesment:

Question 1:
You are given a String S and a two-dimensional array of characters of size NXN named grid. Each field in the grid is either empty (denoted by a dot ".") or contains an uppercase English letter. Each particular letter may appear at most twice in the grid. Your task is to reconstruct the string S by visiting fields of the grid. You start the reconstruction with an empty string. You can choose the field in which you want to start. In one move you can change the current field to an adjacent one (up,down,left or right). If you visit a field containing a letter, you may append this letter to the end of the reconstructed string. Appending a letter is not counted as a move. Each field can be visited and each letter can be used multiple times during the reconstruction process. What is the minimum number of moves needed to reconstruct string S?
Write a function
class Solution { public int solution(String S, String[] grid); }
that, given a string S and an array grid, returns the minimum number of moves needed to reconstruct S. if it is not possible to reconstruct S, return -1.
I'll give you an example for better understanding
Given S="KLLRML" and grid=["K....","S...L","....R","LX...","XM..S"], the function should return 13. The optimal movement during the reconstruction process is as follows:

  1. start on the field containing "K".
  2. go to the field with "L" on the right side of the grid in five moves - note that while being on this field, two consecutive letters can be appended to your string;
  3. gather letters "R" and then "M" in 6 moves;
  4. Go to the closest field containing letter "L" in two moves.

Please suggest solution in comments if you find it. I had 2 test case failing.

Question 2:
I don't remember the question exactly but it was a direct derivation from Longest Airthemetic Subsequence question on LC.

I passed this, the criteria is 50% score , essentially pass atleast 1 question out of 2 accurately.

I got around 10 days to preapre, and had recieved an email with 3 round proposed, Round 1 at 9:15 AM, Round 2 at 12:15 PM and Round 3 (based on feedback)

Interviews

Round 1: (DSA)

My round started with a formal introduction, I had two questions in the round,

Question 1:
It was Stock buy and sell question, started with one buy one sell, and then upon discussion went on to two buys two sell. I wrote a working and a clean code, with some good comments and indentations.

Question 2:
I got an N queen problem, given N as input , the code needs to give a Matrix (respresenting a N sized chess board with all all indices filled a 'q' where queen can be placed. We had a thorough discussion, he was happy with the approach, and I coded it along. The program initially produced wrong output for some cases, and the interviewer discussed and observed how I am approaching such situtations. I wrote few log statements, did some basic tests, and found a small bug [i wote x+1 instead of x+i], and then it worked fine. He was happy with the approach.

At the end of the round I asked a few questions about the org, role, proposed project plans and similar relevant questions.

Round 2 (System Design + DSA )

This is not a dedicated System Design or a DSA round. I had two interviewers (one as a observer who was shadowing the interview) and other as a senior engineer taking the round.
Question 1
Design a Stock Market Application, the interviewer asked what all comes to my mind when I heared this applciation. I listed few Agents like Buyer, Seller, Broker, Manager and few services like Buy, Sell, Place orders, execute orders, market price manager, loggers, anti-cheat service etc. He was happy about the dimensions in which I thought through. He then proceeded for me to solve the core problem of the Application which was the service which executed order. His intent was to look into how concurrent orders can be placed and executed, how are we fulfilling the buy and sell and maintaining the market price of stock etc. I gave a heap based approach with multi threaded structure while we also talked about locks, synchronisation, Message Brokers, and other fundamentals of distributed System.
He was quite an experienced person and had a really good poker face, so it was really tough for me to guess his reaction :)

Question 2
We had a brief 15-20 minutes of discusion on the statement while(1). The conversation was around the compilation, parsers, how CPU executes it, what and how things are handled, how multithreaded, multiprocessing, and single-processing CPUs work. What are Kernal and User Processes, How synchronisation works. etc. He wanted to analyse my fundamentals in Computer science and this worked out well for me.

Round 3 (System Design)

I got a call in the afternoon if I can join in on the Third round of interview, I agreed and was interviwed by a Senior Manager for one of the Team at Microsoft. We started with a formal introduction and then with some details on my resume. Please make sure you atleast know everything on your Resume. They actually read and counter question on it. We discussed a few things on the current project, and then moved on to a question.

Question 1:
The Question was to build a Sudoku game with a Reload button that generates a new Sudoku puzzle whenever we click reload. I started with an approach and he got interested in it. We had a very detailed discussion on the approach , I came up with an alternative approach and he asked me which one would I liek to discuss, I told him the way to do the first one which was easier and said let's discuss the second one. He looked satisfied with my approach. We discussed follow up thigns like difficulty and how do we store data, making a good UX etc. The interviewer looked impressed and I believed this round would be cleared.

Round 4 (AA Round)
Surprisingly I did recieve a call from the Recruiter that the Hiring Manager wants to talk to me and she wants to setup a call in 10 minutes. I thought the day was going fine, so I decided to give it a go. The interviewer was a very senior person , more like on Director level or so. We discussed about current project, my role how did I handle technical challenges, and other technical details. He also asked a lot of behavioural questions like, what did you do when things did'nt turn out as expected, How do you resolve conflict within a team, what is that one thing you're proud of in your career. etc. It was around an hour long talk, the panelist was a very kind person. He also asked me about the interview experience and my day and honestly it was awesome to all standards. I have attended interview of some top companies like Google, Amazon, Intel, Qualcomm, Goldman Sachs and this was clearly the best one.

My recruiter just told me the feedback in 4 rounds were Good, and she sent out an email for submitting documents. I will keep editing this to update you guys about if I recieve an offer and other details. Fingers Cross.

Edit: Recieved a verbal offer from the recruiter after 16 days.

ReportMark as Helpful