Tripadvisor Interview Question

How to navigate a tree?