Citadel Securities Interview Question

Second question in interview was basic topological sort.