Tripadvisor interview question

How to navigate a tree?