Twitter Interview Question
32 Interview Reviews |
Back to all Twitter Interview Questions & Reviews
Interview questions and reviews posted anonymously by interview candidates
Interview Question for Software Engineer at Twitter:
Helpful Question?
Yes |
No
Inappropriate?
Answers & Comments (4)
0 of 1 people found this helpful
Helpful Answer?
Yes |
No
Inappropriate?
1 of 1 people found this helpful
I worked out a simple idea: return {null, p, q, common ancestor} four type of values then the recursion will be very easy to write, and the code runs in log(n)
Helpful Answer?
Yes |
No
Inappropriate?
Your idea won't work. Usually tree nodes do not contain a parent pointer unless specified. So the recursion is top down manner.
Helpful Answer?
Yes |
No
Inappropriate?
To comment on this
question,
Sign In with Facebook or
Sign Up
0 of 0 people found this helpful
by Interview Candidate: