First round was online coding round. It was hosted on hackerrank platform. 4 questions were there.
- First one was to check weather a valid BST exists given its pre-order traversal.
- Find maximum number of consercutive days when all the emloyees were present. Matrix data was given. data[i][j] denotes the jth employee’s attendence on ith day.
- Minimum number of moves required for knight to reach the ending position from given starting position.
- Find the longest subsequence of S that is palindrome.
6 people were selected for next round.
Second round was telephonic interview. We have write our code on a real-time collaborative code editor on skype.
Firstly interviewer asks me about myself. Then 2 coding questions were asked.
- Find total number of visible nodes in a binary tree. A node is visible, if it has highest value in the path from root to node. It was done in O(n).
- Find leftmost unique element in the array. eg. 2 5 2 3 5 6 8 . Answer is 3 for given example. I have done with the help of the hashmap in O(n) time complexity.
Coding style was given more importance than solution.
Finally 4 persons were selected. I was one of 2 who was not selected.
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.