Flexport Interview Question

Question about traversing a directed graph