Meta interview question

Traverse a tree