Q1: Find the common ancestor of two nodes in a binary tree (not binary search tree). Interviewers didn't know the complexity. Q2: Write echo client-server model. It is expected to know the signatures of the apis and the arguments passed in bind, listen, accept. Q3: Implement ringbuffer.
Sigiloso
Q1:Provided the first solution as mentioned in "Cracking the coding interview". Not the second one which is improving the solution by a constant factor. They asked for complexity, its O(n) as mentioned in the book. The reason is that you do n + n/2 + n/4...operations. Which adds to n( 1+ 1/2 + 1/4...) = 2n. The interviewers who were both seniors claimed this is exponential. Obviously confusing it with the 1 + 2 +3 + ...n = n(n+1)/2..On the feedback of my rejection i was told i had issues with complexity...some people..