Google Interview Question

They asked me to design an algorithm to detect cycles in a directed graph.