Key Patterns to Master
- Flood Fill: For grid traversal.
- Topological Sort: For dependency and ordering.
- Shortest Path: Using BFS (unweighted) or Dijkstra (weighted).
- Union Find: For connectivity (advanced).
Hand-Picked Problems
| Problem | Difficulty | Key Pattern |
|---|---|---|
| Number of Islands | Medium | Grid DFS |
| Clone Graph | Medium | BFS/DFS + Map |
| Course Schedule | Medium | Kahn's Algorithm |
| Pacific Atlantic Water Flow | Medium | Multi-source DFS |
| Rotting Oranges | Medium | Multi-source BFS |
| Word Ladder | Hard | Shortest Path BFS |
| Network Delay Time | Medium | Dijkstra |
| Cheapest Flights Within K Stops | Medium | Bellman-Ford |
| Redundant Connection | Medium | Union Find |
| Alien Dictionary | Hard | Advanced TopoSort |
Interview Tip
Always mention if the graph is Directed or Undirected, and if it can have Cycles.