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

SDE - 1

Microsoft
upvote
share-icon
4 rounds | 5 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 1 month
Topics: Data Structures, OOPS, System Design, Algorithms, Graph, Trees
Tip
Tip

Tip 1 : Practice is the key to crack any interview. Solve as many questions as you can.
Tip 2 : Learn about the company values.

Application process
Where: Referral
Eligibility: 2 years prior experience
Resume Tip
Resume tip

Tip 1 : Keep it short and concise
Tip 2 : Try to highlight some work or projects that you did outside your work

Interview rounds

01
Round
Easy
Online Coding Interview
Duration90 minutes
Interview date4 Mar 2022
Coding problem1

Timing - Flexible, can take any time as per convenience.
Environment was great.

1. Good Nodes

Easy
15m average time
80% success
0/40
Asked in companies
MicrosoftOracleMorgan Stanley

You are given the root node of a binary tree consisting of ‘N’ nodes. Your task is to find the number of good nodes in the given binary tree.

A good node is defined as good if there are no nodes with a value greater than X’s value in the path from the root to X.

You are given a root node ‘ROOT’.Your task is to return the number of good nodes.

Example:
Elements are in the level order form. The input consists of values of nodes separated by a single space in a single line. In case a node is null, we take -1 in its place.

For example, the input for the tree depicted in the below image would be :

Example

1
2 3
4 -1 5 6
-1 7 -1 -1 -1 -1
-1 -1

Explanation :
Level 1 :
The root node of the tree is 1

Level 2 :
Left child of 1 = 2
Right child of 1 = 3

Level 3 :
Left child of 2 = 4
Right child of 2 = null (-1)
Left child of 3 = 5
Right child of 3 = 6

Level 4 :
Left child of 4 = null (-1)
Right child of 4 = 7
Left child of 5 = null (-1)
Right child of 5 = null (-1)
Left child of 6 = null (-1)
Right child of 6 = null (-1)

Level 5 :
Left child of 7 = null (-1)
Right child of 7 = null (-1)

The first not-null node (of the previous level) is treated as the parent of the first two nodes of the current level. 

The second not-null node (of the previous level) is treated as the parent node for the next two nodes of the current level and so on.

The input ends when all nodes at the last level are null (-1).
Note :
The above format was just to provide clarity on how the input is formed for a given tree. 

The sequence will be put together in a single line separated by a single space. Hence, for the above-depicted tree, the input will be given as:

1 2 3 4 -1 5 6 -1 7 -1 -1 -1 -1 -1 -1
Problem approach

Recorded the maximum value along the path from the root to the node. Used recursion to solve the problem

Try solving now
02
Round
Easy
Video Call
Duration60 minutes
Interview date18 Mar 2022
Coding problem1

Taken by SSE where he shared codility link to write code

1. Arithmetic Expression Evaluation

Moderate
30m average time
70% success
0/80
Asked in companies
AdobeFacebookMicrosoft

You are given a string ‘expression’ consists of characters ‘+’, ‘-’, ‘*’, ‘/’, ‘(‘, ‘)’ and ‘0’ to ‘9’, that represents an Arithmetic Expression in Infix Notation. Your task is to evaluate this Arithmetic Expression.

In Infix Notation, operators are written in-between their operands.

Note :
1. We consider the ‘/’ operator as the floor division.

2. Operators ‘*’ and ‘/’ expression has higher precedence over operators‘+’ and ‘-’ 

3. String expression always starts with ‘(‘ and ends with ‘)’.

4. It is guaranteed that ‘expression’ represents’ a valid expression in Infix notation.

5. It is guaranteed that there will be no case that requires division by 0.

6. No characters other than those mentioned above are present in the string. 

7. It is guaranteed that the operands and final result will fit in a 32-bit integer.
For example :
Consider string ‘expression’ = ‘((2+3)*(5/2))’. 
Then it’s value after evaluation will be ((5)*(2)) = 10. 
Problem approach

Used bitwise operation to solve the problem

Try solving now
03
Round
Easy
Video Call
Duration60 minutes
Interview date20 Apr 2022
Coding problem1

Taken by Engineering Manager

1. Add Two Numbers As Linked Lists

Moderate
20m average time
80% success
0/80
Asked in companies
SprinklrIBMDeutsche Bank

You are given two non-negative numbers 'num1' and 'num2' represented in the form of linked lists.


The digits in the linked lists are stored in reverse order, i.e. starting from least significant digit (LSD) to the most significant digit (MSD), and each of their nodes contains a single digit.


Calculate the sum of the two numbers and return the head of the sum list.


Example :
Input:
'num1' : 1 -> 2 -> 3 -> NULL
'num2' : 4 -> 5 -> 6 -> NULL

Output: 5 -> 7 -> 9 -> NULL

Explanation: 'num1' represents the number 321 and 'num2' represents 654. Their sum is 975.


Problem approach

1. Calculate sizes of given two linked lists.
2. If sizes are not the same, then append zeros in the smaller linked list.
3. If the size is the same, then follow the below steps:
a. Find the smaller valued linked list.
b. One by one subtract nodes of the smaller-sized linked list from the larger size. Keep track of borrow while subtracting.

Try solving now
04
Round
Easy
Video Call
Duration60 minutes
Interview date23 Mar 2022
Coding problem2

Taken by Principal Engineering Manager

1. System Design Question

Given an infinite grid, implement Tic tac toe with following functionalities -
1. Save progress.
2. Finish the game as soon as any player wins.
3. N will be provided where N refers to number of items required to win the game (generally this is 3 when we play this game but in problem it could be any number >= 3)

Problem approach

Tip 1 : Practise system design thoroughly 
Tip 2 : Watch videos on YouTube to gain experience on how to approach the problem

2. Operating System

Walk through a program which is designed to make a system super slow.

Problem approach

Tip 1 : Brush up your OS skills
Tip 2 : Must read about threads, deadlock, semaphores

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