Visa Inc. Interview Question

graph problem dfs and top sort