Autodesk Interview Question

How to detect a cycle in a graph?