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

SDE - 1

Microsoft
upvote
share-icon
3 rounds | 6 Coding problems

Interview preparation journey

expand-icon
Journey
I started off with solving easy and medium coding questions on various coding platforms. Also took help from Interview Experiences to get an idea about what kind of questions Microsoft asks. Along with solving coding questions, I brushed up my skills on Java, DBMS and Operating Systems. I also skimmed through Refactoring guru design patterns blog as well as youtube videos of Christopher Okhravi.
Application story
Applied via aggregator websites (Naukri etc.). Got a call from HR within 2-3 weeks and discussed on the opening. The interview was scheduled after 2 days. Have gone through 3 rounds - 2 for technical interview and 1 for design-cum-managerial round.
Why selected/rejected for the role?
I got rejected. Although the interview went pretty well, the HR informed me that they had decided to go with the other candidate for now. No particular reason was mentioned.
Preparation
Duration: 2-3 months
Topics: Data structures, Algorithms, Java programming language, Operating Systems, Design Patterns, DBMS
Tip
Tip

Tip 1: Start solving easy coding problems as early as possible.
Tip 2: Use a timer to solve questions within a specified time (max 30-40 minutes for easy ones).
Tip 3: Keep in touch with the basics of your programming language to code faster.
Tip 4: Have a good in-depth knowledge of the projects you mention on your resume and be prepared for a few optimization questions.
Tip 5: Find and prepare a set of common interview questions on computer science concepts (like race conditions, normalization, etc.).

Application process
Where: Campus
Eligibility: 2-3 years of experience (Salary package: 30 LPA)
Resume Tip
Resume tip

Tip 1: Keep it a one-pager, mentioning details relevant to the position applying for
Tip 2: Always mention special achievements/programming profile (GitHub etc.) to get an edge over others

Interview rounds

01
Round
Easy
Video Call
Duration60 minutes
Interview date22 Apr 2022
Coding problem2

Timing: from 10 am - 11 am
Mode: Online Google Meet 
The interviewer joined in on time and was very professional in interaction.

1. Sub-array Sums Divisible By K

Moderate
25m average time
75% success
0/80
Asked in companies
MicrosoftUKG (Ultimate Kronos Group)BarRaiser

Given an array of integers of size ‘N’ and a positive integer ‘K’. Return the number of non-empty subarrays whose sum is divisible by K.

A subarray is a contiguous subset of an array.


For Example :
Consider an array of size four. The elements of the array are { -4, 5, 6, 1}. 
The value of K is 4. 
The subarrays whose sum is divisible by 4 are as  follows:
[ -4 ] 
[-4, 5, 6, 1] 
[ 5, 6, 1] 
Hence, there are three subarrays whose sum is divisible by 4. 
Problem approach

Since I had seen a similar problem before, was able to come to a solution in time. Started off with a brute force approach and then narrowed down to using O(n) solution using Kadane's algorithm.

Try solving now

2. Boundary Traversal of Binary Tree

Hard
20m average time
85% success
0/120
Asked in companies
Goldman SachsOYOExpedia Group

You are given a binary tree having 'n' nodes.


The boundary nodes of a binary tree include the nodes from the left and right boundaries and the leaf nodes, each node considered once.


Figure out the boundary nodes of this binary tree in an Anti-Clockwise direction starting from the root node.


Example :
Input: Consider the binary tree A as shown in the figure:

alt text

Output: [10, 5, 3, 7, 18, 25, 20]

Explanation: As shown in the figure

The nodes on the left boundary are [10, 5, 3]

The nodes on the right boundary are [10, 20, 25]

The leaf nodes are [3, 7, 18, 25].

Please note that nodes 3 and 25 appear in two places but are considered once.
Problem approach

Discussed 2-3 approaches with and without extra space. Used a combination of inorder/preorder traversal to solve it finally.

Try solving now
02
Round
Easy
Online Coding Test
Duration60 minutes
Interview date22 Apr 2022
Coding problem2

Timing: from 2 pm to 3 pm
Mode: Online Google Meet 
The interviewer joined in on time and was very professional in interaction.

1. Count Good Subarrays

Moderate
0/80

Given an integer array 'NUMS' of size 'N' and an integer 'K'.


Return the number of good subarrays of 'NUMS'.


A subarray 'ARR' is good if there are at least 'K' pairs of indices (i, j) such that i < j and ARR[i] == ARR[j].


A subarray is a contiguous non-empty sequence of elements within an array.


For Example :
Let 'N' = 5, 'NUMS' = [1, 2, 1, 1, 3], K = 2.
Consider the subarray [1, 2, 1, 1] (indices 0 to 3 of NUMS). The elements are 1, 2, 1, 1.
Pairs with equal values and i < j within this subarray are:
(1 at index 0, 1 at index 2), (1 at index 0, 1 at index 3), (1 at index 2, 1 at index 3).
There are 3 such pairs. Since 3 >= K (2), this subarray is good.

Consider the subarray [1, 2, 1, 1, 3] (indices 0 to 4 of NUMS). The elements are 1, 2, 1, 1, 3.
Pairs with equal values and i < j within this subarray are:
(1 at index 0, 1 at index 2), (1 at index 0, 1 at index 3), (1 at index 2, 1 at index 3).
There are 3 such pairs. Since 3 >= K (2), this subarray is good.

Consider the subarray [2, 1, 1] (indices 1 to 3 of NUMS). The elements are 2, 1, 1.
Pairs with equal values and i < j within this subarray are:
(1 at index 1, 1 at index 2).
There is 1 such pair. Since 1 < K (2), this subarray is not good.

It can be shown that the only good subarrays are [1, 2, 1, 1] and [1, 2, 1, 1, 3].
Therefore, the total number of good subarrays is 2.
Problem approach

Started with 2 loops to solve with brute force. Then after discussion with the interviewer, devised a sliding window algo to solve it. Could not write the code of it as there were time constraints.

Try solving now

2. Java and Operating System

Questions on Java programming language like: (Learn)
1. Call by value vs call by reference
2. Java memory structure - stack, heap, string space, etc
3. Streams - pros and cons


Questions on Operating System like: (Learn)

4. Multithreading and multiprocessing + race condition
 

5. Questions on my previous projects

Problem approach

Tip 1: Practise sliding window problems on 1-D array as these are most commonly asked in various interviews
Tip 2: Keep updated about core Java features 
Tip 3: Brush up on fundamentals of memory structure and multithreading

03
Round
Easy
Online Coding Test
Duration60 minutes
Interview date25 Apr 2022
Coding problem2

Timing: 3 pm to 4 pm
It was taken by a senior member, focusing mainly on problem solving and design skills.

1. System Design

Asked me to design low-level design of ride hailing app (like Uber/Ola). Had to include the basic APIs to search a ride, book/create a ride, cancel a ride and update a ride. Pricing algo was to be very basic. Had to start with booking of 4-wheeler cabs and then extend it to 2-wheelers. (Learn)

Problem approach

Tip 1: Know some basic design patterns like Factory, Decorator, Adapter, etc
Tip 2: Always start by asking questions to make the requirements clear, do not dive deep into the code unless asked explicitly
Tip 3: Try to think out loud so that the interviewer knows what you are trying to do and can help when needed

2. System Design

Asked basic questions on my design and ways to make it more scalable and extensible. Then turned the discussion towards my projects and challenges I faced while working on them. These include my past company projects as well. (Learn)

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