Round 1.
The interviewer was very friendly. he asked me 3 coding questions and I had to write working code for them. He started with simple OOPs questions, concepts(understanding level). He started asking me questions on OS. He also asked me about paging, virtual memory and segmentation (internal and external fragmentation).
Problem 1
In main memory, we have 3 kinds of blocks present - {used, unused, garbage}. Run an algorithm such that all used blocks come together, unused together and garbage also together. This is a very simple problem of sorting an array consisting of only 0s, 1s and 2s. I gave him a two-pointer solution instantly coded it.
Problem 2
We have a Facebook-like application, which has billions of users. In this app, users will have connections, 1st-connection who are direct friends of the user, 2nd -connection who are direct friends of 1st connection and everyone else stranger. Now given two users A and B, write an algorithm to know whether A and B are first connection, second connection or stranger.
I started with a BFS approach and later realised that this will take less time if we start from B. He also asked me about the time complexity.
Problem 3
This was a simple problem based on the Union-find concept. Some children decided to go on a tour. But some of them hate each other and will not sit with each other on the same bus. Minimum the number of buses to get children on board. I asked about the transitive property and then gave him the DSU. Since less time was left, I just have to tell the logic.
Techincal Round 2
I introduced myself and he asked an open-ended question.
Problem
Given n characters and find out the maximum length valid word that can be made using these characters. I asked some clarification questions like how to decide the validity of words.
Later, he divided this question into two subparts. Validate words and maximum length valid words.
I gave him the backtracking solution, word break solution, trie based data structure to contain all valid words. He went on making the problem statement complex and asked me about the time and space complexity of the trie.
Problem He asked me questions based on OOPs hard level, virtual functions, code and their output. He also asked about deadlocks, semaphores, mutex etc. Please be prepared to face these questions.
Techincal Round 3
The interviewer was very friendly and for first 15 minutes, he asked me questions based on my resume.
Problem
Snake game of Nokia mobile. What data structure can be used to represent the snake. I started with matrix and then gave him a linked list solution. He was constantly asking me how I can optimise the movement of the snake and increase the length.
Problem
He asked me to random shuffle an array. I had to write a working code for this. This round did not go well as I got nervous in the end and was unable to come up with the right approach in the first go.
Rejected just before HR round.