FactSet interview question

Tree traversal question