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

Software Engineer

Microsoft
upvote
share-icon
5 rounds | 5 Coding problems

Interview preparation journey

expand-icon
Journey
I started my preparation journey with the interview preparation course from Coding Ninjas, which provided a step-by-step guide. I believe that when we have clarity on how to start, it becomes much easier to achieve our goal — and this is exactly what helped me.
Application story
My journey started when I took a referral from a random person who had posted on LinkedIn. After that, I asked them the right questions about what I should focus on for my upcoming interview once I received the call and cleared the Codility test. This was followed by three technical rounds and then a final round with the Hiring Manager.
Why selected/rejected for the role?
Three out of my four rounds went really well, as confirmed by the recruiter, and I was selected for the role. I believe that thinking out loud really helped me throughout the process.
Preparation
Duration: 2 months
Topics: Graphs, Trees, OOPS, System Design, DBMS
Tip
Tip

Tip 1: Always spend enough time understanding the question before looking at the solution.
Tip 2: Ask for help from mentors or teaching assistants (TAs) when needed.
Tip 3: Make a note of any approaches where you initially struggled.

Application process
Where: Company Website
Eligibility: Nothing
Resume Tip
Resume tip

Tip 1: Clearly mention the projects you have worked on in your previous organization, along with the impact they had.
Tip 2: Emphasize the skills you bring to the company and how they align with the role.

Interview rounds

01
Round
Easy
Online Coding Test
Duration60 mins
Interview date4 Feb 2023
Coding problem1

1. Postorder traversal

Easy
15m average time
85% success
0/40
Asked in companies
AmazonMicrosoftPayPal

You have been given a Binary Tree of 'n' nodes, where the nodes have integer values. Your task is to return its postorder traversal.


For Example:
For the given tree below,
Postorder traversal for the given tree will be [4, 5, 2, 3, 1]. Hence, the answer is [4, 5, 2, 3, 1].

Example

Problem approach

I first solved it using recursion, then optimized it by using two stacks, and finally improved it further using just one stack.

Try solving now
02
Round
Medium
Video Call
Duration45 mins
Interview date13 May 2023
Coding problem1

1. Spiral Matrix

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

You are given a 2-D array 'MATRIX' of dimensions N x M, of integers. You need to return the spiral path of the matrix.

Example Of Spiral Path:

Spiral path of a matrix

Problem approach

I solved this problem using for loops and multiple if statements.

Try solving now
03
Round
Medium
Video Call
Duration45 mins
Interview date13 May 2023
Coding problem1

1. Design Question

Low-level design for a library system in a city.

Problem approach

Tip 1: Write clean code. Use meaningful variable names and add parentheses wherever necessary.
Tip 2: Think out loud while solving the problem to explain your approach clearly.
Tip 3: Apply object-oriented programming concepts wherever possible to improve code structure.

04
Round
Medium
Video Call
Duration45 mins
Interview date13 May 2023
Coding problem1

1. Design Question

High-level design related to a project I worked on at my previous organization.

Problem approach

Tip 1: Concepts related to Spring Boot were tested, so make sure you are well-prepared to explain and demonstrate anything you mention in your resume during the interview.

Tip 2: Practice writing code for building and consuming APIs.

05
Round
Medium
Video Call
Duration45 mins
Interview date13 May 2023
Coding problem1

1. Preorder Traversal

Easy
15m average time
85% success
0/40
Asked in companies
WalmartMorgan StanleyMicrosoft

You are given the root node of a binary tree consisting of ‘N’ nodes. Your task is to return its preorder traversal. The preorder traversal of a binary tree is defined as a process of traversing each node in the following manner-:

1- Visit the root node.
2- Traverse all nodes in the left subtree of the root node.
3- Traverse all the nodes in the right subtree of the root node.
For Example:
For the given tree below,
Preorder traversal for the given tree will be [1, 2, 4, 5, 3]. Hence, the answer is [1, 2, 4, 5, 3].

Example

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

I started by explaining how these three traversals differ. I used a stack and a pair class to solve this problem, resulting in a time and space complexity of O(N).

Try solving now

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
Software Engineer
5 rounds | 5 problems
Interviewed by Microsoft
10148 views
1 comments
0 upvotes
company logo
Software Engineer
3 rounds | 2 problems
Interviewed by Microsoft
2135 views
0 comments
0 upvotes
company logo
Software Engineer
4 rounds | 6 problems
Interviewed by Microsoft
1693 views
0 comments
0 upvotes
company logo
Software Engineer
3 rounds | 5 problems
Interviewed by Microsoft
1117 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
Software Engineer
3 rounds | 7 problems
Interviewed by Optum
7977 views
1 comments
0 upvotes
company logo
Software Engineer
2 rounds | 4 problems
Interviewed by Amazon
4448 views
1 comments
0 upvotes
company logo
Software Engineer
3 rounds | 5 problems
Interviewed by Amazon
3674 views
0 comments
0 upvotes