Return a topological ordering of a graph | Microsoft Interview Question