Amazon interview question

Traverse a binary tree efficiently