Tripadvisor Interview Question

Tree traversal.