Zepto | SDE-2 | Interview Experience | Reject
Anonymous User
1730

Exp : 3 Years

Round 1- DSA
Duration : 1 Hour

Question 1 - Bus Routes -

https://leetcode.com/problems/bus-routes/

I coudn't think of how to apply BFS on this, the interviwer was helpful and tried to give hints.
I could only think of a brute force approach which tried all ways (Dynamic Programming).

Question -2

You are given the root of a complete binary tree.
Your task is to design an algorithm to find and return the deepest rightmost node in the tree. The deepest rightmost node is defined as the node that is the farthest from the root (i.e., at the greatest depth/level) and also the rightmost node at its level.

This question looked simple, I told we could simply do a level order traversal.
TC - O(n)
The interviwer told this was brute force & we would like a soultion with less time complexity, meaning in the order of Height.
I tried to think about it, nope not a thing struck my mind on how can we do it less than O(n).

Can someone think of a better than O(n) solution?

Verdict : Rejected

Hope this helps!

Comments (5)