SpaceX interview question

Step through tree-based algorithms in python.