Tip 1 : Participating in online contests helped me a lot with gaining speed to clear the OA. People who solved both OA questions but took a longer time were not selected.
Tip 2 : DSA topics such as Trees, BSTs, Graphs, DP are almost certainly asked in 1st interview round, so I paid more attention to these.
Tip 3 : Application of OOPS in the form of Low Level design and basics of system design are almost always asked.
Tip 4 : Having prior internship experience helped me alot in the final round (software practices), also the projects that I did were on technologies I was passionate about and not on new buzzing technologies, this seemed to interest the interviewer as we could have a discussion about the technologies aspect in depth.
Tip 1 : Having projects is very helpful during shortlisting. Also knowing the technologies used in depth will help in the interview rounds.
Tip 2 : Prior experience helps a lot during shortlisting.
Tip 3 : In the interview if we don't know the answer to a theoretical question we should tell the interviewer, and try to attempt the question by deducing the answer, instead of giving the wrong answer.
Timing: Afternoon 2:00 pm



An irreducible fraction is a fraction in which the numerator and denominator are integers that have no other common divisors than 1.
Example: 2/3, 8/9, 0/1 are irreducible fractions, where 8/12, 9/12 are not irreducible fractions.
Ayush expects your answer to be an irreducible fraction, so if your answer is an integer, convert it into an irreducible fraction by putting 1 in the denominator.
For example, if your answer is "9", then print "9/1" (without quotes).



A subsequence of an array/list is obtained by deleting some number of elements (can be zero) from the array/list, leaving the remaining elements in their original order.
This round required me to solve 2 DSA questions, they were of medium hard difficulty. The topics involved Binary Search Tree (LCA of a node in a BST) and BFS on Graph + String manipulation (Word Ladder Problem). In the second question I gave the interviewer a different approach than the one he had in mind but through clear communication I was able to explain my approach.



You may assume that given ‘X’ and ‘Y’ definitely exist in the given binary tree.
For the given binary tree

LCA of ‘X’ and ‘Y’ is highlighted in yellow colour.
Step 1 : Create a recursive function that takes a node and the two values n1 and n2.
Step 2 : If the value of the current node is less than both n1 and n2, then LCA lies in the right subtree. Call the recursive function for the right subtree.
Step 3 : If the value of the current node is greater than both n1 and n2, then LCA lies in the left subtree. Call the recursive function for the left subtree.
Step 4 : If both the above cases are false then return the current node as LCA.
Time Complexity: O(h).
The Time Complexity of the above solution is O(h), where h is the height of the tree.
Space Complexity: O(1) when implemented iteratively.



1. If there is no possible path to change BEGIN to END then just return -1.
2. All the words have the same length and contain only lowercase english alphabets.
3. The beginning word i.e. BEGIN will always be different from the end word i.e. END (BEGIN != END).
1. Do the pre-processing on the given wordList and find all the possible generic/intermediate states. Save these intermediate states in a dictionary with key as the intermediate word and value as the list of words which have the same intermediate word.
2. Push a tuple containing the beginWord and 1 in a queue. The 1 represents the level number of a node. We have to return the level of the endNode as that would represent the shortest sequence/distance from the beginWord.
3. To prevent cycles, use a visited dictionary.
4. While the queue has elements, get the front element of the queue. Let's call this word as current_word.
5. Find all the generic transformations of the current_word and find out if any of these transformations is also a transformation of other words in the word list. This is achieved by checking the all_combo_dict.
6. The list of words we get from all_combo_dict are all the words which have a common intermediate state with the current_word. These new set of words will be the adjacent nodes/words to current_word and hence added to the queue.
7. Hence, for each word in this list of intermediate words, append (word, level + 1) into the queue where level is the level for the current_word.
8. Eventually if you reach the desired word, its level would represent the shortest transformation sequence length. Termination condition for standard BFS is finding the end word.
Time Complexity: O(M^2 * N) where M is the length of each word and N is the total number of words in the input word list.
Space Complexity: O(M^2 * N)
This round was highly focused on Low Level Design and Core subjects, the interviewer asked me about various database technologies (and indexing in RDBMS) in depth and their use cases. I had to design a Commodity Exchange (Stocks, Futures, etc.) using the pillars of OOPS: inheritance, abstraction, polymorphism and encapsulation. We also had a discussion about the language of my choice (C++). This discussion included topics such as shared pointers, virtual pointers and runtime/ compile time polymorphism.
Explain about the different Databases you have worked with. Differentiate between SQL and NoSQL databases. Discussion in detail about ACID compliance in SQL vs CAP Theorem in NoSQL. Discussion on indexing in RDBMS and the internal data structure used (B-Tree). Had a discussion about scalability in DBMS and topics such as sharding etc. Discussion on Joins in SQL and a few SQL queries.
Tip 1 : Try to convey your level of surety along with the answer and if you have deduced an answer then the process behind the discussion.
Tip 2 : I feel that being opinionated helps in discussion-based rounds, as this gives the interviewer opportunity to ask questions from the for/against side.
Tip 3 : Practicing nested SQL queries helps in DBMS based rounds.
Design a Commodity Exchange using OOPs. Also discuss in detail about the Networking Protocols that can be used in such a system (MQTT, CQRS etc.).
Tip 1 : Practicing a few Low-Level Design questions is very helpful as we can then mold our question to have some overlap with the practiced questions, e.g., OOPs for Notification Delivery.
Tip 2 : In core subject-based rounds networking questions can be asked so, knowing about the different protocols and their use cases helps.
Tip 3 : Resume projects related core subject questions must not be neglected.
This round was kind of a mix between technical and HR, but it leaned more towards the technical side. The interviewer checked me on software practices such as error handling, directory structure, we also had a lengthy discussion on my projects (the technologies I used and why) and college work (clubs and activities I was a part of). I was asked to implement a stack using 2 queues and encapsulate it in a class. In the end I was asked about my aspirations 5 years down the line and why I'd like to join Microsoft.
Error Handling Practices.
How to structure directories in React / Node (Related to my internship experience)
The interviewer made me write code to print the Nth Fibonacci numbers with error handling and input sanitization. (I was able to write a logarithmic time complexity solution using Matrix multiplication which impressed the interviewer.)
Tip 1 : Prepare resume-based questions well.
Tip 2 : Try to follow best software engineering practices while writing code in interviews.
Tip 3 : We should also look at the standard interview questions about the technologies we have written in our resume (E.g., Virtual DOM in ReactJS, etc.).



1. Constructor:
It initializes the data members(queues) as required.
2. push(data) :
This function should take one argument of type integer. It pushes the element into the stack and returns nothing.
3. pop() :
It pops the element from the top of the stack and, in turn, returns the element being popped or deleted. In case the stack is empty, it returns -1.
4. top :
It returns the element being kept at the top of the stack. In case the stack is empty, it returns -1.
5. size() :
It returns the size of the stack at any given instance of time.
6. isEmpty() :
It returns a boolean value indicating whether the stack is empty or not.
Query-1(Denoted by an integer 1): Pushes an integer data to the stack. (push function)
Query-2(Denoted by an integer 2): Pops the data kept at the top of the stack and returns it to the caller. (pop function)
Query-3(Denoted by an integer 3): Fetches and returns the data being kept at the top of the stack but doesn't remove it, unlike the pop function. (top function)
Query-4(Denoted by an integer 4): Returns the current size of the stack. (size function)
Query-5(Denoted by an integer 5): Returns a boolean value denoting whether the stack is empty or not. (isEmpty function)
Operations:
1 5
1 10
2
3
4
Enqueue operation 1 5: We insert 5 at the back of the queue.
Queue: [5]
Enqueue operation 1 10: We insert 10 at the back of the queue.
Queue: [5, 10]
Dequeue operation 2: We remove the element from the front of the queue, which is 5, and print it.
Output: 5
Queue: [10]
Peek operation 3: We return the element present at the front of the queue, which is 10, without removing it.
Output: 10
Queue: [10]
IsEmpty operation 4: We check if the queue is empty.
Output: False
Queue: [10]
Why would you like to join Microsoft? Where do you see yourself in 5 years?
Tip 1 : I tried to personalize the questions by talking about my experiences and the impact Microsoft products have had on me. I also talked about the technologies at Microsoft I am most excited about and would love to contribute to. (WSL and Xbox Gaming)
Tip 2 : I tried to answer the future aspiration question in the manner that I want to evolve with and explore new technologies.
Tip 3 : In the end the interviewer asked me if I had any questions for them, I asked about their favorite technology at Microsoft and that evolved into a good discussion. So, I tried to converse with the interviewer to maximal extent.

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?