Samsung Electronics Interview Question

Do the bfs of a graph