Meta interview question

Similar BFS/DFS questions from LeetCode