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

SWE Intern

Microsoft
upvote
share-icon
4 rounds | 6 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 5 months
Topics: Data Structures, Object-Oriented Programming, Algorithms, Dynamic programming, Graphs, Operating Systems and Database Management System.
Tip
Tip

Tip 1: Find a good course, and first clear all your fundamentals and implementation of every data structure. You should be thorough with their time as well as space complexities. 
Tip 2: Upon clearing the fundamentals, select a platform where you have a large no of questions, also whose test cases are good. eg. LeetCode, InterviewBit or Codezen. Go and complete 300-400 questions.
Tip 3: Also whenever you're not able to solve the problem, check out the editorial and then re-attempt it again. Also, check the discussion if there is some good solution to the same problem. 
Tip 4: Most important : Compete with people on some online coding platform such as Codechef, codeforces or leetcode. It would help you in gaining a lot of interesting concepts and also improve your thinking skills.
Tip 5: Object-oriented programming is a must. One should study this as interview always asks from this domain.
Tip 6: Practicing and minimizing complexities after every solution will help you in gaining better understanding towards the question.

Application process
Where: Campus
Eligibility: 8 CGPA
Resume Tip
Resume tip

Tip 1: 1-2 page resume is good for a fresher.
Tip 2: Resume should contain facts, numbers, and data comparison.
Tip 3: Concise description of the projects attracts the interviewer.
Tip 4: Technical achievements in the field you're applying to, would be good.
Tip 5: DO NOT FAKE THINGS, the interviewer is smart enough.

Interview rounds

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

Test took place in the afternoon and the environment was so terrifying. Obviously, it would be because it was a subjective coding test. The test had it's webcam on, we were not allowed to go out of the frame. 3 coding questions were there - 1 easy, 1 medium and 1 hard.

1. Nth element of modified fibbonacci series

Easy
15m average time
85% success
0/40
Asked in companies
FacebookGrowwTata Consultancy Services (TCS)

You have been given two integers ‘X’ and ‘Y’ which are the first two integers of a series and an integer ‘N’. You have to find the Nth number of the series using the Fibonacci rule given by f(x) = f(x - 1) + f(x - 2).

The answer may be very large, return it after modulus 10 ^ 9 + 7.

Note:

The series is 1-based indexed.
Problem approach

I just minimized the time complexities using just 2 variables and then worked in dp approach. O(N) had all test cases passed. I could have done using matrix exponentiation but it was not required.

Try solving now

2. Euler Totient

Easy
15m average time
90% success
0/40
Asked in companies
MicrosoftAmadeus Lab

You are given an integer 'N'. Your task is to count the number of integers between 1 and 'N' both inclusive which are coprime to 'N'.

Note:
Two numbers are coprime if their greatest common divisor(GCD) is 1.

Here, 1 is considered to be coprime to any number.
For Example:
If the given integer is 9, then the answer would be 6 Because there are six numbers between 1 and 9 both inclusive which are coprime to 9 i.e 1, 2, 4, 5, 7, and 8.
Problem approach

It had the formula phi(n) = n(1-1/p1)(1-1/p2)....(1-1/pk), where p are distinct prime factors of n.
I stored all the prime factors of n by looping on it. and then formulating the answer.

Try solving now

3. Dice throw

Hard
35m average time
65% success
0/120
Asked in companies
MicrosoftDisney + HotstarShareChat

You are given D dice, each having F faces numbered 1 to F, both inclusive. The task is to find the possible number of ways to roll the dice together such that the sum of face-up numbers equal the given target S.

Note :
As the answer can be large, return your answer modulo 10^9  + 7.
Follow Up :
Can you solve this using not more than O(S) extra space?
Problem approach

Naive approach would be to look at every combination that sums to X but this didn't pass the test case. I used memoization that too didn't work. Afterwards I worked on 2D do.
for(i, 1..no of dices)
for(j, i...sum)
dp[i][j] = dp[i][j-1] + dp[i-1][j-1];
if(j-d-1>=0) dp[i][j] -= dp[i-1][j-d-1] // these are calculated extra times so removing it

Answer is in dp[d][X]; d = no of total dices, X = sum

Try solving now
02
Round
Easy
Face to Face
Duration60 minutes
Interview date10 Sep 2020
Coding problem1

Had a face 2 face call with the interviewer.
He asked me about singleton class and asked details about linked list.

1. Palindrome Linked List

Easy
20m average time
90% success
0/40
Asked in companies
CiscoMicrosoftAmazon

You are given a singly Linked List of integers. Your task is to return true if the given singly linked list is a palindrome otherwise returns false.

For example:
The given linked list is 1 -> 2 -> 3 -> 2-> 1-> NULL.

It is a palindrome linked list because the given linked list has the same order of elements when traversed forwards and backward​.
Follow Up:
Can you solve the problem in O(N) time complexity and O(1) space complexity iteratively?
Problem approach

So he asked me about the basic concept of palindrome and linked list's basic. Then for the same question I needed a middle node so that I can traverse and check for the palindrome.
Through hare and tortoise method I made him understood how to find the middle node in both even and odd lengthed linked list.
After finding the middle node, I just reversed the second half and checked whether it is a palindrome or not.
He asked a lot about to minimize the complexity. He asked me reverse the linked list in both iterative and recursive way and their time complexities. I considered the recursion stack and memory of the pointers even. He asked my better ways, I told him the best way and that worked.

Try solving now
03
Round
Easy
Face to Face
Duration90 minutes.
Interview date10 Sep 2020
Coding problem1

TIming was around 4PM and I was very stressed. The interviewer was good.

1. Find K’th Character of Decrypted String

Moderate
33m average time
0/80
Asked in companies
SamsungSiemensSwiggy

You have been given an Encrypted String where repetitions of substrings are represented as substring followed by the count of substrings.

Example: String "aabbbcdcdcd" will be encrypted as "a2b3cd3".

You need to find the 'K'th character of Decrypted String. Decrypted String would have 1-based indexing.

Note :

Input string will always be lowercase characters without any spaces.

If the count of a substring is 1 then also it will be followed by Integer '1'.
Example: "aabcdee" will be Encrypted as "a2bcd1e2"
This means it's guaranteed that each substring is followed by some Integer.

Also, the frequency of encrypted substring can be of more than one digit. For example, in "ab12c3", ab is repeated 12 times. No leading 0 is present in the frequency of substring.

The frequency of a repeated substring can also be in parts.
Example: "aaaabbbb" can also have "a2a2b3b1" as Encrypted String.
Try solving now
04
Round
Easy
HR Round
Duration30 minutes
Interview date10 Sep 2020
Coding problem1

It was late around 11:45 PM and I was all tired but excited as I was in the last round. The interviewer looked tired.

1. HR Round

Problem approach

Tip 1: Go through your resume, and make sure you know everything written in resume.
Tip 2: Be humble and listen to every question carefully and also inculcate knowledge of the cores subjects with answers
Tip 3: Always talk on the real-world problems and tell them how will you be able to contribute to the company.
Tip 4: Involve him in the conversation.

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 create a function in JavaScript?

Choose another skill to practice
Start a Discussion
Similar interview experiences
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
701 views
0 comments
0 upvotes
company logo
SWE Intern
3 rounds | 5 problems
Interviewed by Microsoft
541 views
0 comments
0 upvotes
company logo
SDE - 1
4 rounds | 7 problems
Interviewed by Microsoft
520 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SWE Intern
3 rounds | 4 problems
Interviewed by Google
855 views
0 comments
0 upvotes
company logo
SWE Intern
1 rounds | 2 problems
Interviewed by Google
814 views
0 comments
0 upvotes
company logo
SWE Intern
4 rounds | 6 problems
Interviewed by Dunzo
690 views
0 comments
0 upvotes