Question d’entretien chez Uber

Tree based question, traversal using DFS/BFS