DSA · pattern by pattern
Stop memorising solutions.
Learn to see the pattern.
Every problem in this course is taught the same way: understand it, solve it the slow way, find what makes it slow, name the pattern that fixes it, and watch the fast solution run step by step. By the end you can face a problem you've never seen, recognise its shape, and explain your answer. It starts from zero: if you can write a loop in Java, you can start today.
How every problem is taught
- 01
Understand
Restate the problem in your own words and work through the examples by hand.
- 02
Brute force first
Write the simplest correct idea and measure its cost. It's your safety net.
- 03
Find the bottleneck
Spot the repeated work that makes it slow.
- 04
Name the pattern
Match the clues in the wording to a pattern you know.
- 05
Optimise
Apply the pattern, then watch it run step by step in the dry run.
- 06
Code and test
Write clean Java, then check edge cases and the test cases.
- 07
Explain
Say why it works and what it costs, the way you would in an interview.
Every problem also lists edge cases, common mistakes, follow-up questions and test cases ready for the in-browser code runner that's coming next.
The patterns you'll learn
Most interview problems are a handful of patterns in disguise. Each problem shows its pattern in colour, and each pattern page collects every problem that uses it.
The course map
45 modules from Java basics to interview simulation, in the order that builds on what you already know. The first 35 are live; the rest arrive in waves.
Foundations
Linear
- 02Arrays
The most common input in coding problems: traverse, track state in one pass, and work in place.
AvailableBeginner0/11 - 03Strings
Characters, counting, building strings efficiently, and palindromes.
AvailableBeginner0/9 - 04Hashing
Trade memory for speed: remember what you've seen and look it up in O(1).
AvailableBeginner0/10 - 05Prefix Sum
Precompute running totals once so every range question becomes a subtraction.
AvailableBeginner0/11 - 06Two Pointers
Two indexes moving with a rule, turning O(n²) pair searches into O(n).
AvailableBeginner0/10 - 07Sliding Window
Keep a window over a contiguous range and update it as it moves instead of recomputing.
AvailableIntermediate0/11 - 08Linked Lists
Nodes and next pointers: reversal, dummy heads, fast and slow pointers, and merging.
AvailableIntermediate0/13 - 09Stack and Monotonic Stack
Last in, first out: matching brackets and the next-greater-element family.
Wave 2Intermediate0/11 - 10Queue, Deque and Monotonic Queue
First in, first out, both ends, and the sliding-window maximum trick.
Wave 2Intermediate0/8
Recursion & Search
- 11Binary Search
Halve the search space each step, on indexes and on answers.
Wave 2Intermediate0/13 - 12Recursion
Solve a problem with a smaller copy of itself; think in base cases and trust.
Wave 2Intermediate0/9 - 13Backtracking
Build answers step by step, undo, and try the next choice.
Wave 2Intermediate0/14 - 14Sorting and Divide & Conquer
How sorts work inside, and sorting as a tool for other problems.
Wave 2Intermediate0/11 - 15Intervals
Sort by start, then merge, insert, or count overlaps.
Wave 2Intermediate0/11
Trees
- 16Binary Trees
Recursion on structure: DFS orders, level-order BFS, and returning values up the tree.
Wave 2Intermediate0/17 - 17Binary Search Trees
Ordered trees: search, insert, validate, and in-order tricks.
Wave 2Intermediate0/12 - 18Heaps and Priority Queues
Always know the smallest or largest: top-K, two heaps, and K-way merge.
Wave 2Intermediate0/14 - 19Trie
A tree of characters for prefix search and word games.
Wave 2Intermediate0/11
Graphs
- 20Graph Fundamentals
Vertices, edges, and how to store them: adjacency lists, matrices, and grids as graphs.
Wave 3Intermediate0/10 - 21Breadth-First Search
Explore level by level: shortest paths in unweighted graphs and multi-source BFS.
Wave 3Intermediate0/11 - 22Depth-First Search
Go deep first: connected components, flood fill, and path finding.
Wave 3Intermediate0/12 - 23Cycle Detection
Find loops in directed and undirected graphs.
Wave 3Intermediate0/9 - 24Topological Sort
Order tasks so every prerequisite comes first.
Wave 3Intermediate0/10 - 25Union-Find (DSU)
Merge groups and ask "same group?" in near-constant time.
Wave 3Intermediate0/9 - 26Shortest Paths
Dijkstra, Bellman-Ford and Floyd-Warshall, and when to use which.
Wave 3Advanced0/10 - 27Minimum Spanning Trees
Connect everything at the lowest total cost with Kruskal and Prim.
Wave 3Advanced0/7
DP & Greedy
- 28DP Foundations: 1D
From recursion to memoisation to tables: overlapping subproblems made fast.
Wave 3Intermediate0/12 - 29DP on Grids
Paths and costs on 2D grids.
Wave 3Intermediate0/11 - 30Knapsack DP
Choose items under a budget: 0/1, unbounded, and subset sums.
Wave 3Advanced0/11 - 31DP on Strings and Sequences
LIS, LCS and edit distance: comparing and growing sequences.
Wave 3Advanced0/12 - 32Advanced DP
Interval, bitmask, tree and state-machine DP.
Wave 3Advanced0/13 - 33Greedy Algorithms
Take the locally best choice, and learn how to prove it's safe.
Wave 3Intermediate0/13 - 34Bit Manipulation
XOR tricks, masks and counting bits.
Wave 3Intermediate0/13
Advanced
- 35Advanced String Algorithms
KMP, Z-function, rolling hashes and Manacher.
Wave 4Advanced - 36Advanced Data Structures
Segment trees, Fenwick trees, sparse tables and ordered sets.
Wave 4Advanced - 37Advanced Graph Algorithms
Strongly connected components, bridges, articulation points and flows.
Wave 4Advanced - 38Advanced Search and Divide & Conquer
Ternary search, meet in the middle, and splitting problems in half.
Wave 4Advanced - 39Math for Coding Interviews
GCD, primes, modular arithmetic, fast power and combinatorics.
Wave 4Advanced - 40Designing Data Structures
LRU, LFU, time-based stores and other "design X" problems.
Wave 4Advanced - 41Concurrency-Aware Data Structures
Thread-safe queues, maps and counters, and the bugs that come without them.
Wave 4Advanced
Interview
- 42Pattern Recognition Drills
Mixed problems with no labels: practise naming the pattern from the wording alone.
Wave 4Advanced - 43The Core 100
One hundred problems that cover every pattern, in a smart order.
Wave 4Advanced - 44Interview Method and Simulation
How to solve live: clarify, brute force, optimise, code, test, explain.
Wave 4Advanced