Microsoft Interview Experience Set 127 | (On-Campus for IDC)

Platform –
Duration – 75 minutes
Format – 3 Coding Questions
Maximum Score – 10 marks
About 120 students appeared for this test. Questions were random and all students had different sets with a few overlapping questions.

1. Complete the following function-

 int findMax(TreeNode arr[], int size_of_array){
    // code goes here

Where TreeNode is a structure defined as:

struct TreeNode{
   int feet;
   int inches;

The function was supposed to return the maximum value of TreeNode. This was supposed to be done by calculating (12*feet+inches) for each element. It constituted of 2 marks.

2. Complete the following function-

Node * findIntersection( Node* head1, Node*head2){
   // code goes here

Where ‘Node’ is the structure of a linked list node defined as:

struct Node{
  int data;
  struct Node *next;

The code was supposed to recursively find the intersection between 2 linked list(already sorted) with a condition that no extra space is to be used. This question was for 3 marks.


3. Complete the following function-

Node * alternateReverse( Node* head1, Node*head2){
   // code goes here

Where ‘Node’ is the structure of a linked list node defined as:

struct Node{
  int data;
  struct Node *next;

alternateReverse() must remove the even number nodes from the linked list and append them to the end in reverse order. No extra space was allowed. It was for 5 marks.



Around 40 students were shortlisted for this round. This was a pen-paper based test. The candidates were roughly divided into a group of 4-5 and a mentor was in charge of each group. We were given a question and we were asked to write a function-solution in any high-level language (scripting languages like Ruby, PHP, Python were not allowed). We were allotted maximum 45 minutes.

Question-Given two character arrays(not strings) of the same length, and their length as a parameter to the function. We have to find whether the first string is a rotation of the other. We should not use any extra space. The time complexity may be quadratic.

The mentor kept coming to everyone. He first asked what I was thinking. I told him the approach with an example and then wrote my code down. The mentors were helping and motivating. They demanded code only.

Around 25 students were selected for this round.
The interviewer introduced herself and then asked me to tell her about myself. Then she asked me to find longest common prefix from an array of strings. We discussed an approach and then I had to code it down. She also asked me about the time complexity and then asked me to optimise it. I gave another approach and then she asked me to code it and give the time complexity. We optimised the solution further with a new approach and I coded it too. The interviewer was satisfied.
She, in the end, asked me if I had any questions for her? I asked her a question. The interview went on for about 1hr 10mins.

The interviewer introduced him and then I did. He gave me 2 questions-

He asked me if I had any questions for him? I asked him one too. The interview went on for about 45 mins.

The interviewer has 20+ years of experience in Microsoft. He introduced himself and asked me if I had any questions for him. We then discussed Achievements and Positions of Responsibility from my resume for about 20 mins.

  • He then asked me to implement Akinator game. We discussed on how would we start, what will be the problems, what will the database be like, how to choose next question, why to choose it, etc. The discussion went on for about 30mins. He initially mentioned that there was no right or wrong answer to the question and he wanted to just see how my thought-process worked. We both were discussing and thinking out loud. Akinator
  • Then he asked me a puzzle. If I have 10 balls and 1 has somewhat lesser weight and I have a weight balance, what is the minimum number of comparisons required to find the “bad ball”? We discussed the solution for 10 balls and then for 9 balls. I was then supposed to generalise the solution.

The interview went on for about 1hr. They announced the result the next day and selected 5 students.

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

Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.

Write your Interview Experience or mail it to

My Personal Notes arrow_drop_up