Mistake : Forgetting to check for cycles. Topological sort only works on DAGs. If your graph has cycles, Kahn's algorithm gives an incomplete result, and DFS-based sort might loop forever without proper cycle detection.
Mistake : Using the wrong direction. If prerequisites[i] = [a, b] means "b before a", the edge is b → a, not a → b. Read the problem carefully.
Mistake : Not handling disconnected graphs.Always iterate through all nodes, not those reachable from a single start. Some nodes might have in-degree but not be connected to others.
Mistake : Confusing topological order with shortest path. Topological order is any valid ordering. It does not minimize anything. Use it as a preprocessing step for DP, not as a final answer.