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

SWE Intern

Microsoft
upvote
share-icon
3 rounds | 5 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 9 months
Topics: Data Structures, Algorithms, OOPs, Graphs, Trees
Tip
Tip

Tip 1 : Participate in contest it would improve your examination temperament.
Tip 2 : Prepare OOPs, Networking, OS and System design along with DSA
Tip 3 : Make good projects (at least 2).

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

Tip 1 : Don't bluff in resume.
Tip 2 : Add coding profiles as it shows you have explored and shown interest in coding.

Interview rounds

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

1. Overlapping Intervals

Easy
24m average time
0/40
Asked in companies
SprinklrAdobeAmazon

You have been given the start and end times of 'N' intervals. Write a function to check if any two intervals overlap with each other.

Note :
If an interval ends at time T and another interval starts at the same time, they are not considered overlapping intervals.
Try solving now
Easy
10m average time
90% success
0/40
Asked in companies
IntuitDisney + HotstarMicrosoft

Given N pairs of parentheses, write a function to generate and print all combinations of well-formed parentheses. That is, you need to generate all possible valid sets of parentheses that can be formed with a given number of pairs.

Try solving now
02
Round
Medium
Video Call
Duration50 minutes
Interview date13 Aug 2021
Coding problem2

It was around 2 to 3 pm and interviewer was very friendly.

1. Puzzle Question

a. Given an big queue of below struct:
struct Log {
   string machineName; //M1, M2…
   string errorCode; //E1, E2…
   int level; //0-error, 1-warning, 2-info
};
Write a program which can read the queue and generate the below information when the total number of logs with level 0 and 1 reach more than a threshold.
M1 E1 count
M1 E2 count
M2 E1 count
M2 E2 count

Problem approach

I used unordered map of unordered map which keeps track of count for machine code and error code as [machine code][error code] = count and the question can be easily solved afterwards.

Interviewer told me to do this in more systematic manner I used OOPs concepts and he was happy with that

2. Number of Islands

Easy
0/40
Asked in companies
IBMDunzoMicrosoft

You have been given a non-empty grid consisting of only 0s and 1s. You have to find the number of islands in the given grid.

An island is a group of 1s (representing land) connected horizontally, vertically or diagonally. You can assume that all four edges of the grid are surrounded by 0s (representing water).

Problem approach

I straight away applied depth first search on this problem and maintained a count of water bodies in the answer variable. This was the most optimal solution, so he twisted this question and asked another one.

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

It was around 4 to 5pm and interviewer was at very senior level.

1. Maximum Subarray Sum

Moderate
35m average time
81% success
0/80
Asked in companies
QualcommUberAmazon

You are given an array 'arr' of length 'n', consisting of integers.


A subarray is a contiguous segment of an array. In other words, a subarray can be formed by removing 0 or more integers from the beginning and 0 or more integers from the end of an array.


Find the sum of the subarray (including empty subarray) having maximum sum among all subarrays.


The sum of an empty subarray is 0.


Example :
Input: 'arr' = [1, 2, 7, -4, 3, 2, -10, 9, 1]

Output: 11

Explanation: The subarray yielding the maximum sum is [1, 2, 7, -4, 3, 2].
Problem approach

I first explained O(n^2) approach to the interviewer and he asked me to optimise. I then used kadane's algorithm and he asked me to code it. I coded and he asked me to find the print the subarray also. I added two if else statements in loop as follows:

for(i=0; i prev_max){
end = i;
start_o = start;
prev_max = curr_max;
}

}

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
SWE Intern
4 rounds | 6 problems
Interviewed by Microsoft
2319 views
0 comments
0 upvotes
company logo
SWE Intern
4 rounds | 5 problems
Interviewed by Microsoft
0 views
0 comments
0 upvotes
company logo
SWE Intern
5 rounds | 17 problems
Interviewed by Microsoft
1064 views
0 comments
0 upvotes
company logo
SDE - 1
4 rounds | 7 problems
Interviewed by Microsoft
1272 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SWE Intern
4 rounds | 6 problems
Interviewed by Dunzo
870 views
0 comments
0 upvotes
company logo
SWE Intern
4 rounds | 8 problems
Interviewed by Uber
0 views
0 comments
0 upvotes