Google interview question

Leetcode coding, BFS, Topological sort