Amazon interview question

Modified tree traversal and ml questions