Google Interview Question

High frequency LC tag problems. Focuing on BFS DFS and graph