Round 1
Questions:
Question
Connect Nodes at Same Level on GFG
It was exactly the same question, but in my case, it was nextLeft
instead of nextRight
.
The interviewer then asked, "What sorting algorithms do you know?"
I said selection sort and merge sort. The interviewer said, "Okay, then implement selection sort."
Then the interviewer said, "Okay, now tell me about merge sort."
He then said, "Okay, implement only the merge function."
Leadership Principle Questions:
- How would you learn new technologies?
- Have you gone through the codebase in your previous organization?
- Why did you choose that framework? Why not others?
- How would you approach learning new topics (advanced topics)?
Candidate's Approach
I explained that the Connect Nodes at Same Level problem would use BFS, and I mentioned that BFS is level order traversal using a queue. However, I struggled to solve the problem within the given time. For the sorting algorithms, I implemented selection sort and explained its time complexity as O(n^2) and space complexity as O(1) after correcting my initial mistake. I also explained merge sort and implemented the merge function as requested.
Interviewer's Feedback
The interviewer seemed satisfied with my answers to the leadership principle questions. However, I felt that my inability to solve the tree-based question might have led the interviewer to doubt my knowledge of DSA, prompting him to ask about basic sorting algorithms.