Amazon Interview Question

They asked basic BFS traversal