We use cookies for site analytics. Accept to help us understand how the site is used. See our Privacy Policy for details.
Most graph interview problems are BFS or DFS wearing a costume; the skill being tested is usually recognising that a grid, a set of prerequisites, or a list of flights is a graph at all. Build the adjacency list first, then pick the traversal that matches the question. Weighted shortest paths and cycle detection are the two places you need a named algorithm rather than a plain traversal.
Explicit edges, a grid treated as a graph, or dependencies between items.
27 problems. Each one runs in an in-browser editor against real test cases, with hints and a worked solution.
The patterns cheat sheet covers all of these in one page - what each one looks like in a problem statement, and the template that follows.