Google Interview Question

Graph question detecting a cycle