Facebook onsite Interview questions
Anonymous User
1684

You are given an array of nodes from a binary tree. One of them could be the root node. Some of the entries could be dangling (detached) nodes. Return the root node, if all of the elements in the array belongs to a "valid binary tree".

I was asked about edge cases like , two parents pointing to one child, circular relationships etc after completing the solution. Not sure whether the interviewer expected me to consider all these edge cases without prompting.

Comments (5)