First Round: It was an online test conducted in Hackerrank (image proctored), consisting of 18 MCQs and 4 coding questions (120 mins). Most of the MCQ’s were output-based and of medium difficulty mainly on OOPS, DBMS
- To form a new string from the last two characters of a given string.
- To remove duplicates in the given string.
- This had a long problem statement but the approach was just to find the minimum in the cumulative sum of the given elements.
- This was a DP problem to find the number of palindromic substrings in a given string.
I was able to do all 4 coding questions in 20 mins since all were easy and took almost an hour to submit the test.
Result: 10 were shortlisted.
Second Round: It was a code pair round in Hackerrank, The interviewer looked young, He started by asking which are the data structures you know? , and then he asked some simple questions on the linked list. One was traversing a linked list, Finding the middle element in a linked list (Slow – Fast pointer technique). Then he gave a coding question: Given a vector of strings, find the first occurrence of all strings which has another string that is an anagram of it. This was a simple question using a map and set. Then he gave a situation and asked me to design an efficient data structure for that (Trie), Then he asked me to write queries for some questions (one was using order by and limit and one was using aggregate and group by functions). Then he asked me to explain virtual functions, inheritance, function overloading, encapsulation (always explain these concepts using real-life examples). He then challenged me with one more coding question this was using DP (modification of “Edit Distance problem”) I told him the DP approach he was happy with that. Then he asked me any questions, I asked a few. (75 – 80 mins)
Result: 4 were shortlisted.
Third Round (Codepair Round): He started with a coding problem modification of knapsack (DP) he asked one more coding problem related to prefix sums. I was able to write efficient code for both the questions. He asked one more coding question finding Nth Fibonacci number asked me to write code in all diff approaches(recursive, iterative, DP), then he asked me to consider you are not allowed to use system stack how would you solve the problem by creating your own stack, I struggled a bit but somehow I wrote creating a stack data structure. Then he asked me complex OS questions like Priority Inversion and even asked me to solve a problem on process scheduling. Then he asked me any questions, I asked a few(80 – 90 mins).
Fourth Round (Codepair Round): He asked for my introduction, and then he gave a coding problem consider you have a running stream of numbers after insertion of each element to the stream you need to find the first nonrepeating element, first I told the brute force approach, then I optimized using queue and map he was happy with the approach but still, he told me to optimize using doubly linked list this took the soul out of me to handle each and every case but still it was giving segmentation fault then he helped me to debug and finally it was working for some test cases he told it’s fine to approach is good and needs some more debugging. Then he asked me any questions, I asked a few(60 mins).
Fifth Round (Codepair Round): This was with the VP of the company, he asked how did you perform in your previous rounds? And also about my native place, I expected HR questions at least in this round unexpectedly he asked me to design an interface for IRCTC(railway) using object-oriented programming I was stunned I asked him so many questions on requirements and the started to design classes each and every time when I came up with something he was not satisfied and told me to modify I was tired already, but still, I tried a lot using all oops concepts but still, he was not satisfied then I literally gave up and stopped thinking he motivated me but still I was not able to solve that question completely, Then he asked me whether you know mutex programming (which I never heard before) but still, I said yes :). He gave a class Mutex which supports functions to lock and unlock, and he told me he’ll have N threads trying to print “Hello” and then after printing hello they’ll print “World” I should synchronize in such a way that first N “Hello”‘s should be printed then N “World”‘s I tried keeping a vector of mutexes for each thread, but he told me to optimize then I tried some other approach and I started to code that somewhere in between he told this will work, I stopped 🙂 and explained my approach, Then the Q&A section(80 – 90 mins).