Tip 1: Having a grip over Data Structures and Algorithms is very important. Have your concepts crystal clear, and then pick one coding platform and try to practice around 7-10 questions every day with varying difficulty and different topics.
Tip 2: After writing code for a particular question, try to analyze its time and space complexity. Think about how you can optimize your code further. Also, refer to the editorials and compare your solution with it. Interviewers ask a lot about further code optimization. Hence, instead of trying to solve more and more problems, try to analyze a question completely and understand the concept behind it.
Tip 3: Along with coding, study about OOPS. Coding Ninja's Data Structures and Algorithms course helped a lot in preparing the OOPS concepts. Also, OS and DBMS must also be studied. You can refer to CodeStudio for these topics.
Tip 4: Keep participating in coding contests. It helps you increase your speed.
Tip 1 : Do not fake any skills, projects or achievements. The interviewer gets to know about it by asking questions to you.
Tip 2 : You do need to have a long list of projects. Any 1 good project with proper knowledge of it will also do good. Similarly, you do need to have many skills to be listed down. Few skills but with proper knowledge is great.
Tip 3 : Try to write achievements which proves your technical skills, communication skills, leadership quality or teamwork.
This round consists of 3 coding questions with a total time limit of 90 minutes. The first two questions were of easy level and the third question was of medium level. No two candidates had the same set of questions, the distribution of questions was random. The test was conducted on mettl platform with both audio and video on for monitoring on the candidate.



Since the array was unsorted, fist sort the array.
Return the middle element of the array if n is odd else return the average of middle two elements.



'arr' = [1, 2, 3]
Here, we have three different types of fruits. We can pick [1, 2] or [2, 3]. We can pick a maximum of two fruits.
Hence, we return 2.
1. Add all the number of fruits.
2. Divided the total number of fruits with number of baskets, lets say this x.
3. Subtract x from all the initial number of fruits from each basket.
4. Add all the numbers and that is the final answer.



As the answer can be large, return your answer modulo 10^9 + 7.
Can you solve this using not more than O(S) extra space?
First I thought of the Naive approach which is to find all the possible combinations of values from n dice and keep on counting the results that sum to X. But since it consisted of some overlapping subproblems, I came to the conclusion that it can be solved by DP as well. Create a 2D array with the number of throws as row index and the sum as column index. Return the last element of 2D array.
This was my first interview and I was a bit nervous. The interview was conducted on Microsoft Team. He told me to share my screen and write the pseudo code on notepad. The interviewer was very friendly and also gave me hints for the question. However, he mostly focused on optimization of the code. At the end of the question, few questions related to Operating Systems were asked.



The order in which the groups and members of the groups are printed does not matter.
inputStr = {"eat","tea","tan","ate","nat","bat"}
Here {“tea”, “ate”,” eat”} and {“nat”, “tan”} are grouped as anagrams. Since there is no such string in “inputStr” which can be an anagram of “bat”, thus, “bat” will be the only member in its group.
I applied Sliding Window technique to it.
The time complexity was O(N).
1. Store the frequency of characters in string p in a vector.
2. Run a sliding window as follows:
If the current count of the new character s[r] in the window is less than that in p, increment count.
If the length of the window equals p, compare count with p.length(). If they are same, add l to the result.
Also, remove the character at the begining s[l] from the current window. If the new count of character s[l] becomes smaller than that in p, decrement count.
Tip 1 : Always give a structured answer. For example, first tell the definition and then quotes a few examples in support of it.
Tip 2 : Do refer to CodeStudio for OS. Try to read as many articles as you can.
The second round consisted questions related to concepts of object oriented programming and databases. At the end of the interview he asked me to explain any one good project. The interview lasted for 45 minutes. The interviewer was friendly and good.
Tip 1 : Always think properly before saying your answer. Try to communicate clearly.
Tip 2 : Coding Ninja's Data structures and algorithms in C++ course helped me a lot in clearing my OOPS concepts.
Tip 3 : Along with definitions, try to give examples also.



Merge Sort Algorithm -
Merge sort is a Divide and Conquer based Algorithm. It divides the input array into two-parts, until the size of the input array is not ‘1’. In the return part, it will merge two sorted arrays a return a whole merged sorted array.

The above illustrates shows how merge sort works.
It is compulsory to use the ‘Merge Sort’ algorithm.
1. You should know properly about what is merge sort.
2. The pseudo code is as follows:
MergeSort(arr, left, right):
if left > right
return
mid = (left+right)/2
mergeSort(arr, left, mid)
mergeSort(arr, mid+1, right)
merge(arr, left, mid, right)
end
This was my last round and I was a bit tensed. It was an HR round. The interviewer was very professional. He discussed and asked questions about my various achievements, my interests apart from the technical field and also asked about my projects. I made sure to answer all the questions confidently and calmly.
1. Tell me about yourself.
2. Which is your favorite project? Elaborate that project.
3. Asked a question related to one of my achievements.
4. What role do you want in Microsoft?
5. Is there any technology that interests you and you would like to work upon?
Tip 1 : While answering to the question "tell me about yourself" , you can mention your technical skills and how you developed interest in coding. Apart from technical side, you can also tell your other areas of interest and hobbies.
Tip 2 : You should be clear about all the projects, the technologies used in it, why you used them specifically, the purpose of the project, etc.
Tip 3 : Don't try to fake any achievements. The interviewer can ask tricky questions and it can become difficult to handle if you haven't achieved it.
Tip 4 : For the question - What role do you want in Microsoft?, I answered that I just need a role where I can share my ideas with the team, help the company to grow and build a product which is useful for the society.
Tip 5 : You should be also be a bit aware about the company. Spend around 1 hour before the day of the interview and do a proper research about the company and its principles.

Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
How do you remove whitespace from the start of a string?