Uber interview question

Binary search tree related question