Question d’entretien chez Amazon

Binary tree algorithm question.