Question d’entretien chez Apple

Graph traversal question with optimization follow up