Microsoft Internship Interview Experience | On-Campus 2021
Microsoft visited our campus in month of July 2021 for the role of Summer Intern
1. Given an array of numbers ranging from 1-6 you have to merge add K elements[ in the range 1-6] in the array such that the mean of the array after adding elements become F, we need to return an array of K elements if it was not possible we need to return an empty array.
example 1.a)input->arr=[1,2,3,4] k=2 f=3.0 output->[1,2,3,4,5,3] //since the mean of the new array is 3 1.b)input-> arr=[1,1,1] k=1 f=6 output=
2. Given a string of a,b, and/or? You can replace it? with a or b. task is to replace all? such that no three consecutive a or b occurs in the string. it is given that such string will always exist we needed to return the modified string.
example 2.a) input->b?aa? output->bbaab
The test was conducted on their platform cordiality, unlike other OA you can submit your code only once ie once submitted you can not edit your code
Those who did solve both questions were shortlisted for Interviews
INTERVIEW ROUNDS: The Interview rounds were held on MS teams and for coding was done on their codility platform similar to codepair hackerrank.
ROUND 1: We exchanged greetings then the interviewer asked me the challenges that we were facing in online mode.
Then she gave me a question:
- Given a string, we need to find whether the string satisfies the following condition:
- for each character at ith positon(where 0<=i<n) there should not be same character in the window i/2 to the left and i/2 to right
- expected time complexity-O(n), space complexity-O(1)
- After trying out brute force, then binary search methods
- I asked for the hint, with help of hint I was able to do it code it using hashmap
- This Round lasted for around 40 mins
I was shortly called for round 2 after this round.
ROUND 2: We exchanged greetings and the interviewer asked for my introduction.
He then gave a question.
- Given an array of n numbers ranging from 1-255, I needed to design a class to compress it to reduce the size of array and decompress to get back original array. Unlike the previous round expected time and space complexity was not specified. (Soln: 1 declared an array of unsigned int (32 bits)of size n/4 and each number can be can store 4 numbers since in the original array max number of bits are 8(255=11111111 in binary)
The interviewer seemed satisfied with my approach and asked me to code it out.
After that we had a discussion on some follow-up questions given below
- What will change if number would range from 0-255 instead of 1-255 .
- Where this algorithm can be applied.
This Round lasted for around 1 hour 20 mins.
I was shortly called for round 3.
ROUND 3: It was HR cum coding round. It was taken by a very senior person,
- Kadane’s Algorithm.
- Given an array, print unique elements in decreasing order of their frequency.
- Why did you take CSE?
- Why did you choose this college?
- Your strengths and weaknesses.
- Name any recent techstack which had impressed me a lot.
- Future Goals
- Why Microsoft?
- Elaborate one team project experience. What were the challenges you faced and how did you overcome it?
- Name any product/techstack which you think had most important impact in the pandemic.
This Round lasted for around 50 mins.
- All interviewers were very experienced and friendly. They gave helpful hints whenever I was going in wrong direction. So whenever you are stuck make sure to ask for hints.
- Microsoft focuses more on basics but in all three interviews and OA the emphasis was made that code should be correct with minimum number of corrections.
- In all three interviews, I was expected to think all edge cases where my code may fail.
- At the end of every round make sure you ask something about profile from interview when they ask “do you have any questions for me?”.
- While writing code be sure to be interactive and discussing each and every line that you are writing with the interviewer.
- At last but not least, be confident and believe in yourself.