Skip to content
Related Articles

Related Articles

Improve Article

Microsoft Interview | Set 7

  • Difficulty Level : Medium
  • Last Updated : 10 Jan, 2019

Recently I attended Microsoft Campus Interview and got selected. Below is my Interview Experience and I just wanna share it to GeeksforGeeks viewers.

1st Round:
Online Aptitude test:
Aptitude, logical questions and subjective Questions

2nd Round:
Online test
In this round we are asked to type the code in notepad and send (no compilers)

3rd Round:

    It started wih introduce yourself and he introduced himself to me. Then he asked me about my project and it gone to some stuffs related wih memory. He asked me how a program is stored in memory



  1. Write a program for beautificaion (proper indentation) of a program file in an IDE.
    ex:
    int main(){
    if(i10)
    prinf("Hi");else{};
    }else{}
    return 0;
    }

    You are provided with getToken() which returns a token
    ex: if(i>10) is a token
    int main() is a token
    {,} are tokens

    so output should be

    int main()
    {
       if(i10)
           printf("hi");
           else
           {
           }
       }
       else
       {
       }
       return 0;
    }
    

    void beautify(char* inputfile,char* outputfile)

    Give some testcases for the above program

  2. Write a program to find the diameter of a binary tree and then he wanted to extend it for m-ary tree.

4th Round:

  1. You are provided with a string which contains single byte as well as two byte characters. If a character is single byte char, it’s MSB is 0, if it’s a 2 byte char, it’s MSB is 1. Write a program to check whether the given string is palindrome or not.
    Test cases for above program.
  2. Write a program to print the n-nodes from tail of the linked list.
    Test cases for above program.

5th Round:

  1. Write a program to Validate an IPv4 Address.
    Write test cases for above program.
  2. Write a program to find all the possible paths from a starting point to dest point in a maze(2-D array).
    ex:    1 0 1 0
        1 1 1 1
        0 1 0 1
        0 0 1 1 

    If there is a block it’s represented by 0.
    If there is a path it’s represented by 1.

6th Round:(Final Round)

  1. Write a code for printing last n lines in a file (refer man page of tail command in linux). The file size may vary, it may be 1MB or it may be 100 GB.
    Give top 10 test cases for the above program

Many Many congratulations to Muniraj G. 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. GoogleE-Litmus and Microsoft Test Serieses.

My Personal Notes arrow_drop_up
Recommended Articles
Page :