Microsoft interview question

Graph, DFS and cycle detection