Uber interview question

binary tree