Sefism is free for learners. We are here to help you grow, one step at a time.Join for free
Sefism.
Course · Interview PrepSubscription

Grokking Graph Algorithms for Coding Interviews

A graph-only course that starts with representations, BFS and DFS, then covers matrix graphs, graph theory, union find, topological sort, shortest paths (Dijkstra, Bellman-Ford, Floyd-Warshall) and minimum spanning trees (Kruskal, Prim, Boruvka). It has 50 problems with walkthroughs in six languages. It suits candidates comfortable with trees who keep losing marks on graph questions or fail to recognise a graph hidden inside a grid or dependency list.

Get access
Rating

3.9/5 (3,287 ratings)

Course page · Sept 2026

Learners

2,483

Course page · Sept 2026

Lessons

117 in 10 chapters

Course page · Sept 2026

Study time

50 hours (stated)

Course page · Sept 2026

Problems

50 with solutions

Course page · Sept 2026

Price

$58 one-time (lifetime)

Course page · Sept 2026

Format

Course

Topic

Interview Prep

Provider

Design Gurus

Time needed

2 to 3 weeks

Level

Intermediate

Access

Subscription

What it covers

The course page lists 10 chapters, 117 lessons, 115 playgrounds and about 50 hours of study time (September 2026). The chapters, in order:

  • Graph basics: types of graph and how to represent one (adjacency list and matrix).
  • BFS traversal (17 lessons) and DFS traversal (15 lessons), each with a set of problems.
  • Matrix graphs (17 lessons): islands, flood fill and grid shortest paths treated as graph problems rather than tricks.
  • Graph theory: the terminology and properties interviewers assume you know.
  • Union find / disjoint set union: including the path compression and union by rank optimisations, for connectivity and cycle problems.
  • Topological sort (15 lessons): ordering and the dependency problems that reduce to it, such as course schedules.
  • Shortest paths: Dijkstra, Bellman-Ford and Floyd-Warshall, and how to choose between them once weights and negative edges appear.
  • Minimum spanning trees: Kruskal, Prim and Boruvka.

There are 50 problems with full solutions, each with a step-by-step algorithm and a walkthrough, some with alternative approaches. Code is provided in Python, Java, C++, JavaScript, Go and C#.

The real skill it trains

Few interview questions announce themselves as graph problems. They arrive as a grid of islands, a list of course prerequisites, accounts to merge or a word ladder. The course's matrix graph and topological sort chapters are the most useful for this: they train you to see the graph in a prompt that never uses the word.

Is it worth it?

As of September 2026 the course page lists a one-time price of $58 for lifetime access, and it is included in the provider's all-courses subscription. The page shows a 3.9 rating from about 3,300 ratings and roughly 2,500 learners.

The core interview set is BFS, DFS, topological sort, union find and Dijkstra, and the course gives each of these a full chapter of problems. The later chapters on Bellman-Ford, Floyd-Warshall and minimum spanning trees round out the topic for harder loops and for roles where graph algorithms show up in daily work.

How long it really takes

Fifty hours is the stated figure. A focused plan that covers basics, BFS, DFS, matrix graphs, union find and topological sort takes about two to three weeks at an hour or two a day. Add another week for shortest paths and spanning trees.

Before you start

You should be comfortable with recursion, queues and hash maps, and ideally with tree traversal. Graph DFS is tree DFS plus a visited set, so Grokking Tree Coding Patterns for Interviews is a natural lead-in.

How to use it well

  • After each algorithm, note the disguises it appeared in (a grid, a dependency list, a set of accounts to merge) and re-solve one of those problems from scratch a few days later. The translation step is what transfers to an interview.
  • Write BFS and DFS from memory in your interview language until you can do it in two minutes without thinking.
  • For each shortest path algorithm, note the one condition that makes it the right choice (non-negative weights, negative edges, all pairs).

Best for: candidates comfortable with trees who find graph questions land differently, and anyone preparing for companies known for graph-heavy rounds.

algorithmsdata structuresinterview prep

Ready to start?

Opens on Design Gurus in a new tab.

Get access
Link broken or out of date?

Report a problem

With "Grokking Graph Algorithms for Coding Interviews". Only Tauseef reads this.

Work with me

Stuck on something specific?

Writing only gets you so far. If you want an answer to your situation rather than the general case, book a session and we will work through it together. Sessions are free for approved Sefism members, and a few slots open each week.