Google Interview Question

dependency sorting - classic dfs