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

SDE - 1

Microsoft
upvote
share-icon
4 rounds | 9 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 4.5 months
Topics: Data Structures, Algorithms, OOPS, Low Level Design, OS, DBMS, Dynamic Programming, Graphs
Tip
Tip

Tip 1 : Participating in online contests helped me a lot with gaining speed to clear the OA. People who solved both OA questions but took a longer time were not selected.
Tip 2 : DSA topics such as Trees, BSTs, Graphs, DP are almost certainly asked in 1st interview round, so I paid more attention to these.
Tip 3 : Application of OOPS in the form of Low Level design and basics of system design are almost always asked.
Tip 4 : Having prior internship experience helped me alot in the final round (software practices), also the projects that I did were on technologies I was passionate about and not on new buzzing technologies, this seemed to interest the interviewer as we could have a discussion about the technologies aspect in depth.

Application process
Where: Campus
Eligibility: % in X and XII – 60% or 6.0 CGPA, in Pursuing Degree – 70% or 7.0 CGPA in UG (for PGs) – 70% or 7.0 CGPA, No Standing Arrears
Resume Tip
Resume tip

Tip 1 : Having projects is very helpful during shortlisting. Also knowing the technologies used in depth will help in the interview rounds.
Tip 2 : Prior experience helps a lot during shortlisting.
Tip 3 : In the interview if we don't know the answer to a theoretical question we should tell the interviewer, and try to attempt the question by deducing the answer, instead of giving the wrong answer.

Interview rounds

01
Round
Medium
Online Coding Interview
Duration60 minutes
Interview date12 Jul 2022
Coding problem2

Timing: Afternoon 2:00 pm

1. Ayush and Expression

Moderate
25m average time
75% success
0/80
Asked in companies
GrofersMicrosoftCityMall

Ayush read about irreducible fractions in the school and made an expression ‘EXPRESSION’ of fraction addition and subtraction.

Note:
An irreducible fraction is a fraction in which the numerator and denominator are integers that have no other common divisors than 1.

Example: 2/3, 8/9, 0/1 are irreducible fractions, where 8/12, 9/12 are not irreducible fractions. 

Expression ‘EXPRESSION’ contains integers from '0' to '9', and characters '/', '+' and '-'.

Each fraction will be an irreducible fraction and will be in the format of ±(numerator/denominator).

Ayush does not know how to solve the expression he made, so he gave you the expression to solve. Your task is to solve the expression.

Note:
Ayush expects your answer to be an irreducible fraction, so if your answer is an integer, convert it into an irreducible fraction by putting 1 in the denominator.

For example, if your answer is "9", then print "9/1" (without quotes). 
Try solving now

2. Maximum sum of non-adjacent elements

Moderate
15m average time
85% success
0/80
Asked in companies
MakeMyTripSalesforceExpedia Group

You are given an array/list of ‘N’ integers. You are supposed to return the maximum sum of the subsequence with the constraint that no two elements are adjacent in the given array/list.

Note:
A subsequence of an array/list is obtained by deleting some number of elements (can be zero) from the array/list, leaving the remaining elements in their original order.
Try solving now
02
Round
Easy
Face to Face
Duration75 minutes
Interview date18 Jul 2022
Coding problem2

This round required me to solve 2 DSA questions, they were of medium hard difficulty. The topics involved Binary Search Tree (LCA of a node in a BST) and BFS on Graph + String manipulation (Word Ladder Problem). In the second question I gave the interviewer a different approach than the one he had in mind but through clear communication I was able to explain my approach.

1. LCA Of Binary Tree

Moderate
10m average time
90% success
0/80
Asked in companies
GrabDisney + HotstarShareChat

You have been given a Binary Tree of distinct integers and two nodes ‘X’ and ‘Y’. You are supposed to return the LCA (Lowest Common Ancestor) of ‘X’ and ‘Y’.


The LCA of ‘X’ and ‘Y’ in the binary tree is the shared ancestor of ‘X’ and ‘Y’ that is located farthest from the root.


Note :
You may assume that given ‘X’ and ‘Y’ definitely exist in the given binary tree.
For example :
For the given binary tree

Example

LCA of ‘X’ and ‘Y’ is highlighted in yellow colour.
Problem approach

Step 1 : Create a recursive function that takes a node and the two values n1 and n2.
Step 2 : If the value of the current node is less than both n1 and n2, then LCA lies in the right subtree. Call the recursive function for the right subtree.
Step 3 : If the value of the current node is greater than both n1 and n2, then LCA lies in the left subtree. Call the recursive function for the left subtree.
Step 4 : If both the above cases are false then return the current node as LCA.

Time Complexity: O(h). 
The Time Complexity of the above solution is O(h), where h is the height of the tree.
Space Complexity: O(1) when implemented iteratively.

Try solving now

2. Word Ladder

Hard
10m average time
90% success
0/120
Asked in companies
OlaSalesforceDisney + Hotstar

You are given two strings BEGIN and END and an array of strings DICT. Your task is to find the length of the shortest transformation sequence from BEGIN to END such that in every transformation you can change exactly one alphabet and the word formed after each transformation must exist in DICT.

Note:

1. If there is no possible path to change BEGIN to END then just return -1.
2. All the words have the same length and contain only lowercase english alphabets.
3. The beginning word i.e. BEGIN will always be different from the end word i.e. END (BEGIN != END).
Problem approach

1. Do the pre-processing on the given wordList and find all the possible generic/intermediate states. Save these intermediate states in a dictionary with key as the intermediate word and value as the list of words which have the same intermediate word.

2. Push a tuple containing the beginWord and 1 in a queue. The 1 represents the level number of a node. We have to return the level of the endNode as that would represent the shortest sequence/distance from the beginWord.

3. To prevent cycles, use a visited dictionary.

4. While the queue has elements, get the front element of the queue. Let's call this word as current_word.

5. Find all the generic transformations of the current_word and find out if any of these transformations is also a transformation of other words in the word list. This is achieved by checking the all_combo_dict.

6. The list of words we get from all_combo_dict are all the words which have a common intermediate state with the current_word. These new set of words will be the adjacent nodes/words to current_word and hence added to the queue.

7. Hence, for each word in this list of intermediate words, append (word, level + 1) into the queue where level is the level for the current_word.

8. Eventually if you reach the desired word, its level would represent the shortest transformation sequence length. Termination condition for standard BFS is finding the end word.

Time Complexity: O(M^2 * N) where M is the length of each word and N is the total number of words in the input word list.
Space Complexity: O(M^2 * N)

Try solving now
03
Round
Hard
Face to Face
Duration60 Minutes
Interview date18 Jul 2022
Coding problem2

This round was highly focused on Low Level Design and Core subjects, the interviewer asked me about various database technologies (and indexing in RDBMS) in depth and their use cases. I had to design a Commodity Exchange (Stocks, Futures, etc.) using the pillars of OOPS: inheritance, abstraction, polymorphism and encapsulation. We also had a discussion about the language of my choice (C++). This discussion included topics such as shared pointers, virtual pointers and runtime/ compile time polymorphism.

1. DBMS Questions

Explain about the different Databases you have worked with. Differentiate between SQL and NoSQL databases. Discussion in detail about ACID compliance in SQL vs CAP Theorem in NoSQL. Discussion on indexing in RDBMS and the internal data structure used (B-Tree). Had a discussion about scalability in DBMS and topics such as sharding etc. Discussion on Joins in SQL and a few SQL queries.

Problem approach

Tip 1 : Try to convey your level of surety along with the answer and if you have deduced an answer then the process behind the discussion.
Tip 2 : I feel that being opinionated helps in discussion-based rounds, as this gives the interviewer opportunity to ask questions from the for/against side.
Tip 3 : Practicing nested SQL queries helps in DBMS based rounds.

2. System Design Question

Design a Commodity Exchange using OOPs. Also discuss in detail about the Networking Protocols that can be used in such a system (MQTT, CQRS etc.).

Problem approach

Tip 1 : Practicing a few Low-Level Design questions is very helpful as we can then mold our question to have some overlap with the practiced questions, e.g., OOPs for Notification Delivery. 
Tip 2 : In core subject-based rounds networking questions can be asked so, knowing about the different protocols and their use cases helps.
Tip 3 : Resume projects related core subject questions must not be neglected.

04
Round
Medium
HR Round
Duration45 minutes
Interview date19 Jul 2022
Coding problem3

This round was kind of a mix between technical and HR, but it leaned more towards the technical side. The interviewer checked me on software practices such as error handling, directory structure, we also had a lengthy discussion on my projects (the technologies I used and why) and college work (clubs and activities I was a part of). I was asked to implement a stack using 2 queues and encapsulate it in a class. In the end I was asked about my aspirations 5 years down the line and why I'd like to join Microsoft.

1. Technical Questions

Error Handling Practices.
How to structure directories in React / Node (Related to my internship experience)
The interviewer made me write code to print the Nth Fibonacci numbers with error handling and input sanitization. (I was able to write a logarithmic time complexity solution using Matrix multiplication which impressed the interviewer.)

Problem approach

Tip 1 : Prepare resume-based questions well.
Tip 2 : Try to follow best software engineering practices while writing code in interviews. 
Tip 3 : We should also look at the standard interview questions about the technologies we have written in our resume (E.g., Virtual DOM in ReactJS, etc.).

2. Stack using queue

Moderate
25m average time
65% success
0/80
Asked in companies
AmazonQualcommPhilips

Implement a Stack Data Structure specifically to store integer data using two Queues.


There should be two data members, both being Queues to store the data internally. You may use the inbuilt Queue.


Implement the following public functions :

1. Constructor:
It initializes the data members(queues) as required.

2. push(data) :
This function should take one argument of type integer. It pushes the element into the stack and returns nothing.

3. pop() :
It pops the element from the top of the stack and, in turn, returns the element being popped or deleted. In case the stack is empty, it returns -1.

4. top :
It returns the element being kept at the top of the stack. In case the stack is empty, it returns -1.

5. size() :
It returns the size of the stack at any given instance of time.

6. isEmpty() :
It returns a boolean value indicating whether the stack is empty or not.
Operations Performed on the Stack:
Query-1(Denoted by an integer 1): Pushes an integer data to the stack. (push function)

Query-2(Denoted by an integer 2): Pops the data kept at the top of the stack and returns it to the caller. (pop function)

Query-3(Denoted by an integer 3): Fetches and returns the data being kept at the top of the stack but doesn't remove it, unlike the pop function. (top function)

Query-4(Denoted by an integer 4): Returns the current size of the stack. (size function)

Query-5(Denoted by an integer 5): Returns a boolean value denoting whether the stack is empty or not. (isEmpty function)
Example
Operations: 
1 5
1 10
2
3
4

Enqueue operation 1 5: We insert 5 at the back of the queue.
  Queue: [5]

Enqueue operation 1 10: We insert 10 at the back of the queue.
  Queue: [5, 10]

Dequeue operation 2: We remove the element from the front of the queue, which is 5, and print it.
  Output: 5
  Queue: [10]

Peek operation 3: We return the element present at the front of the queue, which is 10, without removing it.
  Output: 10
  Queue: [10]

IsEmpty operation 4: We check if the queue is empty.
  Output: False
  Queue: [10]
Try solving now

3. Basic HR Questions

Why would you like to join Microsoft? Where do you see yourself in 5 years?

Problem approach

Tip 1 : I tried to personalize the questions by talking about my experiences and the impact Microsoft products have had on me. I also talked about the technologies at Microsoft I am most excited about and would love to contribute to. (WSL and Xbox Gaming)
Tip 2 : I tried to answer the future aspiration question in the manner that I want to evolve with and explore new technologies. 
Tip 3 : In the end the interviewer asked me if I had any questions for them, I asked about their favorite technology at Microsoft and that evolved into a good discussion. So, I tried to converse with the interviewer to maximal extent.

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