FactSet Interview Question

Tree traversal question