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

SDE - 1

Microsoft
upvote
share-icon
4 rounds | 13 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 5 Months
Topics: Data Structures and Algorithms, Operating System, Object Oriented Programming Concepts, Database Management System, Aptitude Questions, Resume Discussion
Tip
Tip

Tip 1 : The most important topic to prepare is DSA, everything else is secondary. Don't run behind advanced technologies if your DSA concepts are not strong.
Tip 2 : Make sure you know the fundamentals of the programming language you code in, apart from OS, OOP and DBMS concepts. Knowledge of these topics showcase your interest in Computer Science, in general. 
Tip 3 : Practice by giving contests on Leetcode and other coding platforms. Don't focus on your score or rank, just focus on your learning.

Application process
Where: Campus
Eligibility: Minimum 80% academic score, No active or dead backlog, Only CSE, IT and ECE students allowed
Resume Tip
Resume tip

Tip 1 : Make sure your resume is well structured and only 1 page, if you are a fresher. It should include relevant sections like Work Experience (Any past internships), PORs (Any college society you were a part of), Personal Projects and Achievements that you wish to showcase.
Tip 2 : Proofread your resume multiple times. Get it reviewed by your seniors or your friends to ensure there are no grammatical mistakes or spelling errors as it gives a bad impression.

Interview rounds

01
Round
Medium
Online Coding Test
Duration90 minutes
Interview date6 Aug 2020
Coding problem3

The online coding round took place at 9:30 am in the morning. The platform was new so I got familiar with it in advance, a night before, to avoid any hassle during the test. There was camera proctoring and laptop screen sharing throughout the test. Multiple programming languages like Java, C, C++ and Python were allowed. There were 3 coding questions based on DSA. Questions were different for different candidates.

1. Distinct Strings With Odd and Even Swapping Allowed

Moderate
15m average time
85% success
0/80
Asked in companies
MicrosoftCerner Corporation

You are given an array of strings. Your task is to find the number of unique strings.

A string is considered unique if it cannot be formed from any other string, present in the array, even after applying the following operations any number of times and in any order:

1. Swapping two characters present at odd indices.

2. Swapping two characters present at even indices.

Note:
Strings contain only lowercase English alphabets.
Example:
Let the array of strings be [“abcd”, “cbad”, “bdac”, “adcb”]. From the given array, strings “abcd”, “cbad”, and “adcb” can be transformed into one another by applying the given operations. But “bdac” cannot be transformed into any other string. Hence, there are only 2 unique strings in the array.
Try solving now

2. Check If One String Is A Rotation Of Another String

Moderate
15m average time
85% success
0/80
Asked in companies
OracleAmazonAmerican Express

You are given two Strings 'P' and 'Q' of equal length.


Your task is to return 1 if String 'P' can be converted into String 'Q' by cyclically rotating it to the right any number of times ( Possibly Zero ), else return 0.


A cyclic rotation to the right on String 'A' consists of taking String 'A' and moving the rightmost character to the leftmost position. For example, if 'A' = "pqrst", then it will be "tpqrs" after one cyclic rotation on 'A'.


For example:
Consider the two strings 'P' = "abfyg" and 'Q' = "gabfy" 

If we cyclically rotate String 'P' to the right once. The resulting string P becomes "gabfy" which is equal to String 'Q'. 

Therefore it is possible to convert String 'P' to String 'Q'.
Try solving now

3. Buses

Moderate
15m average time
85% success
0/80
Asked in company
Microsoft

You are given a vector of 'N' integers denoting the number of buses that can be boarded from the i-th position. The bus stops only at stops whose number is a multiple of the bus stop number from which the bus originates. You need to find the number of buses originating from each bus stop from 1 to 'N'.

For example:

If 'N' = 4 and the given vector is: [1 3 4 3].

1 bus can be boarded from the first bus stop which means that 1 bus originates from the first bus stop.

3 buses can be boarded from the second bus stop which means that (3 - 1 = 2) buses originate from the second bus stop. This is because the bus originating from the first stop will stop at the second stop as well.

4 buses can be boarded from the third bus stop which means that (4-1 = 3) buses originate from the third bus stop. This is because the bus originating from the first stop will stop at the third stop as well.

3 buses can be boarded from the fourth bus stop which means that (3-3 = 0) buses originate from the fourth bus stop. This is because the buses originating from the first and second stop will stop at the fourth stop as well.

So the final vector would be: [1 2 3 0].

Note:

The given vector uses 1-based indexing.
Try solving now
02
Round
Medium
Video Call
Duration45 Minutes
Interview date10 Aug 2020
Coding problem2

The interview took place through Microsoft Teams at 2:00 pm. The platform was smooth and the interviewer was very friendly and told me that he isn't looking for bookish language answers but he only wants to check my understanding of CS subjects.

1. OS Questions

What is a process?
What is a program?
Difference between a program and a process.
What is a thread?
What are the different states in a process life cycle?

2. Longest Mountain Subarray

Easy
10m average time
90% success
0/40
Asked in companies
MicrosoftGoldman SachsShareChat

You are given an array of 'N' integers denoting the heights of the mountains. You need to find the length of the longest subarray which has the shape of a mountain.

A mountain subarray is defined as a subarray which consists of elements that are initially in ascending order until a peak element is reached and beyond the peak element all other elements of the subarray are in decreasing order.

Example:
If the given array is: [1 3 1 4]. The longest mountain subarray would be 3. This is because the longest mountain is  [1 3 1] having length 3.
Try solving now
03
Round
Medium
Video Call
Duration55 Minutes
Interview date10 Aug 2020
Coding problem5

The interview was conducted on Microsoft Teams and the interviewer was very friendly. He made sure I was comfortable and described his role at Microsoft.

1. Technical Questions

The interview discussed the tech skills and projects mentioned in my resume. Since I had recently started one NLP based project, the interviewer asked me a challenge that I might face in that domain and how I am planning to overcome it. I thought for a while and gave a simple answer which I could think of at that time.

Explain the internal working of HashMaps in Java.
What is the importance of hash code function?
How does Java work internally (JVM and its use)
How is Java different from Python?

2. OOPS Questions

What is an abstract method?
What is polymorphism?
What is encapsulation?

3. OS Questions

What are semaphores?
What are the different types of semaphores?
What is a mutex?
What is a deadlock and how to handle it?

4. Kth largest element in the unsorted array

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

You are given an array consisting of 'N' distinct positive integers and a number 'K'. Your task is to find the kth largest element in the array.

Example:
Consider the array {2,1,5,6,3,8} and 'K' = 3, the sorted array will be {8, 6, 5, 3, 2, 1}, and the 3rd largest element will be 5.
Note:
1) Kth largest element in an array is the kth element of the array when sorted in non-increasing order. 

2) All the elements of the array are pairwise distinct.
Try solving now

5. DBMS Question

Describe the ACID properties in DBMS.

04
Round
Hard
Video Call
Duration60 Minutes
Interview date10 Aug 2020
Coding problem3

The interview was conducted on Microsoft Teams and code was written on Notepad (screen shared). The interviewer was friendly and gave hints to reach the final solution.

1. Data Structure Supporting Insert Delete And GetRandom

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

Design and implement a data structure which supports the following operations:

insert(X): Inserts an element X in the data structure and returns true if the element was not present, and false otherwise.

remove(X): Removes the element X from the data structure, if present. Returns true if the element was present and false otherwise.

search(X): Search the element X in the data structure. Returns true if the element was present and false otherwise.

getRandom(): Return a random element present in the data structure.

Four types of queries denote these operations:

Type 1: for insert(X) operation.
Type 2: for remove(X) operation.
Type 3: for search(X) operation.
Type 4: for getRandom() operation.
Note:
It is guaranteed that at least one element will be present in the data structure when getRandom() operation is performed.
Follow Up:
Can you implement every operation such that it works in O(1) time?
Try solving now

2. BST to sorted DLL

Moderate
50m average time
50% success
0/80
Asked in companies
AdobeFacebookSalesforce

You are provided with a Binary Search Tree (BST), all you have to do is to convert it into the sorted doubly linked list (DLL).

For Example:

Example

Consider the above BST, it will be converted into the below sorted DLL.

Example

Here, 20 is the head node and 80 is the tail node.

Try solving now

3. General Question

What would your dream project be like?

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 - 1
5 rounds | 15 problems
Interviewed by Microsoft
4035 views
0 comments
0 upvotes
company logo
SDE - 1
5 rounds | 7 problems
Interviewed by Microsoft
2661 views
0 comments
0 upvotes
company logo
SDE - 1
1 rounds | 2 problems
Interviewed by Microsoft
7425 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
SDE - 1
5 rounds | 12 problems
Interviewed by Amazon
115097 views
24 comments
0 upvotes
company logo
SDE - 1
3 rounds | 7 problems
Interviewed by Amazon
35147 views
7 comments
0 upvotes
company logo
SDE - 1
3 rounds | 11 problems
Interviewed by Amazon
21829 views
4 comments
0 upvotes