Microsoft interview question

Graphs - topological sorting