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

SDE - Intern

Microsoft
upvote
share-icon
5 rounds | 5 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 6 Months
Topics: Data Structures, C++, Java, OOPS, System Design, Algorithms, Dynamic Programming
Tip
Tip

Tip 1 : Practice at least 300 coding questions.
Tip 2 : Be confident during the interview and never hesitate to ask if you are stuck. They will definitely help you out.
 

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

Tip 1 : Mention some good projects on your resume.
Tip 2 : Don't put false things on your resume.

Interview rounds

01
Round
Medium
Online Coding Interview
Duration90 Minutes
Interview date16 Oct 2020
Coding problem3

Conducted on https://tests.mettl.com/ and contains 3 coding questions with different difficulty levels – Basic, Easy, and Medium and carrying marks accordingly.

Those who had solved at least 2 questions were selected for the next round. I was able to solve all of them and around 90 students were selected for the next round.

1. Find Division Upto Given Decimal Places

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

You are given three integers ‘X’, ‘Y’ and ‘N’. Find the value of division X / Y up to ‘N’ decimal places.

You should return a string that represents the value X / Y up to ‘N’ decimal places. This string must have ‘N’ digits after decimals. You don’t need to round off the result to ‘N’ decimal places, just find the first ‘N’ places after decimals.

Note:

1. It is guaranteed that division X / Y is always finite.

Example:

Consider X = 5, Y = 4 and N = 5, then you should return “1.25000”. 
Note, here we add 3 trailing zeros so that it has exactly 5 digits after decimals.    
Try solving now

2. Longest Palindromic Substring

Moderate
20m average time
80% success
0/80
Asked in companies
AmazonMicrosoftCIS - Cyber Infrastructure

You are given a string 'str' of length 'N'.


Your task is to return the longest palindromic substring. If there are multiple strings, return any.


A substring is a contiguous segment of a string.


For example :
str = "ababc"

The longest palindromic substring of "ababc" is "aba", since "aba" is a palindrome and it is the longest substring of length 3 which is a palindrome. 

There is another palindromic substring of length 3 is "bab". Since starting index of "aba" is less than "bab", so "aba" is the answer.
Try solving now

3. Smallest Window

Moderate
10m average time
90% success
0/80
Asked in companies
InfosysHSBCSnapdeal

You are given two strings S and X containing random characters. Your task is to find the smallest substring in S which contains all the characters present in X.

Example:

Let S = “abdd” and X = “bd”.

The windows in S which contain all the characters in X are: 'abdd', 'abd', 'bdd', 'bd'. 
Out of these, the smallest substring in S which contains all the characters present in X is 'bd'. 
All the other substring have a length larger than 'bd'.
Try solving now
02
Round
Medium
Coding Test - Pen and paper
Duration60 Minutes
Interview date17 Oct 2020
Coding problem2

It was a pen and paper-based round. 2 questions were given, and we have to solve them efficiently and specify our approach clearly.

Those who had solved both the problems efficiently and able to explain their ideas clearly were shortlisted for further rounds. 24 students selected for the interviews.

1. Connect Nodes at Same Level

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

A binary tree is a tree where each node has at most two children i.e left child and right child.

You are given a binary tree, where the structure of the node is as follow -:

class BinaryTreeNode {
 int data;      // Value of the node.
 BinaryTreeNode *left;  // Pointer to left child node.
 BinaryTreeNode *right; // Pointer to right child node.
 BinaryTreeNode *next;  // Pointer to next right node at same level. 
}

Your task is to connect all the adjacent nodes at the same level in the given binary tree. You can do this by populating each 'next' pointer to point to its next right node. If there is no next right node, the next pointer should be set to NULL. Initially, all the next pointers are set to NULL.

For Example:

Consider the figure shown below. The left part represents the initial binary tree and right part represents the binary tree after connecting adjacent nodes at the same level.

alt text

In the tree shown in the picture above -:
The ‘next’ pointer of the node having value 2 is connected to the node having value 3.
The ‘next’ pointer of the node having value 4 is connected to the node having value 5.
The ‘next’ pointer of the node having value 5 is connected to the node having value 6.
The ‘next’ pointer of nodes having value 1, 3, 6 will have a value NULL as there are no next right nodes in their cases.

Note:

1. The structure of the ‘Node’ of a binary tree is already defined. You should not change it.   
2. The root of the binary tree is known to you.  
3. There is at least one node in the given binary tree.
4. You may only use constant extra space.
Try solving now

2. Minimum Number of Platforms

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

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
03
Round
Easy
Video Call
Duration45 Minutes
Interview date17 Oct 2020
Coding problem0

The interview started with a brief introduction about myself, the interviewer told me to continue for straight 5 mins (I only prepared for 2-3 mins so I started telling about what I have done in the college… So be prepared for it )

Then he moved on to the previous round question (2nd que of the group fly around). He had my solution and told me to validate my code for different test cases. The interviewer was trying to prove that my approach is incorrect by adding new edge cases every time but in the end, he was satisfied with the approach. He also asked about the implementation of Min-Heap since I have used it in my code. 

This discussion went around 30- 35 mins then he asked me about the different technologies that I have worked upon and a little discussion about them. In the end, I asked him a few questions about Microsoft life and the culture of Microsoft.

04
Round
Medium
Video Call
Duration60 Minutes
Interview date19 Oct 2020
Coding problem0

The interviewer was very cool, he was looking at my resume and I have written web series and cricket in the hobbies section, so he asked a few ques-

Can you name all the web series that you’ve watched? (He asked a few character’s names from GOT maybe he was just checking that I’ve watched it or not)
Fav player in cricket and why?
What do I do bowling or batting?
He told me since I have to manage lectures, labs, assignments, web series, cricket, and many other things so let’s do the job scheduling problem. . I took some time and came up with a recursive approach. He pointed out some edge cases that I was missing and asked me to correct them and I did so. Now he asked if I can use DP to further optimize this solution. I tried but not getting the correct approach then I asked him for help and finally, after 2 tries I was able to write it, and he seems satisfied as well.
What is a Binary tree?
What is a binary search tree?
He asked many questions, I asked a few-
-> Areas of improvement.
-> Technologies that I/everybody should know.
-> About work-life balance at Microsoft.

05
Round
Easy
HR Round
Duration45 Minutes
Interview date19 Oct 2020
Coding problem0

The interviewer asked, What is the name of your previous interviewers? I only remember the 2nd interviewer’s name since the 1st one didn’t tell me his name and I didn’t ask. She said You should have asked his name. (I made sure that I’ll ask her name in the end) then some quick questions-
Fav Data structure and why do you think this is your fav?
What is an abstraction in java?
Draw the class structure of an ATM.
Write the methods that you have used in the class structure of the ATM machine.
Write some strings. (Yeah you read it correctly!!!) I don’t know what kind of ques is this but I wrote some uppercase string, lowercase string, and a string with the value “String”.

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 create a function in JavaScript?

Choose another skill to practice
Start a Discussion
Similar interview experiences
company logo
SDE - Intern
3 rounds | 8 problems
Interviewed by Microsoft
1667 views
2 comments
0 upvotes
company logo
SDE - Intern
3 rounds | 6 problems
Interviewed by Microsoft
996 views
0 comments
0 upvotes
company logo
SDE - Intern
2 rounds | 5 problems
Interviewed by Microsoft
1517 views
0 comments
0 upvotes
company logo
SDE - Intern
2 rounds | 4 problems
Interviewed by Microsoft
158 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - Intern
3 rounds | 6 problems
Interviewed by Amazon
13595 views
4 comments
0 upvotes
company logo
SDE - Intern
2 rounds | 4 problems
Interviewed by Amazon
9049 views
2 comments
0 upvotes
company logo
SDE - Intern
3 rounds | 4 problems
Interviewed by Amazon
6014 views
3 comments
0 upvotes