Question d’entretien chez Yelp

Pretty straightforward BFS graph question