Microsoft interview question

a graph question involving dfs