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

SWE Intern

Microsoft
upvote
share-icon
5 rounds | 17 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 18 Months
Topics: DSA, OOPs, Computer Networks, DBMS and Backend Dev Technologies
Tip
Tip

Tip 1 : Get your basic clear
Tip 2 : Do not ignore CSE fundamentals
Tip 3 : Keep at-least 1 project that you know end to end

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

Tip 1 : Talk about internships
Tip 2 : Prepare behavioural questions
Tip 3 : DSA and projects are equally important here

Interview rounds

01
Round
Medium
Online Coding Interview
Duration30 Minutes
Interview date15 Mar 2022
Coding problem6

Great platform. easy to navigate. every question is timed

1. OS Question

A solution to the problem of external fragmentation is ____________
a) compaction
b) larger memory space
c) smaller memory space
d) none of the mentioned

2. OS Question

When the memory allocated to a process is slightly larger than the process, then ____________
a) internal fragmentation occurs
b) external fragmentation occurs
c) both internal and external fragmentation occurs
d) neither internal nor external fragmentation occurs

3. OS Question

Time complexities for different sorts

4. DBMS Question

Normalize relations

5. Output Question

What will be the output of the following Java program?

   import java.util.*;
   class Array
   {
       public static void main(String args[]) 
       {
           int array[] = new int [5];
           for (int i = 5; i > 0; i--)
               array[5 - i] = i;
           Arrays.sort(array);
           for (int i = 0; i < 5; ++i)
            System.out.print(array[i]);;
       }
   }

6. Output Question

Predict the output of following Java Programs.
Program 1 :


class A
{
   public A(String s) 
   {
       System.out.print("A");
   }
}
 
public class B extends A 
{
   public B(String s) 
   {
       System.out.print("B");
   }
   public static void main(String[] args) 
   {
       new B("C");
       System.out.println(" ");
   }
}

02
Round
Easy
Online Coding Test
Duration60 Minutes
Interview date20 Oct 2022
Coding problem2

2 coding questions. hard and medium

1. Break The Prison

Moderate
0/80
Asked in companies
ZSMicrosoftInnovaccer

Ninja has been caged up in a prison and he is planning to escape from it. The prison's gate consists of horizontal and vertical bars that are spaced one unit apart, so the area of each hole between the bars is (1 * 1). Ninja manages to remove certain bars and make some of these holes bigger. Your task is to determine the area of the largest hole in the gate after the bars are removed.

For example, let us consider that the initial prison gate with ‘n’ = 8 horizontal and ‘m’ = 8 vertical bars, where the area of the biggest hole in the bars is (1 * 1). If we remove the 4th horizontal bar and 6th vertical bar, then our maximum area will be (2 * 2).

Try solving now

2. Minimum Operations

Easy
20m average time
82% success
0/40
Asked in companies
BNY MellonLinkedInThought Works

You are given an array 'ARR' of 'N' positive integers. You need to find the minimum number of operations needed to make all elements of the array equal. You can perform addition, multiplication, subtraction or division with any element on an array element.

Addition, Subtraction, Multiplication or Division on any element of the array will be considered as a single operation.

Example:

If the given array is [1,2,3] then the answer would be 2. One of the ways to make all the elements of the given array equal is by adding 1 to the array element with value 1 and subtracting 1 from the array element with value 3. So that final array would become [2,2,2]. 
Try solving now
03
Round
Medium
Telephonic
Duration45 Minutes
Interview date4 Apr 2022
Coding problem4

Started with an introduction. This round was purely around DSA and OOPs related concepts.

1. Segregate Even And Odd Nodes In a Linked List

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

You are given the head node of a singly linked list 'head'. Your task is to modify the linked list in such a way that all the even valued nodes appear before the all odd valued node and order of nodes remain the same.


Example :-
The given singly linked list is  6 -> 5 -> 3 -> 4 -> 7 -> 1 -> 2 

subsequence

The modified linked list should have all even values in starting and odd values in the end.
Try solving now

2. House Robber II

Moderate
15m average time
80% success
0/80
Asked in companies
UberIntuitMicrosoft

Mr. X is a professional robber planning to rob houses along a street. Each house has a certain amount of money hidden.


All houses along this street are arranged in a circle. That means the first house is the neighbour of the last one. Meanwhile, adjacent houses have a security system connected, and it will automatically contact the police if two adjacent houses are broken into on the same night.


You are given an array/list of non-negative integers 'ARR' representing the amount of money of each house. Your task is to return the maximum amount of money Mr. X can rob tonight without alerting the police.


Note:
It is possible for Mr. X to rob the same amount of money by looting two different sets of houses. Just print the maximum possible robbed amount, irrespective of sets of houses robbed.


For example:
(i) Given the input array arr[] = {2, 3, 2} the output will be 3 because Mr X cannot rob house 1 (money = 2) and then rob house 3 (money = 2), because they are adjacent houses. So, he’ll rob only house 2 (money = 3)

(ii) Given the input array arr[] = {1, 2, 3, 1} the output will be 4 because Mr X rob house 1 (money = 1) and then rob house 3 (money = 3).

(iii) Given the input array arr[] = {0} the output will be 0 because Mr. X has got nothing to rob.
Try solving now

3. DBMS Questions

What are indexes in a db, transactions, isolation levels

4. Tree Traversals

Easy
15m average time
85% success
0/40
Asked in companies
Wells FargoBig BasketMicrosoft

You have been given a Binary Tree of 'N'

nodes, where the nodes have integer values.


Your task is to return the ln-Order, Pre-Order, and Post-Order traversals of the given binary tree.


For example :
For the given binary tree:

Binary - Tree1

The Inorder traversal will be [5, 3, 2, 1, 7, 4, 6].
The Preorder traversal will be [1, 3, 5, 2, 4, 7, 6].
The Postorder traversal will be [5, 2, 3, 7, 6, 4, 1].
Try solving now
04
Round
Hard
Video Call
Duration60 Minutes
Interview date4 Oct 2022
Coding problem4

Purely DSA, OOPs, DBMS and projects.

1. Reverse Bits

Moderate
0/80
Asked in companies
MicrosoftGrofersChegg Inc.

There is a song concert going to happen in the city. The price of each ticket is equal to the number obtained after reversing the bits of a given 32 bits unsigned integer ‘n’.


Try solving now

2. Asteroid Collision

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

You are given an array/list 'asteroids' representing asteroids in a row.


For each element of the given array, its absolute value denotes the size of that asteroid, and its sign denotes the direction it moves in(+ve meaning right and -ve meaning left).


An asteroid with a weight of 0 denotes a massless asteroid that moves in the right direction.


All asteroids are moving at the same speed. Whenever two asteroids collide, the smaller asteroid gets destroyed.


If both asteroids are the same size, then both asteroids get destroyed. Two asteroids moving in the same direction never collide.


You are supposed to find the state of the asteroids after all collisions.


Example :
Input: ‘asteroids’ = [3,-2,4]

Output: [3, 4]

Explanation: The first asteroid will destroy the second asteroid. Hence, after the collision, the state of the asteroids will be [3,4].
Note:
You don’t need to print anything. Just implement the given function.
Try solving now

3. System Design Question

Design an API to upload and download a mp3 file

4. OS Questions

Asked about Deadlocks, file system, pointer, memory layout, fragmentation, processes vs threads, inheritance

05
Round
Easy
HR Round
Duration30 Minutes
Interview date4 Oct 2022
Coding problem1

All around Behavioural question, internships and projects

1. Basic HR Questions

1. why walmart
2. why sde and not a product engineer
3. detailed overview of projects on resume
4. strengths

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
2320 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
3 rounds | 5 problems
Interviewed by Microsoft
781 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
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