Datadog interview question

Binary tree question which was somewhat basic