# Microsoft Interview | Set 2

Please find the details of my Microsoft Interview below.

**Date Of Interview:** 3rd August,2012

**No. of Rounds:** 2 online exams + 4 rounds of PI

**Type of Interview:** Campus Interview for freshers

**1st Online Test:** Time 1 hour

30 MCQs on basic Mathematical and Logical problems and 20 MCQs on C programming.

**2nd Online Test:** Time 1 hour

3 programs were to be written. They wanted full length program, not just the functions. Language: C/C++

- Given the head pointer of a linked list, each node having data value only 0/1/2, properly sort the linked list and return the head pointer.
- Given a picture with pixels arranged in an N*N matrix, right rotate the picture by 90 degree.
- Two of the nodes of a BST are swapped. Correct the BST.

**Interview Round 1: **Time 30-40 minutes.

- Given a Binary tree, where each node has also its parent pointer pointing to its parent, apart from two usual child pointers. Write the function for inorder successor. Discuss all possible test cases for this function and whether your function can handle all those test cases.
- How can you check whether a binary tree is BST or not, in the most space optimised manner.

**Interview Round 2:** Time 30-40 minutes.

- Given two sorted linked list, create a third list which contains only those elements of first list, which are not common with second list. Do this with O(n) time. Discuss all possible test cases for this function and whether your function can handle all those test cases.

**Interview Round 3:** Time 30-40 minutes.

- If your friend writes a text editor software and gives it to you for testing, what are the tests you will perform on the software to ensure it meets the basic requirements of a naive user
- Given two linked lists, how do you check whether the two lists intersect at some node with O(n) time? Discuss all possible test cases for this function and whether your function can handle all those test cases.

**Interview Round 4:** Time 30-40 minutes.

- Given an array of unsorted integers, find all the pairs of numbers which sum to a given N. Discuss all possible test cases for this function and whether your function can handle all those test cases.
- Given three points a, b and c, write a function to find what type of triangle they construct or whether a triangle can be made at all. Discuss all possible test cases for this function and whether your function can handle all those test cases.

**HIRED!! ðŸ™‚**

This article is compiled by **Shreyasee Nandy**. Many Many congratulations to Shreyasee.

If you like GeeksforGeeks and would like to contribute, you can also write an article and mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

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**, **Amazon**. **Google** , **E-Litmus** and **Microsoft** Test Serieses.