Round 1: Technical(F2F – about 45 minutes)
- Detect whether the given linked list is Y-shaped. – [ https://www.geeksforgeeks.org/write-a-function-to-get-the-intersection-point-of-two-linked-lists/ ]
- Clone a linked list with random pointer. [ https://www.geeksforgeeks.org/a-linked-list-with-next-and-arbit-pointer/ ]. Note – Go through each method because you never know on which aspect (memory/time) the interviewer wants to compromise.
- Time taken by a binary tree to burn starting from a target node when each edge take 1 unit time to burn (each node has information about pointers of children and parent). [ https://www.geeksforgeeks.org/burn-the-binary-tree-starting-from-the-target-node/ ]
- What are copy constructors and virtual fuctions (asked me to write example of each).
Round 2: Technical(F2F – about 75 minutes)
- Discussion on Virtual Function, Virtual Pointers, Virtual Table from every aspect – compiler, memory.
- Given an array of positive integers representing sides of a triangle, find all unique triangles (triangle with sides a, b, c should satisfy the property – a<b+c, b<a+c, c<a+b). [ https://www.geeksforgeeks.org/find-number-of-triangles-possible/ ]
- Vertical order traversal of a binary tree. [ https://www.geeksforgeeks.org/print-binary-tree-vertical-order/ ]
- Deep discussion about one of my projects.
Round 3: Technical (F2F – about 50 minutes)
- The interviewer showed me one program that was not suppose to run but was running. – Clear your concepts on scope of variables.
- Next program was about a class (lets say ‘A’) containing one class object, one class pointer initialized to NULL and one class pointer not initialized. Each was accessing methods of class ‘A’. Asked me for which program should crash and why. Go through program layout in memory and in which section what type of variables are stored (stack, initialized, uninitialized, heap etc) and which section they can access.
- A frog can jump only 1, 3, 5 steps. In how many ways can it reach Nth step.
Round 4: Technical (F2F – about 50-60 minutes)
- Asked me to write program for Snake and ladder game.
- Given 1000s of news articles. Interviewer asked me to label each of them with 5-6 keywords. No other data was provided. Need to do all processing from these articles only.
- Discussion on my projects.
Round 5: Directorial Round (F2F – about 30-40 minutes)
- Discussion on current work.
- Given 4 unsigned integers a, b, c, d. Write a program to find average of them. conditions – program should always work, type casting not allowed. [ do your math 😉 ]
Got the offer after 3 days.
Suggestion – DS, Algorithm, OOPS, OS are must. Be open for discussion during your interview, your mind will work accordingly. Whatever you study, be curious about every statement you write in your program.
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more, please refer Complete Interview Preparation Course. In case you are prepared, test your skills using TCS, Wipro, Amazon and Microsoft Test Serieses.