# Microsoft Interview Experience (For Summer 2019 Internship)

Microsoft came to IIIT Hyderabad for on campus internships. The company visited for 2 profiles: SWE and Data Scientist.

**First Round(Online Coding Round)**

For the role of SWE, there was a usual coding round on cocubes. We had 75 minutes to solve 3 coding questions. The questions were as follows:

- Minimum character to be appended to the string to make the string a palindrome.(Appending the characters at end of string only) You need to print the character required to be appended at the end. (Similar to this : Minimum number of Appends needed to make a string palindrome – GeeksforGeeks)
- You are given a 2D character matrix and you need to find in how many ways a given word in present in the matrix, final count needs to be returned. While finding the words in the matrix, one can form words using adjacent cells only.
- A string/word was given as input and you need to find its rank in the dictionary.(Lexicographic rank of a string with duplicate characters – GeeksforGeeks)The test cases weren’t good enough that you can guess whether to include the duplicate character strings and not. I have provided the link which takes into account the duplicate characters also.

**Second Round(For those who applied for ML/Data Scientist profile too)**

It was a MCQ test. 49 questions, marking: +4 for correct and -1 for wrong answer. The time given was 75 minutes. The test included questions on probability, Machine learning algorithms like SVM, gradient descent, Collaborative Filtering/Content Based filtering, neural nets and many more.I got shortlisted for ML/Data Scientist Profile. Total around 65 students out of nearly 200(not sure of exact number can be less or more) were shortlisted for both the profiles. 25 for ML and rest for SWE.

**Third Round(Group Fly)**

We were divided in groups of 10 for the round. It was 1 hour round. We need to write codes for 2 questions on the paper and submit to the mentors alloted to each group. Questions were:

- Find the largest substring in the given string which is a palindrome(Longest Palindromic Substring | Set 2 – GeeksforGeeks).
- Traverse a matrix in spiral order(Print a given matrix in spiral form – GeeksforGeeks).

After this round, 30 got shortlisted for next round.

**Fourth Round(Interview 1, at max 45 mins – 1 hour)**

The round started with my introduction to the interviewer. She was really nice. Then she asked me about some questions on my honors project, followed by a coding question. I need to write the full code.

- The question was: Given an array of size n, I need to rotate it by m positions.(Program for array rotation – GeeksforGeeks) I need to give the most optimal approach that is inplace with minimal extra memory.
- In second question, I need to allocate memory for a 3D array of size m*n*o. Need to do it through pointer and malloc.
- Suggest some test cases(edge/corner) for the the first question of array rotation.

After this round, 21 people were shortlisted for 2nd round.

**Fifth Round(Interview 2, at max 1–1:15 hrs)**

This time the interview started with direct coding questions. The questions were:

- Find median for running stream of numbers. Also, asked if the AVL trees can be used for the purpose instead of heaps.(Median of Stream of Running Integers using STL – GeeksforGeeks) Again I need to write the code in paper for that.
- This was a DP question. Given a 2*1 small slab, I need to find out ways to fill a bigger 2*t slab(Similar to : Tiling Problem – GeeksforGeeks). Some other question got built upon it:
- Number of ways in which the bigger slab can be filled symmetrically.
- Number of ways in which the bigger slab can be filled asymmetrically. Can’t just tell that its total-symmetric, need to get a recursive relation 😛 .
- He asked the time complexity in the end, which was O(n) for the solution suggested, he helped me out to get the solution.

After this round 15–16 made it to the final round.

**Sixth Round(Interview 3, at max 1hour-1:30hr)**

In this round, only one questions was asked. It was that: Given a final tic-tac-toe board, I need to tell that whether its valid or not. You can’t assume anything that x plays first. If for any one of the cases, that is if ‘x’ plays first or ‘o’ plays first, if the board is valid, the answer should be valid. I need to write the full code for this on paper.Within next 15–20 minutes we got the results. I got selected for ML/Data scientist role. In all 5(including me) for ML and 10 for SWE role made it to the internship. It was one of the happiest moment of my life.

**Some tips for coding round:**

Especially for MS, the coding round is on cocubes, so the site doesn’t run your code on all the test cases. Be sure that you write the most efficient code possible. Some of my friends who solved even 2 didn’t get selected, as their code might have failed the final test cases.For the MCQ round, attempt all if you aren’t able to do any or many.

**Some tips for interview rounds:**

- Be confident in whatever you answer. Even if you know that the answer is not fully correct, don’t be like you can tell the interviewer as it is not completely correct.
- If you get stuck sometime, ask interviewer about whether your approach is correct or not.
- Keep talking with the interviewer during the whole process, don’t be into yourself. For every line of code written by you on paper explain why you are doing that.

Thanks to geeksforgeeks team for putting such good content on website. I would advice to go through problems on website as it improves thinking and approach. It helped me a lot in every thing be it subjects, coding problems or practicing the questions.

## Please

Loginto comment...