Microsoft Interview | 12

Online Test:
MCQs: Mostly comprise the following types: find the output, definitions of basic C/C++ concepts.

Coding questions:

  1. Given a very large string, print the last ten lines.
  2. Do a level order traversal of a binary tree.

Interview Round 1:

  1. Find the output:




    void print()
      char str[20] = “hello world\0”;
      int i=0;
      while (str[i]!=’\0’)
        printf("%c", str[i]);
        str[i] = str[i-1];



    There was a very detailed discussion on this question for nearly twenty minutes. I think I kind of screwed this one. Basically, I had to explain how and why does a segmentation fault occurs.

  2. Suppose a linked list contains list of documents containing a particular word. You are given two such linked lists and you have to print names of all documents that contain both these words.
    [I gave an algorithm based on the assumption that the list contains document names in sorted order]. I was also asked to write the code regarding this. This operation can be classified as (A and B), where A and B are the words and they have lists associated with them. He then moved on to more complicated cases such as (A and B or C and (not D)). Brackets may or may not be presented. I was only asked to give an algorithm corresponding to this.
  3. What are the steps that occur when you send an E-Mail. A detailed discussion was done regarding this wherein we also discussed about the layers of the OSI model, the protocol used for sending E-Mail, the layer to which it belongs to.

This article is compiled by Vikram Goyal. If you like GeeksforGeeks and would like to contribute, you can also write an article and mail your article to See your article appearing on the GeeksforGeeks main page and help other Geeks.

Write your Interview Experience or mail it to

My Personal Notes arrow_drop_up
Article Tags :
Practice Tags :

Be the First to upvote.

Please write to us at to report any issue with the above content.