Uber interview question

Topological Sort