What We Are Learn On This Post

## Microsoft Gurugram Testing Interview Questions 27/11/2018

- Tell me about your working profile.
- Entry & exit criteria of user acceptance test plan.
- Difference b/w issue and error
- Have you done non-functional testing, explain?
- Difference b/w normal select query and stored procedure
- We have infinite Red, Green, Blue balls in a bag, 3 balls are picked at random, what is the probability of finding 1Red, 1Green, 1blue ball?
- What is the Max rows allowed for a table in oracle database
- Different types of indexes
- WAP to reverse the string “I love my India” to “India my love I”
- Types of integration testing?
- Pros and cons of top-down integration testing.
- What is Non-functional testing?

## Microsoft Developer Interview Questions

15 MCQs on c/c++ output based, 1 java questions were also there.

F2F Interview

**Round 1:**

- The interviewer first discussed my projects, especially my data mining project.
- Convert a Binary Tree to Doubly Link List in place?

**Round 2:**

- One DBMS query select 2nd max salary from a table,
- OS questions from deadlock, synchronization, scheduling, the difference between process and thread.
- What happens when you type URL in a browser and hit enter? Explain in detail.

**Round 3:**

There is a constant flow of numbers coming in from some infinite list of numbers, out of which you need to maintain a data structure to return the top 100 numbers at any given point of time. Assume all the numbers are integer numbers only.

I gave him a solution using a min-heap. We can create a min-heap of 100 elements. The first 100 elements are easy to handle. Let’s say we get the 101st element in the list. If this number is less than the root of the binary heap, then we need not do anything. If this number is greater then the root of the binary heap, then we need to replace the root element with this element and call a percolate-down procedure on the root of the binary heap.

My interviewer concluded my interview with this question.

Company: Microsoft

Campus: NIT Trichi

Interview Type: Campus Placement

Eligibility criteria : >=7 Pointer Out of 10

Three Students got Selected here. I am sharing one of them.

Microsoft Experience:

- Group Fry: they asked the next greater permutation of a given number. Example: 123->132. And the proper code was asked!

**Round 1:**

- Tell about yourself: I spoke most of the part of my sixteen details, he was listening to everything.
- Next, he asked me about my project, which almost took 20 25 minutes in which I explained every bit of my project. It’s made in embedded c. Hence he can’t ask too many questions on that.
- He asked about my Second project on DBMS. I told It was a curriculum project, nothing else. He was satisfied.
- Then he asked me to check whether a given number is a power of two.
- I gave one approach of shifting bits of one and matching with a number. I forgot the ‘&’ style, but still, he was satisfied.
- He gave me a string “Today is Saturday” then I have to reverse it in words “yadoT si yadurtaS” I said I would check the in-between string spaces. He modified by including a special character in place of spaces. I said I would use ISALPHA() function to check whether the given index has character or symbol.
- He asked me about OOPS concept
- Then about abstraction and real-life example
- And he asked me about surrogate keys. I said I don’t know this key, but I know the foreign key, primary key, and other keys. He changed the question and asked me about foreign keys and Examples in real life.
- I said he is from Microsoft then he is a foreign key for the NITT table. He laughed and accepted it.
- He then gave a SQL query in which a table has got EMP_ID and HIRE_DATE, so you have to get the count of people hired according to the year. He was satisfied with SQL or C. I gave a SQL one and told him approach, I forgot the function to extract the year from a date, but still, he was satisfied with my approach.
- And then I asked anything to him, 1st round was done.

ADVICE: make the interviewer involve you, as even he told me a lot of things on his own, which I don’t ask.

**Round 2:**

- There she asked me about my project. I skipped the DBMS project and told 20 minutes continuously on my Embedded c project. She was satisfied.
- She asked me to check the loop in a linked list. Then she modified to remove the loop. I told fast-slow for detection and flag check for removal.

Advice: Discuss everything with an interviewer. Make him interested in you.

Then she gave two string and one more string, which was formed from the previous two. But the order remained the same. I have to check whether that third one is formed from the previous two or not and without changing order also?

Exa: abcd ghij gahibcdj

No code required. Discuss the algorithm only. I removed one corner case by anagram checking. Then I used the merging style to check. I have cracked right. She modified by making one string substring of another. I did it half part and rest of the part she told by herself.

She was very cold, and I enjoyed myself a lot in my interview. Then after that, she asked me to ask some questions.

Guys asking questions is important somehow as that increases your interaction with him. I said to her it was nice to talk to you. She said the same here. 😀 I was sent out after that (Don’t know y), and again called after the half-hour.

**Round 3:**

It was HR, no problem. He asked me why I want to be part of Microsoft and other usual stuff. No puzzles etc. Then finally, after 1 hour, I got selected.

PS: Luck matters with knowledge and communication with interviewer matters a lot

##### Read Also: Software Testing Interview Questions

Company: Microsoft

Branches : CS & IT

Interview Type: On-campus (Internship)

Interview Process: There were a total of 4 rounds.

**Round 1: (MCQ round )**

In this round, there were a total of 15 MCQ’s and the time allotted was 30 mins. The questions were mainly from C/C++/Java output finding, pointers and references, and basic puzzles. I was able to solve 12 + MCQs. I managed to qualify this round.

**Round 2: (ONLINE CODING ROUND)**

In this round, 2 coding questions were given to us, which need to be solved in 1hr time.

- You are given a matrix of dimensions m*n where each cell in the matrix can have values 0,1 or 2, which has the following meaning :

0: empty cell

1: cells have fresh oranges

2: cells have rotten oranges

So we have to determine what is the minimum time required so that all the oranges will be rotten.A rotten orange at index [i,j] can rot other fresh orange at indexes [i+1,j] ,[i,j+1] ,[i-1,j] ,[i,j-1]. If it is impossible to rot every orange then return -1;

- You are provided with a binary tree and given two integers n and k. You have to determine the sum of data of all the nodes which are at a distance of k from the node, which has data n. I managed to solve question no. 2 completely. Both are using BFS. Here is my way of how I did it:-

- Use BFS directly to traverse the array once and can obtain the solution in O(n^2) only.
- Form a graph out of the tree with the found node as the source point and then do BFS Sum to find the required answer.

**Round 3:**

- Find the third largest element in the array. I first gave him a heap solution(kth largest element in the array ). He asked me to write the code for it. Then he asked me to improve it. And then I gave him O(n) solution. He said that I should cover all the edge cases and left the room alone for 30 minutes. Then he came back, and he was satisfied with my solution and immediately said that wait for the 4th round.

**Round 4:**

- Mirror A Binary Tree.
- Given Two BinaryTrees, check if they are a mirror of each other.
- Level Order Traversal in a spiral form(Told me to code it)?

**Suggestions:**

- Strong Data Structures And Algorithms
- Focus On More Than One Solution Of The Question
- Stay calm and confident.

Company: Microsoft

Location: Hyderabad

College: PSIT

**Round 1 (Multiple choice questions)**

- The intersection of two linked lists.
- Given a sentence say, “these are twelve pens and thirty-two sheets,” convert this sentence to “these are 12 pens and 32 sheets”. We were asked to do it inline. The interviewer called each one of us and asked us to explain the approach.we were asked to minimize the space and time complexity.

**Round 2:**

- Given a linked list of moves of 2 players in a tic-tac-toe game. Find who has won the game.
- Given a client and a server and each of them has a queue in it. The client has to copy the contents of the queue to the server once the internet connection is up. The amount of data that it can copy at one go is fixed(Say 5 units). Design an approach for this. Let’s say the input queue is partitioned as 2MB,4MB,10MB,6MB, and the fixed size of the window is 5MB. The output queue also has the same partitions as the input queue. (He was testing how I can use operating systems concepts, designing approach and data structures together).

**Round 3:**

- I asked how to design a cache for DNS records. I have told different approaches like First-in-First-Out, less frequently used, least recently used… He asked me to tell the strategy and code it. I told LRU and implemented this.
- Discussion on projects. I had done a project on big data on frequent itemset.they were interested in each and every detail of the big data paradigm.

**Round 4:**

- There is a 3 million character string. you have to print the count of occurrence of each node. Do not jump on to the question. Wait for him to complete. I gave count sort PF O(n) solution, but he was focusing on a more optimized one.
- They are given a pile of 9 objects. 2 players take turns to pick 1, 2 or 3 objects. The last one to pick is the looser. What is the winning strategy? the winning strategy for 9 coins?

My tips are to stay cool and enjoy the interview. Carefully tell your weakness. Don’t worry about asking questions from the interviewer. Take proper use of the time. Focus on designing problems along with data structure.

Microsoft (Internship)

Branches Allowed: CSE, IT

Stipend : 35k / month

**Round 1:**

It was an online round conducted by cocubes. It had about 15 questions, and the time allotted was 30 minutes. Questions were multiple choice and were mainly from C language, aptitude, and PnC. There were few questions from OS, CSA as well in some sets.

**Round 2:**

This round was an online coding round.

Note: Only allowed language was C.

Duration: 1 hour

- Find the nth node of a linked list from the end.
- Given a string S and a pattern P, you need to find the number of occurrences of anagrams of pattern P in string S optimally.
- You need to write the function in C for both the questions.

**Round 3:**

This was a telephonic interview round.

The interview was scheduled at around 6:00 pm. It started with a brief intro by the interviewer, followed by mine. He then asked some behavioral questions. What are the products that I have used Microsoft? Why would I like to join Microsoft? He then asked me to rate myself on a scale of 10 in any of my favorite languages. Questions based on testing were asked, like how do you test your code for bugs.

He gave a scenario with details as follows:

Suppose you are given a tablet, and you need to explain you’re great grandfather the features of it so that he understands what you say and thinks it as a useful gadget. Assuming your grandfather has no idea about gadgets like mobile, computer, etc.

He also asked me to mention my strengths and weakness. No such algorithmic questions were asked in this round.

**Round 4:**

- This was the last round. It was a group coding round.

We were made to sit around a round table with paper and pencil, and the HR gave us two questions to code.

- Find the nth element in a Tribonacci (a variation of Fibonacci) series.

t(n)=t(n-1)+t(n-2)+t(n-3) - Given three sides of a triangle, find whether a triangle is right-angled, isosceles, equilateral, scalene.

Tips:

- Important topics: C language(Very important for 1st round), Trees, Linked List, String, Other data structure, Puzzles

The interviewer wanted a clean code with minimum cuts as possible. So I would suggest practice writing code on a piece of paper.

Company: Microsoft

I appeared in a Microsoft interview recently, and I would like to contribute to www.softwaretestingo.com. This website is very helpful for interview preparation.

Written Round: 60 minutes, 3 programs, no compiler; type and submit.

**Round 1:**

Initially, he started with a discussion of my final year project. After about 10 minutes of discussion, I think he concluded it was too early for me to know my project topic well. Since the area of my project is network security, the rest of the discussion revolved around it. He went into the details of cryptography and attacks like buffer overflow, asking me to assure him I knew what I was speaking (discuss those things orally, and occasionally write small snippets).

One particularly ridiculous part of this interview that I happen to remember was me having uttered the term ‘canary bit’, followed by him torturing me around it for about 10 minutes, he asked me what exactly it is, how I thought it could be implemented, if I could draw a rudimentary design of such a subsystem and all. The whole discussion went on for say 50 minutes or so.

- After that, he asked me about a problem.“Compress a text string in place”. Having seen the famous string expansion in place problem many times, I promptly said run-length encoding (i.e., compress aaaaaabbbbbccc to a6b5c3, for example). He asked me to code it and write a few test cases for it. The most important test case, in my opinion, is the following:

a -> a and not a1, i.e., for a single occurrence of a character, do not write its count – the reason being that the string, instead of getting compressed, gets expanded in that case. - You are given a binary search tree and a no. N in the tree, print the leftmost node at the same level as N.

**ROUND 2:**

This was a nice, pure problem-solving round. First, he asked me the famous “Tell me about yourself” and “How were your earlier rounds” questions. But they were just ice-breakers.

- WAP to print a matrix spirally. I told him I knew the problem, so he skipped it.
- Search for an element in a rotated sorted array (of course, in sublinear time!).
- Nice DP problem. Given an amount and an array containing possible coin denominations, determine the smallest no of coins in which the amount may be formed. Assume you have infinite units of each denomination.

**ROUND 3:**

This was the most enjoyable round. The interviewer was a final round specialist! First, he asked me about my internship, which I explained to him. He discussed it for hardly 10 minutes. Then he started his attack! (Yes, it felt like an attack – just like Ronnie O’Sullivan 😛

**There were three questions here:**

- Given a linked list, swap its nodes pairwise. A good test of pointer manipulation with many edges
- Given an array, bring all its distinct elements to the top in any order, the rest of the array is not

First, I suggested in O(n) space. Then he asked me to do it without extra space. I needed a sorted array for that, which he asked me to assume. The rest of it is based on swapping elements to bring the required elements to the top. - Given a matrix, find an element that max in its row and min in its col. The actual question (after I wrote the function) was whether there could be more than one such element in the matrix, assuming all elements are distinct. Wrote a small proof that there cannot. He asked for a formal proof “as I would write it in an exam”!

Finally, I got placed. I was on cloud 9. All the best. 😀

Thanks, Pratul S. Dube, for contributing to this article. If you would like to contribute, mail us your interview experience at softwaretestingo.com@gmail.com. We will like to publish it on Software Testingo and help other job seekers.

##### Check Also: Manual Test Cases For Testers

I recently have appeared for the Microsoft interview process. I want to share it with Softwaretestingo and help others. The following questions were asked during the interview.

**Round 1**

- Two numbers are stored in two linked lists, with one digit in each node. Add the numbers and return the resultant sum in a linked list. eg. if LL1= 2 > 3 > 5, LL2= 1>4>5, result should be LL3= 3>8>0
- Check the no of repeated occurrences of a substring in a string.
- Data compression: Given a string “aabbbccc,” save it as “a2b3c3”. Here, I was asked to write pseudocode, followed by code in C++, optimize it, and then all the test cases. E.g. “aabcc” would become “a2bc2” and not “a2b1c2”

**Round 2**

- Given a node in a binary tree, find the leftmost node in the same level.
- Find the nth largest number in a binary tree.
- Insert an element into a sorted circular linked list. (Consider all cases, inserting in the beginning, end, and middle).

**Round 3**

- Given 5 points in a plane, prove that there will be at least two points such that their midpoint is an integer.
- Given a room with points pertaining to different groups, check whether the connection is planar or nonplanar, i.e. while connecting all the points in the same group, the wires of different groups should not overlap.
- Find the nth power of a number in the shortest computational time.
- There is a roller which can have two types of woodblocks, 49 cm, and 50 cm. Given two sensors 50 cm apart, which call a function ring( ) whenever the sensor changes state, write the function ring( ) to calculate the number of blocks of both types.

**Round 4**

After 3 interviews, I was called for a final interview. He started by asking me about my best project and the drawbacks I faced in it. He asked about my internship and the working experience. This interview went on for more than an hour, with him grilling me on two questions and their test cases.

- Given a linked list, invert every two nodes in the list.Eg. Given a > b > c > d, the result should be b > a > d > c
- A file or a directory can be represented as a node. The node has properties like ID no, parent ID no, name, no of children( 0 for a file). The entire file structure is represented as a linked list of the nodes. The only thing known to us is that the parent directory will always come before the children in the LL. It need not come immediately before.We have to implement a GUI such that when I press on the + button next to the root directory, I see its children folders and files. The child directories have a + button next to them and can be expanded similarly. Write a pseudocode to implement this in minimum time and space. I suggested the use of a tree, wrote code to convert it to a tree. He wanted a better way of finding children from the parent, so I suggested a hash table comprising a hashing of the parent IDs to a LL of the children IDs.

He was satisfied with the answer.

Thanks, Tanvi. G. Nabar, for contributing to this article. If you would like to contribute, mail us your interview experience at softwaretestingo.com@gmail.com. We will like to publish it on www.softwaretestingo.com and help other job seekers.

##### Check Also: Java Programs For Testers

I appeared for MS interview for the developer profile recently. I want to contribute to Software Testingo by sharing my experience.

**Round 1**

- Two numbers are stored in two linked lists, with one digit in each node. Add the numbers and return the resultant sum in a linked list. eg. if LL1= 2 > 3 > 5, LL2= 1>4>5, result should be LL3= 3>8>0
- Check the no of repeated occurrences of a substring in a string.
- How the memory is structured (heap, stack, etc.). He wrote a program and asked which variables would be stored where etc. As I mentioned that I like Algorithms, he then went on to Algos.
- Data compression: Given a string “aabbbccc,” save it as “a2b3c3”. Here, I was asked to write pseudocode, followed by code in C++, optimize it, and then all the test cases. E.g. “aabcc” would become “a2bc2” and not “a2b1c2”

**Round 2**

This interview went on for about an hour.

- Given a node in a binary tree, find the leftmost node in the same level. I wrote the pseudocode and test cases.
- Find the nth largest number in a binary tree.

**Round 3**

- Given 5 points in a plane, prove that there will be at least two points such that their midpoint is an integer.
- Given a room with points pertaining to different groups, check whether the connection is planar or nonplanar, i.e. while connecting all the points in the same group, the wires of different groups should not overlap.
- Find the nth power of a number in the shortest computational time.
- There is a roller which can have two types of woodblocks, 49 cm, and 50 cm. Given two sensors 50 cm apart, which call a function ring( ) whenever the sensor changes state, write the function ring( ) to calculate the number of blocks of both types.

**Round 4:**

After three interviews, I was called for a final interview. He started by asking me about my best project and the drawbacks I faced in it. He asked about my internship and the working experience. This interview went on for more than an hour, with him grilling me on two questions and their test cases.

- Given a linked list, invert every two nodes in the list.Eg. Given a > b > c > d, the result should be b > a > d > c
- A file or a directory can be represented as a node. The node has properties like ID no, parent ID no, name, no of children( 0 for a file). The entire file structure is represented as a linked list of the nodes. The only thing known to us is that the parent directory will always come before the children in the LL. It need not come immediately before.We have to implement a GUI such that when I press on the + button next to the root directory, I see its children folders and files. The child directories have a + button next to them and can be expanded similarly. Write a pseudocode to implement this in minimum time and space. I suggested the use of a tree, wrote code to convert it to a tree. He wanted a better way of finding children from the parent, so I suggested a hash table comprising a hashing of the parent IDs to a LL of the children IDs. He was satisfied with the answer.

**Advice:**

- All interviews were mostly technical, and the interviewers were calm and patient, though they didn’t provide help as such. Be confident, but if you have no idea about a given question, mention that this is not your area of interest and see if they can ask another one.
- Even if you cannot find the exact code to a problem, it is fine because they are only looking at how intuitive you are with problem-solving.
- Don’t fit in your resume. They asked me a lot pertaining to my resume.
- Do data structures and operating systems properly. They did not ask me any database related questions.

Thanks, Sowmya P. Iyer, for contributing this article. If you would like to contribute, mail us your interview experience at softwaretestingo.com@gmail.com. We will like to publish it on Software Testingo and help other job seekers.

## Leave a Reply