Question d’entretien chez JDRF Electromag

How would you detect if a directed graph contains a cycle? Provide an algorithm to solve this problem.