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

SDE - 1

Microsoft
upvote
share-icon
4 rounds | 8 Coding problems

Interview preparation journey

expand-icon
Journey
I took admission in tier-2 college for B.tech in Computer Science. I started my coding journey from the second year of graduation. I asked and consulted seniors on how to start in my career. I started doing DSA.
Application story
I got a message from my college placement cell about the company visiting our campus for the hiring of SDE-1. I applied and participated in its selection process and luckily most of the questions were from the list of important questions shared by my friend.
Why selected/rejected for the role?
I think my skills and knowledge were up to the mark that they found me as a valuable candidate. Moreover, my communication skills added up to my numbers.
Preparation
Duration: 12 Months
Topics: Data Structures & Algorithms, DBMS, OS, Android Development, Web Development, C++, OOPS
Tip
Tip

Tip 1 : Become Pro in atleast one programming language (preferably Java/C++)
Tip 2 : Master DSA and solve a lot of problems on various platforms (leetcode,hackerrank,codechef,etc)
Tip 3 : Make some good projects related to your field of expertise, and do it on your own and deploy it.

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

Tip 1 : Use some good Templates (i used novoresume to build my resume) 
Tip 2 : Don't put irrelevant things
Tip 3 : Highlights the technologies used in your projects & internships

Interview rounds

01
Round
Medium
Online Coding Interview
Duration90 minutes
Interview date13 Jul 2021
Coding problem3

It happened at around 10 AM. There were 3 coding problems. And solving all the three with the corner cases was important.
Total time was 90 minutes. 
47 out of 880 students passed this round.

1. Min Efforts Required

Moderate
40m average time
60% success
0/80
Asked in companies
DunzoMicrosoftJUSPAY

The Ultimate Ninja Ankush, after training hard, goes for a good meal at the ninja cafe, for that he follows the path given on the map, which may or may not lead him to the ninja cafe. The map is a directed graph. Since he is also very lazy, he wants to minimize the effort to travel. The effort is defined as the product of all the distance it takes to reach from the dojo (source) to the ninja cafe (destination). Can you help him find the path with the minimum effort it would take The Ultimate Ninja Ankush to reach the destination?

More Formally, you are given a directed graph with ‘N’ nodes and ‘M’ edges where the distance of each edge is greater than 0, also given a source ‘src’ and a destination ‘dest’. The task is to find the minimum product of edges from src’ to ‘dest’. If there is no path from ‘src’ to ‘dest’, then return -1.

For example

Given:
‘N’ = 3, ‘M’ = 3. 
‘edges’ = 
    [[0 1 1],
     [1 2 1],
     [0 2 3]]
‘src’ = 0, ‘dest’ = 2.

There are two possible paths, that is to go from node-0 to node-2 directly, which will take 2 units of effort, or go from node-0 to node-1 and then node-1 to node-2, which will take 1 unit of effort.
Try solving now

2. Minimum Number of Platforms

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

You have been given two arrays, 'AT' and 'DT', representing the arrival and departure times of all trains that reach a railway station.

Your task is to find the minimum number of platforms required for the railway station so that no train needs to wait.

Note :
1. Every train will depart on the same day and the departure time will always be greater than the arrival time. For example, A train with arrival time 2240 and departure time 1930 is not possible.

2. Time will be given in 24H format and colons will be omitted for convenience. For example, 9:05AM will be given as "905", or 9:10PM will be given as "2110".

3. Also, there will be no leading zeroes in the given times. For example, 12:10AM will be given as “10” and not as “0010”.
Try solving now

3. Rat In A Maze

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

You are given a starting position for a rat which is stuck in a maze at an initial point (0, 0) (the maze can be thought of as a 2-dimensional plane). The maze would be given in the form of a square matrix of order 'N' * 'N' where the cells with value 0 represent the maze’s blocked locations while value 1 is the open/available path that the rat can take to reach its destination. The rat's destination is at ('N' - 1, 'N' - 1). Your task is to find all the possible paths that the rat can take to reach from source to destination in the maze. The possible directions that it can take to move in the maze are 'U'(up) i.e. (x, y - 1) , 'D'(down) i.e. (x, y + 1) , 'L' (left) i.e. (x - 1, y), 'R' (right) i.e. (x + 1, y).

Note:
Here, sorted paths mean that the expected output should be in alphabetical order.
For Example:
Given a square matrix of size 4*4 (i.e. here 'N' = 4):
1 0 0 0
1 1 0 0
1 1 0 0
0 1 1 1 
Expected Output:
DDRDRR DRDDRR 
i.e. Path-1: DDRDRR and Path-2: DRDDRR

The rat can reach the destination at (3, 3) from (0, 0) by two paths, i.e. DRDDRR and DDRDRR when printed in sorted order, we get DDRDRR DRDDRR.
Try solving now
02
Round
Medium
Video Call
Duration60 Minutes
Interview date15 Jul 2021
Coding problem2

1. Next Greater Element

Easy
10m average time
90% success
0/40
Asked in companies
AdobeGoldman SachsMakeMyTrip

You have been given an array/list ‘ARR’ consisting of ‘N’ positive integers. Your task is to return the Next Greater Element(NGE) for every element.

The Next Greater Element for an element ‘X’ is the first element on the right side of ‘X’ in the array 'ARR', which is greater than ‘X’. If no such element exists to the right of ‘X’, then return -1.

For example:
For the given array 'ARR' = [7, 12, 1, 20]

The next greater element for 7 is 12.
The next greater element for 12 is 20. 
The next greater element for 1 is 20. 
There is no greater element for 20 on the right side.

So, the output is [12, 20, 20, -1].
Try solving now

2. OS Questions

What are semaphores? (Learn)
Follow-up questions - 
What is the critical section problem? (Learn)
Code it with a multithreading program. (Learn)
What is thread? What is process? Differences between them. (Learn)
Execution flow in a multithreaded program, with preemption and critical section problems happening. And how semaphores are helping to overcome this problem.

Other methods to solve critical section problems -  
Locking Mechanism (With pseudo code) (Learn)
Mutex. What is it? Semaphore vs mutex (Learn)

03
Round
Medium
Video Call
Duration60 Minutes
Interview date15 Jul 2021
Coding problem2

It was based on my DSA skills and cs fundamentals.

1. Technical Questions

He asked me for some system calls like a fork.  (Learn)
And some basic Linux commands.

What is Dynamic Programming? Explain with an example. (Learn)

2. Flip Bit to Win

Easy
20m average time
80% success
0/40
Asked in companies
HSBCAmazonMicrosoft

Ninjas are often known for their stealth execution and accuracy to get the job done right. While honing their art of moving through dense forests stealthily, they need the maximum number of continuous trees one after the other for practicing.

Trees are represented by 1s and empty places by 0s (basically a binary representation of a given integer). You are also given an extra tree which you can plant at any empty place (i.e. you can flip one of the zeroes in the binary representation to 1). The tree should be planted such that the maximum number of consecutive trees is maximized.

Your task is to report the maximum number of consecutive trees after plantation.

Note:

You may also choose not to plant that extra tree at all.
For Example:
Input: 54
Output: 5

The binary representation of 54 is 110110.
After flipping the third bit from the left, we get consecutive 5 bits. i.e. 111110.
Try solving now
04
Round
Medium
Video Call
Duration80 Minutes
Interview date15 Jul 2021
Coding problem1

It was a Manegerial Round. It was a discussion on my projects.

He asked to introduce myself, and asked about my interview experience so far.
He then inspected my resume, and asked about my internship experience (Android Developer intern at a medium size company).
He then asked brief about my projects mentioned on my resume.

1. Technical Questions

He choose my Android Project to have a indepth discussion (Android chat application using end-to-end encryption using AES).
He asked me to present the code, i opened android studio, with my screen being presented.
I explained the folder structure, and how everything is working, and how we are interacting with the database (Firebase).
Then he asked on what basis we are fetching the user list, and i also showed the data stored (in Firebase console).
Then he asked about the encryption part, why we are doing it.

Then he saw that, i was storing the chat data, twice in the database, on in the room for sender and one for the receiver. Basically i was concatenating the user IDs to create room , so there were two rooms created, 

He asked me to change the logic so that, chat gets stored once only, so i had to create a common room, such that both sender and receiver can fetch the chat details. To create a common room for both users, i used character by character ASCII sum of both user IDs, so it will be common on both sides, and chat data can be fetched from the database using a common Room ID.

Here's your problem of the day

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

Skill covered: Programming

What is recursion?

Choose another skill to practice
Similar interview experiences
company logo
SDE - 1
5 rounds | 15 problems
Interviewed by Microsoft
3921 views
0 comments
0 upvotes
company logo
SDE - 1
5 rounds | 7 problems
Interviewed by Microsoft
2604 views
0 comments
0 upvotes
company logo
SDE - 1
1 rounds | 2 problems
Interviewed by Microsoft
7356 views
0 comments
0 upvotes
company logo
SDE - 1
4 rounds | 7 problems
Interviewed by Microsoft
1226 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - 1
5 rounds | 12 problems
Interviewed by Amazon
114579 views
24 comments
0 upvotes
company logo
SDE - 1
3 rounds | 7 problems
Interviewed by Amazon
34961 views
7 comments
0 upvotes
company logo
SDE - 1
3 rounds | 11 problems
Interviewed by Amazon
21740 views
4 comments
0 upvotes