Microsoft Interview | Set 7
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
- 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 tokensso 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
- Write a program to find the diameter of a binary tree and then he wanted to extend it for m-ary tree.
4th Round:
- 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. - Write a program to print the n-nodes from tail of the linked list.
Test cases for above program.
5th Round:
- Write a program to Validate an IPv4 Address.
Write test cases for above program. - 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)
- 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.
Please Login to comment...