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
Journey
During my B.tech, our seniors informed us how important DSA is to crack placements. Therefore, I started practising DSA from GeeksFromGeeks, Leetcode and codestudio right from my second year. I practise a lot of questions. Also, I focused on core subjects as well properly.
Application story
The HR contacted me through email. I was asked to appear for the coding test. I applied through the link provided and then the further rounds were carried out.
Why selected/rejected for the role?
I was selected because I was able to answer all coding questions properly. I started with a naive approach and went ahead to explain the optimised approach for almost all the questions. Moreover, I had a deep understanding of OS concepts as well.
Preparation
Duration: 9 Months
Topics: DBMS, Data Structures and Algorithms , OOP, Maths puzzles, Aptitude , CN, OS
Tip
Tip

Tip 1 : Never leave any topic from any chapter / Subject
Tip 2 : Learn to explain your thoughts well
Tip 3 : Learn from previous experiences / interviews / problems asked.
Tip 4 : Atleast 4 projects in Resume

Application process
Where: Other
Eligibility: No criteria
Resume Tip
Resume tip

Tip 1 : Atleast 4 projects on Resume
Tip 2 : Do not write false things. You always get caught. Be genuine.

Interview rounds

01
Round
Hard
Online Coding Interview
Duration90 minutes
Interview date28 Feb 2021
Coding problem1

1. Buying And Selling Stock

Moderate
0/80
Asked in companies
AmazonMicrosoft

You have been given the prices of 'N' stocks in an array where each array element represents the stock price for that day. You need to find the maximum profit which you can make by buying and selling the stocks. You may make as many transactions as you want but can not have more than one transaction at a time i.e, if you have the stock, you need to sell it first, and then only you can buy it again.

Try solving now
02
Round
Medium
Video Call
Duration40 Minutes
Interview date5 Mar 2021
Coding problem1

1. Time to Burn Tree

Hard
50m average time
50% success
0/120
Asked in companies
SprinklrShareChatZomato

You have a binary tree of 'N' unique nodes and a Start node from where the tree will start to burn. Given that the Start node will always exist in the tree, your task is to print the time (in minutes) that it will take to burn the whole tree.


It is given that it takes 1 minute for the fire to travel from the burning node to its adjacent node and burn down the adjacent node.


For Example :
For the given binary tree: [1, 2, 3, -1, -1, 4, 5, -1, -1, -1, -1]
Start Node: 3

    1
   / \
  2   3
     / \
    4   5

Output: 2

Explanation :
In the zeroth minute, Node 3 will start to burn.

After one minute, Nodes (1, 4, 5) that are adjacent to 3 will burn completely.

After two minutes, the only remaining Node 2 will be burnt and there will be no nodes remaining in the binary tree. 

So, the whole tree will burn in 2 minutes.
Try solving now
03
Round
Easy
Face to Face
Duration40 minutes
Interview date24 Mar 2021
Coding problem1

1. Flatten Binary Tree

Moderate
25m average time
70% success
0/80
Asked in companies
AppleMicrosoftSalesforce

You are given a binary tree consisting of 'n' nodes.


Convert the given binary tree into a linked list where the linked list nodes follow the same order as the pre-order traversal of the given binary tree.


Use the right pointer of the binary tree as the “next” pointer for the linked list and set the left pointer to NULL.


Use these nodes only. Do not create extra nodes.


Example :
Input: Let the binary be as shown in the figure:

Example Tree

Output: Linked List: 15 -> 40 -> 62 -> 10 -> 20 -> NULL

Explanation: As shown in the figure, the right child of every node points to the next node, while the left node points to null.

Also, the nodes are in the same order as the pre-order traversal of the binary tree.
Try solving now
04
Round
Hard
Video Call
Duration25 Minutes
Interview date23 Apr 2021
Coding problem2

1. Technical Question

Communication between two processes. (Learn)

2. Gray Code

Moderate
25m average time
70% success
0/80
Asked in companies
AdobeMicrosoftIBM

Given a number ‘grayNumber’. Find the gray code sequence.

Conditions for a gray code sequence :

1. Gray code sequence contains numbers from 0 to 2^'grayNumber'-1 in bit/binary form.
2. Two consecutive gray code sequence numbers only differ by 1 bit.
3. Gray code sequence must start with 0.

Example :

Given 'grayNumber' : 2.

alt text

As depicted from above image, the gray code sequence is 0,1,3,2.

Note :

1. The output sequence must contain the decimal representation of numbers instead of the binary form.
2. There can be multiple answers print anyone.
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

Which array operation has O(n) worst-case time complexity?

Choose another skill to practice
Similar interview experiences
company logo
SDE - 1
5 rounds | 15 problems
Interviewed by Microsoft
2488 views
0 comments
0 upvotes
company logo
SDE - 1
5 rounds | 7 problems
Interviewed by Microsoft
1685 views
0 comments
0 upvotes
company logo
SDE - 1
1 rounds | 2 problems
Interviewed by Microsoft
6576 views
0 comments
0 upvotes
company logo
SDE - 1
4 rounds | 7 problems
Interviewed by Microsoft
691 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - 1
5 rounds | 12 problems
Interviewed by Amazon
108663 views
24 comments
0 upvotes
company logo
SDE - 1
3 rounds | 7 problems
Interviewed by Amazon
32563 views
6 comments
0 upvotes
company logo
SDE - 1
3 rounds | 11 problems
Interviewed by Amazon
20945 views
3 comments
0 upvotes