Skip to content
Related Articles

Related Articles

Improve Article

Microsoft Interview Experience | Set 169 (SDE 2 for 3.5 years experience)

  • Difficulty Level : Medium
  • Last Updated : 18 Dec, 2018

1st round(online coding):

  1. Given an array that contains both positive and negative integers, find the product of the maximum product subarray.
  2. Sort an almost sorted array where only two elements are swapped.
  3. Given an integer value and a pointer to the head of the linked list, delete all the nodes from the list that are greater than the specified value.

2nd Round(DSA) :

  1. Find median of BST. BST can have duplicates as well. Had to write production level code using recursion and backtracking both. I told him various approaches. However, he was looking for the median in one scan only using two pointers.

3rd Round(DSA):

  1. Introduction and detailed project discussion.
  2. Find the majority element in an array. The majority element is the element that occurs more than half of the size of the array. We discussed various approaches and finally had to write working code for one of them.
  3. Left View of a Binary Tree. Working code was required and some questions from the code. Like, why you used static variable and how will you do it without using any static and global variables.
  4. Some questions from pointer, like,

Structure of linked list is :

struct node{
     int val;
     node *next;
}

So, what will happen if you remove * from node *next.
And some more deep questions from pointers.



4th Round(Design).

  1. Design a real-time URL spam filtering service. We have information about billions of URLs whether they are spam or no. We need to come up with an architecture solution to store all the URLs and retrieve the information in minimum latency. There were some constraints, like, you have been given a very small memory. So, you can load only a few URLs in memory for the query.
  2. Implement your own malloc and free for application x, which should control the heap memory usage of the application x. Discussed various approaches for assigning memory for a request.

5th Round(HR)

  1. Project discussion and some behavioral questions.
  2. Any offer in hand?

6th Round(Hiring manager):

  1. Introduction.
  2. Detailed discussion of recent project.
  3. Some behavioural questions.
  4. Given preorder traversal of a binary search tree, construct the BST. Full working code was required.
  5. Given events, like, switch on, switch off, pull chair. Design an architecture to count the number of events in given time frame. Time frame can be minutes, hour or day.

Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more, please refer Complete Interview Preparation Course. In case you are prepared, test your skills using TCS, Wipro, AmazonGoogle and Microsoft Test Serieses.

My Personal Notes arrow_drop_up
Recommended Articles
Page :