Question d’entretien chez Amazon

Write a function to detect if a graph is cyclic.