Frage im Vorstellungsgespräch bei Microsoft

a coding question that could be solved using BFS graph traversal