Wingify interview question

Binary tree