Bloomberg Interview Question

Determine whether a graph contains loop