Code360 powered by Coding Ninjas X Naukri.com. Code360 powered by Coding
Ninjas X Naukri.com

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

Microsoft

4 rounds | 9 Coding
problems

Application story

For any off campus application, I'd suggest getting a referral first before applying.

Preparation

Duration: 4 months

Topics: Data Structures - Arrays, Strings, Linked List, Trees, Binary Search Tree, Graph, Tries, Fenwick Trees, Segment Trees, Hashmap. Algorithms - Recursion, Ad Hoc, Dynamic Programming, Greedy, Binary Search, Breadth-first search, Depth-first search, Sorting .

Tip

Just be confident during interview and if you are stuck in between any question, then ask for a hint from the interviewer. The practice is key for success, so practice hard for Data Structures and Algorithms coding problems on Coding ninjas as it is the best platform for coding.

Application process

Where: Campus

Eligibility: 7 CGPA

Resume tip

Mention all internships which you have done, as it increases your chances of shortlisting your resume. Also just write that skills which you are pretty confident about.

01

Round

Easy

Online Coding Test

Duration90 minutes

Interview date28 Nov 2019

Coding problem3

This round was the online coding test conducted on the platform Mettl. The languages allowed were C, C++, Java and Python. There were three questions. One was of graphs (**Depth-first search**), other was a big integer problem and the third was a string problem.

Problem approach

- I use recursion to solve this problem, and assigned color to each node and check at last whether it is giving safe configuration or not that is all nodes are of red and blue color and adjacent nodes have not the same color.

You are given an array consisting of 'N' integers. You have to find the fourth largest element present in the array.

Problem approach

- I take both numbers in strings and use school mathematics concept of sum and carry to solve this problem, also my friend solved this question in python without using string concept.

Problem approach

- I simply use string traversal and hashing to solve this problem.

02

Round

Easy

Coding Test - Pen and paper

Duration60 minutes

Interview date28 Nov 2019

Coding problem2

This was a pen and paper subjective interview round. You were expected to write full code on paper. Make sure you use proper names for the variables and write comments explaining very clearly what the code does. Also, try writing code in good handwriting which can be understood by the interviewer.

Given an array. Replace all the elements of the array with the product of all numbers except the number at that position. Do not use the division operator.

Problem approach

- Create two arrays called left and right. In the left store the product of all the numbers before the number at the current index. In the right store the product of all numbers after the number at the current index. And then just multiply left and right for each index. The interviewer was satisfied with this approach and asked me about the complexity of code and I tell him properly.

Find the total number of palindromic substrings in a given string.

Problem approach

- There can be odd palindromic substrings and even palindromic substrings. So for odd palindromic substrings, consider each letter in the string as the center and then expand the substring in left and right and check. For even, take two adjacent characters and expand the string left and right and check if there's a possibility of forming a palindrome. This was the most efficient solution to this problem, the interviewer asked me to dry run the code on a particular test case given by him and I did it properly, and he was impressed by the solution.

03

Round

Easy

Face to Face

Duration45 minutes

Interview date1 Dec 2019

Coding problem2

The interview took place in the morning and the interviewer was very friendly.

Problem approach

- Firstly I gave him a brute force approach, then he asked me to give an optimal solution so I gave him an enhanced merge-sort solution.

Problem approach

I use tree traversal to solve this question with recursion. Do a traversal of the given tree. In the traversal, replace the value of the current node, with the sum of the values of left and right node (if they exist). Recursively follow for left and right node. And in the end, return the preorder of tree. He was satisfied with the approach.

04

Round

Easy

HR Round

Duration30 minutes

Interview date1 Dec 2019

Coding problem2

The HR Interview round was held in the morning and it was right after my technical interview.

Problem approach

- I introduced myself, my name, branch, the reason why I was interested in computer science and Microsoft.

Problem approach

- The reason why I believed I was a good fit for the company was that I understood that Microsoft has been around for a very long time and despite that, it is still one of the top companies. For a company to stand that tall for that long, there must be something that they're doing right. I understand this factor is what makes them different from the rest and that's why I'd be a great fit for this company. I didn't talk about myself. Instead, I made them realize that I fully understood what this company demands from me. So HR was satisfied by my all answers.

Here's your problem of the day

Solving this problem will increase your chance to get selected in this company

Which is a DDL command in SQL?

Choose another skill to practice

Start a Discussion

Similar interview experiences

SDE - 1

5 rounds | 15 problems

Interviewed by Microsoft

1858 views

0 comments

0 upvotes

SDE - 1

5 rounds | 7 problems

Interviewed by Microsoft

1270 views

0 comments

0 upvotes

SDE - 1

1 rounds | 2 problems

Interviewed by Microsoft

5988 views

0 comments

0 upvotes

SDE - 1

4 rounds | 7 problems

Interviewed by Microsoft

419 views

0 comments

0 upvotes

Companies with similar interview experiences

SDE - 1

5 rounds | 12 problems

Interviewed by Amazon

104482 views

24 comments

0 upvotes

SDE - 1

3 rounds | 7 problems

Interviewed by Amazon

30953 views

6 comments

0 upvotes

SDE - 1

3 rounds | 11 problems

Interviewed by Amazon

20454 views

3 comments

0 upvotes