Tripadvisor interview question

Tree traversal.