Google interviews often wrap a graph problem in a real story, like courses with prerequisites or tasks that depend on each other. A dependency story usually means a directed graph, and the question is whether it has a cycle. Reach for topological sort, using Kahn's algorithm, when you must find an order or decide that no order exists. Plain BFS or DFS on an undirected view misses the direction of the rules and gives the wrong answer.