Pregunta de entrevista de Autodesk

How to detect a cycle in a graph?