Amazon interview question

Something about tree traversal.