Uber interview question

Write an algorithm which checks for cyclical dependencies in a graph