Microsoft Interview Question

Graphs - topological sorting