Citadel Securities interview question

Second question in interview was basic topological sort.