Related Articles

# Microsoft Interview Experience (On-Campus for Internship)

• Difficulty Level : Medium
• Last Updated : 18 Dec, 2018

Online Coding Round:

It was conducted on Cocubes. There were 3 questions to be solved in 75 mins. My questions were:

1.  Given a character array, find the average of ascii characters in the array. Ex:- i/p = ab12, o/p = 73.5   (2 marks)
2.  Evaluation of a given infix expression(as character array). Ex:- i/p = 4-5*14/7+2, o/p = -4  (3 marks)
3.  Find the lowest number possible by removing k digit from a given number. Ex:- i/p = 4312389, k=3, o/p = 1238  (5 marks)

Out of 200 students, approximately 60-65 where selected for pen & paper round. Gettting more than 5 marks was enough for clearing this round. Regarding cocubes, it is a simple ide where one can only test the code for compilation error and few basic test cases. We where not able to run the code for custom test-cases, but you can certainly modify the input string for checking.

Pen & paper round:

This round consisted of 7 short questions(based on C lang.) of 3 marks each and one coding question of 6 mark. The coding question was Detecting and Removing Loop from a Linked List. All the questions where compulsory. Around 24 students moved forward for face-to-face personal interviews.

Round 1:

Interviewer went through my cv and asked some question from OOPs, like what are virtual functions and destructors, and difference between new and malloc. Then how to deallocate memory and what happens for the combination of :- (new and free) and (malloc and delete). Then he asked me 2 coding questions:

1. Given a Binary Search Tree, convert it into a Doubly Linked List. He asked me to write some test cases.
2. Given a row-wise sorted n*n matrix, Print the elements of matrix in non-decreasing order. Space complexity of O(n) was allowed. I used min-heap to solve it.

For the questions try to 1st tell your approach and use test cases to dry run your approach. Then move to writing code, when asked.

Round 2: