- Published on
MICROSOFT || Sde-1 interview experience || On campus
- Author
- Shared Anonymously
Hi, I am an MTech grad from Tier-1 college. Recently I got on campus opportunity to give an interview for SDE -1 at Microsoft.
Below is my full detailed interview experience of Microsoft -1st dec 2022
I was very excited since it was my life first job interview so15 People from my IIT were shortlisted out of which 6 were from my batch, i.e. from MTech CSE and remaining were from BTech. In my IIT microsoft was slotted in 1.1 slot at 4 AM. There were two rounds 1st one was completely technical another one is also a technical but bit of HR questions too. Both rounds were taken on a zoom call.
1st Round (Technical Round) - The interviewer was sitting in the room, he was quite a chill person. He was working in Microsoft for the past 13 years at the Hyderabad office. Initially, We greet each other then after he asked about my college life whether I am enjoying the campus or not. After that he asked me to introduce myself. He was not interested in the project and directly jumped to the coding question.
He shared a codility platform link and pasted the question in the platform which was based on “Multisource BFS”. The questions was as follows -
In the village there are some houses and some stores that are represented in a 2-D Matrix. Houses are represented by \u2018H’ and stores are represented by \u2018S’. The task is to find the minimum moves to reach the store from all the houses.
Input -
H H H S H H H
S H H H H S H
H H H H H H H
Output -
1 2 1 0 1 1 2
0 1 2 1 1 0 1
1 2 3 2 2 1 2
Constraints - N,M = 10^3
Initially I have told the recursion solution then have told him the bfs solution. Both are not optimal. The BFS solution I told him was to call bfs for each house and then to find the nearest stores. He asked me to dry run my approach for the input test case. Then we discussed the time complexity and he asked me to optimize it. Then I told him to start the BFS call from each store rather than from each house. He asked me to code it. When I coded it I was taking the new visited in each bfs call from stores. He asked me you don’t need to have new visited each time then I explained to him that we need to have new visited because from the first store you will reach all the houses and the distance of each house will be calculated from that store only. For remaining stores the houses will be visited so it will not be possible to find the minimum moves. So there should be new visited each time and for each house it is required to maintain the minimum distance. He was satisfied by my thoughts and said “yes you are right, I got confused”. He asked me what could be possible corner cases in the questions. I told him some of the corner cases that my code was handling. Then he asked me do you have any questions, I asked him about his experience at Microsoft, and the expectation at Microsoft for the fresher candidate. He seems to be quite happy after the interview and also asked me to join the next round.
Tips(according to me) -
- Don't waste much time in explaining not optimal solution.
- Interviewer may ask you question to test your concepts for that be confident about your concept and explain them your approach.
Round 2 (HR + Technical) - After 1 hour, my second round was scheduled. In between I had an Uber Interview too(do check it as well here - https://leetcode.com/discuss/interview-experience/3657138/Uber-oror-SDE-1-Interview-Experience-oror-On-campus )
Initially he asked me how I am doing today. Then he asked me to introduce myself, after that he asked me about my favorite subject and about its project. He asked follow up questions about what I had learned from those projects. Then again a codility link was shared by him, the question was as follows.
There is a string and also a list of tags. You have to insert the bold tags to the substring that are present in the taglist.
Input 1 -
str = abcdbef
tagList = { “cd” , “ef”}
Output - abcdbef
Input 2 -
str = abcdef
tagList = { “cd” , “ef”}
Output - abcdef
Note that for an overlapping case, bold tags should also be overlapped.
Initially he asked whether I am familiar with html or not. Then I tried to clarify the question by asking questions. I asked him , ''Is it possible that tags can be present more than once in the string or not ?'' He replied, ''good question and yes you may have repetition of the same tags in the string and you have to bold all of its occurrences.''
I told him the brute force approach, but it was not optimal. Then I told him that I will maintain a boolean array of size n(size of the input string) named as haveToBold. For each tag, I was searching that tag into the string and if it is present then the index of the corresponding substring is set to the haveToBold. At last, Will iterate the haveToBold array and if it is true then start the bold tag and whenever there is any start bold tag and the haveToBold is false then I will add the closing bold tag. He was satisfied with this approach and asked me to code it. I was explaining the code while writing it on the platform but he asked to write code first then explain it. So I coded it in 4-5 minutes. After that when I asked him that I had completed the code he asked me to put some debugging statements in the code. I did that, then he was interested in the code and its explanation. He gave me 2-3 test cases, which my code was giving correct output. Then he asked me to give some test cases on my own, it was working fine on all test cases. He appreciated me by saying, “Excellent !!”. Atlast, I asked him the same question as that of the previous interviewer as I wanted to know more about the company.
Tips -
- Try to clear all your doubts initially.
- Give some cases to the interviewer and confirm your understanding as it better to have precaution because if you solve the solution with wrong understanding then you might ended up with very less time at the end.
- Don't make your question more complicated by asking some questions like whether this is restricted or that is allowed because mostly interviewer replies yes and if your question is making your problem tedious then it's your loss only.
This was my experience of a Microsoft On-Campus interview. Though I was not selected as it was recession time and they have hired only 1 candidate from the campus, It was a great journey. All the best for your interview !!!
If you have any insights, advice, or would like to connect, reach out to me on linkedin - https://www.linkedin.com/in/yashasvi-mahajan-065886257/