Google interview question

Graph question related to traversal