Meta interview question

It was a BFS problem.