Open In App

Microsoft Interview Experience | Set 176 (On-Campus)

Last Updated : 08 Aug, 2018
Like Article

Round 1(Coding Test):
It was a coding test which was held on cocubes platform. 3 problems were given of varying marks:

2 marks: Given a number, we need to find the nearest multiple of 10 of it. The rules were as follows: 1. If the unit’s digit is less than 5 return the nearest multiple of 10 smaller than the given number and if it is greater than or equal to 5, return the nearest multiple of 10 greater than the given number.
This question was really easy to solve. Just simple implementation by using modulo operation.

3 marks: Given a number n, we need to return the number of possible binary strings of size n where there are no consecutive ones in it.
This is quite a popular dynamic programming questions for interviews. GeeksForGeeks has a solution for it. Link:

5 marks: Given a linked list and two integers M and N. Traverse the linked list such that you retain M nodes then delete next N nodes, continue the same till end of the linked list. This was quite easy. GeeksForGeeks has a solution to it. Link:

50 students were selected after this round.

Round 2(GroupFly Round):
It was a pen and paper round. We need to solve the problem given to us on paper and explain our approach to the mentors who were near us. Problem given to solve: Print all the paths in a binary search tree with a given sum. This was easily solvable using stacks or vectors and having the concept of recursion and inorder traversal of a tree. Tips to crack this round: 1. Write well. Good handwriting matters to some extent.
2. Write the approach first and comment your code well.
3. Atlast write the time complexity and space complexity of the solution you wrote. All these really matters to an extent.

24 students were selected for the next round.
Round 3(Technical Interview):
This was held in skype. The first half an hour discussion was entirely based on the projects and internships I worked
upon. She asked me about the detailed explanation of the Research Project I did at IIT Kharagpur and also about the Machine Learning Internship I did at Acadview. After that she asked two coding questions: They were:
1.Given a sorted array of decimal numbers we need to find a decimal number x in it. She asked me to reduce the number of comparisons in it. I was really confused as what to do better than logn approach of binary search. I told her many cases:
When the elements can be repeated we need to find the first and last index.
She said she need further optimization. I was really confused what to say.
I then said what if the number of elements are large then to reduce overflow we need to calculate mid in other way to avoid overflow issues. Then I told her the answer she was looking for. If the element to be found is greater than the maximum number in the array we just needed to return false. I know this was naive but this was what she was looking for. 😛

2. Given a linked list, you need to detect whether there exists a loop in a linked list or not. She asked me not to approach it with the famous hare and tortoise method, stack method or hashing method but to modify the structure of the linked list in such a way and use as little extra memory in the node’s structure possible to detect the loop in a single traversal. For this I used a boolean variable in the node’s structure and manipulated it during traversal to find the loop.
She was impressed by my approach and seemed satisfied after she looked at my code. She then asked me to wait for the next round.

Round 4(Technical Interview):
This was a F2F round.
He first asked me to introduce myself and then asked me about my internship. He then asked me a question:

Given a set of integers, the task is to divide it into two sets S1 and S2 such that the absolute difference between their sums is minimum. This really took time to explain my approach to the interviewer. I first started from the recursive approach and then went on with the bottom up DP solution to the problem. He was really asking me a lot of questions on my approach and was giving me test cases to validate my approach. He was satisfied with my approach finally.
GeeksForGeeks has a solution to it. Link:

Then he started asking me questions from Object Oriented Programming. The questions were:
1. Explain inline functions. Why do we use it?And what does the compiler do when it sees the word inline? When can an inline function be disadvantageous?
2. Explain abstract classes. What if a pure virtual function is not defined in the derived class?
3. The famous diamond problem using virtual base class. He then went on with Database Management Systems. The questions were:
1. Explain the workflow of databases. From Software Resource Specification to normalization. He just asked me about the steps.
2. Next he asked me about all forms of normalization and we had a detailed discussion on it. He was asking me a lot of questions on BCNF.
Next he shifted to system design:
Given a shopping site like flipkart or amazon, you need to design the payment portal page and
how you would validate the information you entered.
He gave me three different categories of payment:
1. Debit Card
2. Credit Card.
3. Net Banking.
Also he asked me to say each and every test methods that I will use to test the page. We had a detailed discussion on it. Net banking part was the most challenging part. He then asked some HR Questions which I aced through easily.

Round 5(Technical cum HR):

The interviewer first asked me about the summer Internship I did at IIT Kharagpur. He was asking in-depth questions from it. He really knew about the noise models and the networks I used.
He then asked me about my Machine Learning Internship and gave a real world problem to solve it with any algorithm I know.
Given our College Portal, how will I display the top trending news in twitter of all categories. I used K-Means Clustering to solve the problem. He then asked me about how it works and I explained him the centroid shifting method.
He didn’t give any reaction..:P

He then shifted to Operating Systems:
What is a semaphore? Is it a variable or a function? How are its atomic operations defined? How is it used to solve critical section problem? How is it used to maintain the order of execution of processes?
I gave him the required answers. He seemed satisfied. He then asked a question:
Rotate a N*N matrix clockwise.
This was easy for me and I explained him the transpose and reverse rows approach. He was satisfied with my approach.
He again shifted to system design:
He asked me to design a URL Shortenener like tiny URL.
I really struggled a lot with this as I haven’t studied system design well but I gave him the hashing and encoding method and trying to approach it with it. He again gave neutral expressions..:P
Finally he asked me about my family background. About my hobbies and the accolades I won in it. And then asked the common HR questions like What’s your career objective? Why Microsoft? and all.
I was then asked to wait.
Finally 10 students were selected and I was one among them. It really was the most amazing day of my life. 🙂

Previous Article
Next Article

Similar Reads

Microsoft Interview experience | Set 117 (Off-Campus)
I applied off campus for Microsoft Software Engineer position through CoCubes.The selection procedure involved a coding round, group fly followed by 3 interviews. Round 1 This round had 3 questions and was hosted on cocubes.We had 75 mins to code. 1) Given an array containing integers, zero is considered an invalid number and rest all other numbers
4 min read
Microsoft Interview experience | Set 118 (On-Campus for IDC)
Around 100 applied for the first round of Microsoft Internship offer. Basic Criteria was to have a CGPA of greater than 7.00. Round 1: Three questions were given to everyone. First had a weightage of five marks and remaining two were ten marks. Cocubes conducted this round. Results were announced after 5 days. Question 1 : Given an array of integer
5 min read
Microsoft Interview experience | Set 121 (On-Campus for Internship)
Round 1: We were given 3 coding questions.There were many different sets.Most questions were implementation based.Some of them were based on data structure like linklist and bst. They were:- Inorder successor of given node in bst merge two sorted linklist in reverse order longest increasing subsequence Top 45 were selected after this round; from wh
2 min read
Microsoft Interview experience | Set 122 (Off-Campus)
Round 1 – Co Cubes Online Test(75 min) - 1-) Given a Array for Strings in Sorted Order with null strings in between and a Target String, find wheather the target string is present or not. e.g. - arr[] = {"","","abc","","","","bcd","ef","","xyz",""}; Target = "xyz"; 2-) Given a Binary Tree and a target integer. If a leaf node is present with that in
3 min read
Microsoft Interview experience | Set 123 (Off-Campus)
Round 1 Online test on CoCubes contains 3 Coding Questions (Only Function to complete) Given a number N find the binary conversation of node is palindrome or not if yes return set bit in that number else return -1. Using of extra space is not allowed Example - if n = 7 Answer: 3 Given an array and a number x find the numbers of pairs of numbers of
2 min read
Microsoft Interview experience | Set 126 (On-Campus for Internship)
Written Test: I am not going to say questions were very easy. Its totally depend on you. So I just want to tell you the type of questions. For doing really best, you should have good knowledge of linked list implementation of the binary tree, BST and some thing related with it. Nothing was random there, I can guarantee it. If you have not good prac
4 min read
Microsoft Interview Experience Set 128 | (On-Campus for Internship)
Coding Test Platform: CoCubes Format: 3 coding questions Time: 75 minutes They had a pool of questions and three questions(2 + 3 + 5 marks) were given to each student randomly. Given an array A of size m and another array B of size n. Return the product of maximum of A and minimum of B. (2 marks) Given an integer N and an integer M, output a number
3 min read
Microsoft Interview Experience | Set 133 (On-Campus for Internship)
Online coding Round 410 students appeared for the online coding round and cgpa cut off was 7. Three coding questions were asked to us and we were given 90 minutes to solve three questions. 1. We were given an array. Values of the array were memory sizes and the memory that is required by the system can only be represented in powers of 2. We had to
4 min read
Microsoft Interview Experience | Set 134 (On-Campus for Internship)
First round was a 75 minutes online round in which 3 simple questions were asked. First question was given two numbers n,m find a number closest to n and divisible by m. Second question was given a string consisting of only 0,1,A,B,C where A=AND B=OR and C= XOR. Calculate the value of the string moving from left to right assuming no order of preced
2 min read
Microsoft Interview Experience | Set 138 (Off-Campus)
Hi all, I recently gave an interview at Microsoft for a particular team. I got this opportunity via referral. There were around 30 people who came for the interview process, some were experienced and some were freshers like me. As there were around 30 people, no written round or group fly was taken. Now coming to the interview process, I went throu
3 min read
Article Tags :
Practice Tags :