Pergunta de entrevista da empresa Google

Graph question with multiple scenarios to use bfs/dfs