Apple interview question

A BFS type algorithm question