Google interview question

Graph question detecting a cycle