Nokia interview question

programming problem with BFS on a graph