Bloomberg interview question

Determine whether a graph contains loop