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

SDE - Intern

Microsoft
upvote
share-icon
2 rounds | 2 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 2 months
Topics: Binary trees concept, data structures and algorithms, stacks and queues, Arrays, databases questions, sorting,exception handling, multithreading, Inheritance, java collections, linked lists, Graphs, search trees
Tip
Tip

Tip 1 : Have more number of good projects than having many certifications 
Tip 2 : Practice more types of questions on coding
Tip 3 : Prepare by writing more mock tests

Application process
Where: Campus
Eligibility: Above 7.5 CGPS
Resume Tip
Resume tip

Tip 1 : Make it short and effective 
Tip 2 : Highlight your achievements

Interview rounds

01
Round
Medium
Online Coding Interview
Duration70 minutes
Interview date8 Oct 2020
Coding problem1

This was an MCQ and coding round. For MCQs this was the distribution : -

Apptitude ( 10 questions)
Maths (10 questions)
Coding Fundamentals (10 questions)

1. DBMS

Given 100s of databases with random values. Each one may consist of millions of records and each one has infinite storage. We need to sort these databases globally. After sorting, any database can consist of any number of records (even allowed to store all of it in one database). Find a good way of doing this at such a large scale (millions of records).

Problem approach

My immediate response was to do an external merge-sort. This solution is correct but not at all optimal for our scenario. Then he asked to think a bit more. After a while, I told him that we need to create horizontal partitions of the distributed database (basically sharding, he wanted to hear the word sharding). 

After saying this, I knew that I was going in the right direction and just had to find a good way to partition the data (finding the pivot points for bucketing).

02
Round
Hard
Online Coding Interview
Duration60 minutes
Interview date15 Oct 2020
Coding problem1

This was also an MCQ and coding test. 30 MCQs were asked

1. Validate BST

Moderate
25m average time
70% success
0/80
Asked in companies
IBMAmazonMicrosoft

Given a binary tree with N number of nodes, check if that input tree is Partial BST (Binary Search Tree) or not. If yes, return true, return false otherwise.

A binary search tree (BST) is said to be a Partial BST if it follows the following properties.

• The left subtree of a node contains only nodes with data less than and equal to the node’s data.
• The right subtree of a node contains only nodes with data greater than and equal to the node’s data.
• Both the left and right subtrees must also be partial binary search trees.
Example:

Input:

BST1

Answer:

Level 1: 

All the nodes in the left subtree of 4 (2, 1, 3) are smaller 
than 4, all the nodes in the right subtree of the 4 (5) are 
larger than 4.

Level 2 :

For node 2:
All the nodes in the left subtree of 2 (1) are smaller than 
2, all the nodes in the right subtree of the 2 (3) are larger than 2.
For node 5:
The left and right subtree for node 5 is empty.

Level 3:

For node 1:
The left and right subtree for node 1 are empty.
For node 3:
The left and right subtree for node 3 are empty.
Because all the nodes follow the property of a Partial binary 
search tree, the above tree is a Partial binary search tree.
Problem approach

The solution is* to maintain just the stack top rather than the complete stack. Instead, I went towards a mini-maxing solution (takes O(n) space as well) at the time. Anyway, he told me the solution and then said that his next question was about mini-maxing that I just gave the solution to. This was supposed to be a very easy question and I messed it up.

Try solving now

Here's your problem of the day

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

Skill covered: Programming

Which SQL keyword removes duplicate records from a result set?

Choose another skill to practice
Similar interview experiences
company logo
SDE - Intern
3 rounds | 8 problems
Interviewed by Microsoft
1770 views
2 comments
0 upvotes
company logo
SDE - Intern
3 rounds | 6 problems
Interviewed by Microsoft
1051 views
0 comments
0 upvotes
company logo
SDE - Intern
2 rounds | 5 problems
Interviewed by Microsoft
1581 views
0 comments
0 upvotes
company logo
SDE - Intern
2 rounds | 4 problems
Interviewed by Microsoft
237 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - Intern
3 rounds | 6 problems
Interviewed by Amazon
13918 views
4 comments
0 upvotes
company logo
SDE - Intern
2 rounds | 4 problems
Interviewed by Amazon
9230 views
2 comments
0 upvotes
company logo
SDE - Intern
3 rounds | 4 problems
Interviewed by Amazon
6078 views
3 comments
0 upvotes