shopkick interview question

basic binary search tree problem.