Uber Interview Question

Write an algorithm which checks for cyclical dependencies in a graph