Amazon Interview Question

Find a loop in a graph