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

SDE - Intern

Microsoft
upvote
share-icon
3 rounds | 5 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 7 months
Topics: Arrays, Dynamic Programming, Graphs, Trees, Linked Lists
Tip
Tip

Tip 1 : Start as soon as possible at least 3-4 months before starting of 3rd year in college.
Tip 2 : Do not hesitate to look for solutions on YouTube or any other platform. Even if you solved a question then also try to look for other optimal solutions. It is very helpful during interviews.
Tip 3 : Try to do questions from leetcode, interviewbit (highly recommended).
Tip 4 : I want to highlight tip 3 again. I have done interview bit till 50000 point and recommend others to do same.
Tip 5: Try to have at least 2 projects (1 major and 1 minor) or if you have 1 major project then it should be full fledged i.e. frontend backend fully implemented.

Application process
Where: Campus
Eligibility: CPi : 7.5 and above
Resume Tip
Resume tip

Tip 1: Read your resume thoroughly. You should know everything mentioned in your resume.
Tip 2: Try to put your resume more on technical side (try to include technical achievements)
Tip 3: Try to be precise and keep it in single page only.

Interview rounds

01
Round
Easy
Video Call
Duration60 minutes
Interview date13 Aug 2021
Coding problem2

Round 1 started in morning at around 10 am. It began with formal introduction of mine and also the interviewer. Due to covid lockdown I have to give it from my home. Interviewer was very chill and nice. Also level of questions asked is easy.

1. Find Peak Element

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

An element is called a peak element if its value is not smaller than the value of its adjacent elements(if they exists).
Given an array arr[] of size N, Return the index of any one of its peak elements.

Problem approach

Brute approach : Linear traversal.
Optimized approach : Binary Search.

Try solving now

2. Balanced parentheses

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

Given an integer ‘N’ representing the number of pairs of parentheses, Find all the possible combinations of balanced parentheses with the given number of pairs of parentheses.

Note :

Conditions for valid parentheses:
1. All open brackets must be closed by the closing brackets.

2. Open brackets must be closed in the correct order.

For Example :

()()()() is a valid parentheses.
)()()( is not a valid parentheses.
Problem approach

In this I got some time to think of solution. I can't think of brute solution in this one. So, I go on with optimal solution using stack.

Try solving now
02
Round
Hard
Video Call
Duration60 minutes
Interview date13 Aug 2021
Coding problem2

This round started after half an hour from first round. In this round also interviewer was calm and chill.

1. Reverse Nodes in k-Group

Hard
56m average time
30% success
0/120
Asked in companies
SAP LabsHikeAdobe

You are given a Singly Linked List of integers and an integer array 'B' of size 'N'. Each element in the array 'B' represents a block size. Modify the linked list by reversing the nodes in each block whose sizes are given by the array 'B'.

Note:
1. If you encounter a situation when 'B[i]' is greater than the number of remaining nodes in the list, then simply reverse the remaining nodes as a block and ignore all the block sizes from 'B[i]'. 

2. All block sizes are contiguous i.e. suppose that block 'B[i]' ends at a node cur, then the block 'B[i+1]' starts from the node just after the node cur.
Example
Linked list: 1->2->3->4->5
Array B: 3 3 5

Output: 3->2->1->5->4

We reverse the first block of size 3 and then move to block 2. Now, since the number of nodes remaining in the list (2) is less than the block size (3), we reverse the remaining nodes (4 and 5) as a block and ignore all the block sizes that follow.
Problem approach

I have made a reverseHelper function which takes starting and end nodes from a group of k size and then attach this reversed group in front of dummy node. Similarly, did this for all groups of k.

Try solving now

2. Kth Smallest Element

Easy
15m average time
85% success
0/40
Asked in companies
Info Edge India (Naukri.com)DelhiveryIntuit

You are given an array of integers 'ARR' of size 'N' and another integer 'K'.


Your task is to find and return 'K'th smallest value present in the array.


Note: All the elements in the array are distinct.


Example
If 'N' is 5 and 'K' is 3 and the array is 7, 2, 6, 1, 9

Sorting the array we get 1, 2, 6, 7, 9

Hence the 3rd smallest number is 6.
Problem approach

Brute : Sort the array and return element at (k-1)th index.
Optimal : Used priority queue or heap.

Try solving now
03
Round
Medium
Video Call
Duration60 minutes
Interview date13 Aug 2021
Coding problem1

This was HR + technical round. Interviewer was super chill. This round happened at around 1:00 pm. In this round there was project discussion and 1 coding question.
Do remember to thoroughly read your project.

1. Group Anagrams

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

You have been given an array/list of strings 'inputStr'. You are supposed to return the strings as groups of anagrams such that strings belonging to a particular group are anagrams of one another.

An anagram is a word or phrase formed by rearranging the letters of a different word or phrase. We can generalize this in string processing by saying that an anagram of a string is another string with the same quantity of each character in it, in any order.

Note:
The order in which the groups and members of the groups are printed does not matter.
For example:
inputStr = {"eat","tea","tan","ate","nat","bat"}
Here {“tea”, “ate”,” eat”} and {“nat”, “tan”} are grouped as anagrams. Since there is no such string in “inputStr” which can be an anagram of “bat”, thus, “bat” will be the only member in its group.
Problem approach

I have used sorting and hash map to solve the problem. For each word, I first make a temporary copy of the word, sort the copy and store the original word in map[copy]. In this way, all anagrams for given word can be found out easily.

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
SDE - Intern
3 rounds | 8 problems
Interviewed by Microsoft
2318 views
2 comments
0 upvotes
company logo
SDE - Intern
3 rounds | 6 problems
Interviewed by Microsoft
1353 views
0 comments
0 upvotes
company logo
SDE - Intern
2 rounds | 5 problems
Interviewed by Microsoft
1985 views
0 comments
0 upvotes
company logo
SDE - Intern
2 rounds | 4 problems
Interviewed by Microsoft
632 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - Intern
3 rounds | 6 problems
Interviewed by Amazon
15605 views
4 comments
0 upvotes
company logo
SDE - Intern
2 rounds | 4 problems
Interviewed by Amazon
10216 views
2 comments
0 upvotes
company logo
SDE - Intern
3 rounds | 4 problems
Interviewed by Amazon
6389 views
3 comments
0 upvotes