Microsoft interview experience Real time questions & tips from candidates to crack your interview

SDE - 1

Microsoft
upvote
share-icon
3 rounds | 5 Coding problems

Interview preparation journey

expand-icon
Journey
My journey began in 12th grade when my teacher encouraged me to participate in coding competitions. Since then, I've consistently participated in these competitions, developing a strong habit of solving coding problems.
Application story
I was very excited to hear that Microsoft is coming to our campus for hiring. I have always wanted to join Microsoft, so I started preparing for the interview. The process began with two rounds: one technical and one HR round.
Why selected/rejected for the role?
I was selected because I was well-prepared for the interviews and ready for all sorts of questions.
Preparation
Duration: 2 months
Topics: Data Structures, Algorithms, OOPS, Operating System, Database Management, C++, or Java (proficient in anyone), Computer Networks
Tip
Tip

Tip 1: I suggest practicing as many questions on data structures and algorithms as you can because practicing questions helps strengthen your concepts. I completed all modules of data structures and algorithms and practiced extensively, as you can find recent interview questions there.

Tip 2: If you have time before your interviews, I recommend using CodeStudio. It offers a good variety of questions sorted by topic and difficulty level, where you can aim to solve at least 20 to 30 questions for each data structure and algorithm. Additionally, participating regularly in weekly contests can help you identify and improve your weak areas.

Application process
Where: Campus
Eligibility: 6.5 CGPA
Resume Tip
Resume tip

Tip 1: Your resume should primarily highlight your skills, projects, and achievements. Projects play a crucial role in your interview, so you should include at least one highly relevant and well-executed project that demonstrates your strong development concepts.

Tip 2: The most important advice is never to lie on your resume. If you've only worked with a technology for a project and don't have in-depth knowledge, it's better to indicate "basic proficiency" on your resume.

Interview rounds

01
Round
Easy
Online Coding Test
Duration90 minutes
Interview date4 Sep 2020
Coding problem2

The round consisted of two coding questions, and the test was conducted on the Mettl platform. There was no sectional time limit for the coding questions. Each student received two randomly selected coding questions, with no two students getting the same set of questions. The test was online, with both audio and video enabled for continuous monitoring.

1. Median of two sorted arrays

Hard
25m average time
65% success
0/120
Asked in companies
GrabMicrosoftWells Fargo

Given two sorted arrays 'a' and 'b' of size 'n' and 'm' respectively.


Find the median of the two sorted arrays.


Median is defined as the middle value of a sorted list of numbers. In case the length of list is even, median is the average of the two middle elements.


The expected time complexity is O(min(logn, logm)), where 'n' and 'm' are the sizes of arrays 'a' and 'b', respectively, and the expected space complexity is O(1).


Example:
Input: 'a' = [2, 4, 6] and 'b' = [1, 3, 5]

Output: 3.5

Explanation: The array after merging 'a' and 'b' will be { 1, 2, 3, 4, 5, 6 }. Here two medians are 3 and 4. So the median will be the average of 3 and 4, which is 3.5.
Try solving now

2. N-th Term Of GP

Easy
15m average time
90% success
0/40
Asked in companies
MicrosoftDisney + HotstarCuemath

You are given the first term (A), the common ratio (R) and an integer N. Your task is to find the Nth term of the GP series.

The general form of a GP(Geometric Progression) series is A, A(R), A(R^2), A*(R^3) and so on where A is the first term of GP series

Note :

As the answer can be large enough, return the answer modulo 10^9 + 7.

Problem approach

I used the setprecision() method to round off the nth gp number.

Try solving now
02
Round
Medium
Video Call
Duration60 minutes
Interview date4 Sep 2020
Coding problem2

This round focused on data structures and included discussions about my projects. The interviewer was very calm and listened carefully to my solutions. There was a lot of discussion about my projects, and the interviewer seemed genuinely interested in understanding the workflows involved.

1. Check Identical Trees

Moderate
20m average time
85% success
0/80
Asked in companies
DunzoMicrosoftDisney + Hotstar

You are given two binary trees with 'n' and 'm' nodes respectively.


You need to return true if the two trees are identical. Otherwise, return false.


Example:
For the trees given below:- 

example

The given trees are identical as:-
1. The number of nodes in both trees is the same. 
2. The number of edges in both trees is the same. 
3. The data for root for both the trees is the same i.e 5. 
4. The data of root -> left (root’s left child) for both the trees is the same i.e 2.
5. The data of root -> right (root’s right child) for both the trees is the same i.e 3.
6. The data of root -> right -> left ( left child of root’s right child) for both the trees is the same i.e 6.
7. Nodes with data 2 and 6 are the leaf nodes for both the binary trees. 
Problem approach

I first solved the question using simple recursion by checking every node and then calling the left and right subtrees. The interviewer then asked me to optimize it. I explained that to check the identity of the trees, we must fully traverse both. He was satisfied with the explanation.

Try solving now

2. Distinct subsequences

Moderate
10m average time
80% success
0/80
Asked in companies
MicrosoftUberMeesho

You have been given string 'S' of length 'N' that may contain duplicate alphabets. Your task is to return the count of distinct subsequences of it.

For example:

For the given string “deed” :
The possible subsequences are {“”}, {“d”}, {“e”}, {“de”}, {“e”}, {“de”}, {“ee”}, {“dee”}, {“d”}, {“dd”}, {“ed”}, {“ded”}, {“ed”}, {“ded”}, {“eed”} and {“deed”}.

As, {“d”}, {“e”}, {“de”}, {“ed”} and {“ded”} are repeated. 

The distinct subsequences are {“”}, {“d”}, {“e”}, {“de”}, {“ee”}, {“dee”}, {“dd”}, {“ed”}, {“ded”}, {“eed”} and {“deed”}

Thus, the output will be 11. 

Note:

As the answer can be large, return your answer modulo 10^9  + 7.  
Problem approach

I solved this problem using recursion and a map. I made two recursive calls: one to include the element and one to exclude it. After reaching the end of the array, I pushed the subsequence to the resultant vector. I also checked for duplicates using the map. The interviewer was satisfied with this approach after I explained the workflow to him, emphasizing that since we want all the subsequences, recursion is necessary.

Try solving now
03
Round
Medium
HR Round
Duration30 minutes
Interview date5 Sep 2020
Coding problem1

This was the final HR/Coding round. The coding question was to find the nth node from the end of a linked list, which was similar to one asked in the previous round. The interview began with 2-3 HR questions. After answering them, there was an in-depth discussion about my projects, including why I chose them, their advantages, and whether they solved the existing problem. I addressed all the project-related queries calmly, and the interviewer seemed satisfied with my responses.

1. Basic HR Questions

What do you expect from this opportunity?

What are your future plans?

What are your weaknesses?

What do you know about the work culture here?

Problem approach

Tip 1: For the first question, I answered by stating that I expect constant learning and growth from this internship and aim to contribute to improving the standards of people in the technical world. It's important to be clear about your goals and how they will benefit both the company and your growth as an engineer.

Tip 2: For the second question, I broke down my response into intervals, explaining that in the first 2-3 years, I want to become such an expert in my field that if any problem related to it arises in the company, I would be the first person to be approached. In the later years, I aspire to explore the role of a manager, offering advice on how to lead real-time projects.

Tip 3: When discussing weaknesses, it's important not to hesitate in sharing them, but you should limit yourself to 1-2 weaknesses that aren't highly relevant to the job description. This way, your weaknesses can appear as strengths to the interviewer.

Tip 4: Conduct thorough research on the company and, if given the chance, ask some relevant questions at the end, which can leave a good impression. Also, have in-depth knowledge of your project, as it is likely to be discussed in almost every round.

Here's your problem of the day

Solving this problem will increase your chance to get selected in this company

Skill covered: Programming

How do you remove whitespace from the start of a string?

Choose another skill to practice
Similar interview experiences
company logo
SDE - 1
5 rounds | 15 problems
Interviewed by Microsoft
4035 views
0 comments
0 upvotes
company logo
SDE - 1
5 rounds | 7 problems
Interviewed by Microsoft
2661 views
0 comments
0 upvotes
company logo
SDE - 1
1 rounds | 2 problems
Interviewed by Microsoft
7425 views
0 comments
0 upvotes
company logo
SDE - 1
4 rounds | 7 problems
Interviewed by Microsoft
1272 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - 1
5 rounds | 12 problems
Interviewed by Amazon
115097 views
24 comments
0 upvotes
company logo
SDE - 1
3 rounds | 7 problems
Interviewed by Amazon
35147 views
7 comments
0 upvotes
company logo
SDE - 1
3 rounds | 11 problems
Interviewed by Amazon
21829 views
4 comments
0 upvotes