DSA patterns · learn, then practise · free

Every coding-interview pattern, made visual.

Most interview questions are a familiar pattern in disguise. Learn the clue that gives each pattern away and watch it run step by step. Then practise it on 1,194 original problems, graded in your browser.

topics
10
patterns
56
worked problems
274
practice problems
1,194

Four patterns, one loop

6s
2ptr13468111519LR6 + 8 = 14windowabcabcbbhalvebfs

Once you can see the motion, the code follows. Every pattern on these pages has its own step-by-step player like this one.

56 patterns in the syllabus

The syllabus covers 56 patterns: Two Pointers, Merge Intervals, Sorting, Sliding Window, Prefix Sums, Two Pointers, Sliding Window, Hashmaps, String Manipulation, Regular Expressions, Basic Binary Search, Range Search, Allocation Problems, Counting Occurrences, Bitonic Array Search, Basic Recursive Functions, Divide & Conquer, Backtracking, Recursive Search, Fast and Slow Pointers, Dummy Node Technique, Recursion Technique, In-Place Reversal Technique, Design Problems, Monotonic Stack, Expression Evaluation, Two Stacks, Sliding Window & Monotonic Queue, Traversal, Construction, Mirror & Symmetry, Path Sum & Root to Leaf, Traversal & Search, Validation & Properties, Finding Kth Largest/Smallest, Top K Frequent Elements, Merge K Lists, Sliding Window Maximum/Minimum, Design Problems, Construction and Manipulation, With Graphs, Basic Dynamic Programming, Optimal Substructure, Interval/Range DP, Knapsack Problems, Prefix Sums, Counting Problems, Interval Partitioning, Probability & Expectations, Finding Connected Components, Shortest Path Finding, Cycle Detection, Bipartite Graph Check, Minimum Spanning Tree, Directed Acyclic Graph (DAG) Traversal, Graph Coloring.

Pattern-first

Learn the pattern, not every problem.

Interviewers rarely ask a question you have already solved. They ask one that needs a technique you should know. Here, 274 problems are grouped under the 56 patterns that solve them, so you study the technique once and use it everywhere it applies.

In the room, a new question then becomes a smaller one: which pattern does this look like? Spotting it early leaves your time for the edge cases and for explaining your thinking, which is what most interviewers are listening for.

How each pattern is taught

  1. Step 1: Read the clue

    Every pattern has a tell. A sorted array and a target sum points to two pointers. “Longest substring such that…” points to a sliding window. We name the tell first, so you stop guessing

  2. Step 2: Watch it run

    Step through the animation one frame at a time, with the data, the pointers and the rule that holds at each step all on screen. That is the part a written solution leaves out.

  3. Step 3: Then solve it

    Each pattern comes with a hand-picked LeetCode set, ordered easy to hard. Most also have an original twin in the practice set, where your code runs against graded tests.

The topics

Pick a topic. Watch the technique run.

Each topic breaks down into the handful of patterns that solve most of its problems, with an animation and a practice set for every one.

Then practise

1,194 problems. Zero you’ve memorised.

Each one is new, set as a small real task, and trains the technique of a named LeetCode problem. Write it in your browser; 15,062 tests grade it.

  1. 01Read a real task. A new story over a classic technique.
  2. 02Code it here. 7 languages, with a typed starter.
  3. 03Submit to the tests. A failing case shows its input, your output and the answer.

Free to read · free account to run code

How they’re built

Answers you can trust.

Practice only helps if the answers are right.

Each of the 1,194 problems passed five checks before it went live. If a wrong solution can pass the tests, the tests get fixed.

@ before publish

15,062 tests

  1. ✓Written from a specnever from another site's wording
  2. ✓Every example executedby the reference solution
  3. ✓Cross-checkedagainst a slow second solution
  4. ✓Mutation testedwrong versions must fail
  5. ✓Reviewedcomplexity, hint leaks, largest input

FAQ

Questions, answered.

What's the difference between the patterns and the practice problems?

The patterns teach: 10 topics, each technique animated step by step on real LeetCode problems. The practice problems test: 1,194 original problems on the same techniques, graded in your browser.

How are the practice problems different from LeetCode?

Every one is new, so you can't have seen the answer. Each names the LeetCode problem whose technique it trains, so your practice still maps onto the standard set.

Is it free?

The patterns are: every topic page, and every editorial with a free account. Every practice problem is free to read and to run in Python or JavaScript. Practice solutions and the compiled languages (Java, C++, Go, Ruby, TypeScript) are part of Pro.

Which languages can I use?

Python 3, JavaScript, TypeScript, Java, C++, Go and Ruby. Python and JavaScript run in your browser; the others run in a sandboxed runner.

Is my progress saved?

Yes, in this browser: the practice problems you've solved, your drafts and your streak. There's no ranking against other people.

Where should I start?

With Arrays if patterns are new to you. Learn a pattern, then open its practice problems from the same page.

10 topics / 1,194 problems / 15,062 tests

Learn one pattern, then prove it.

Watch it run, read when to reach for it, then solve an original problem on it against the tests. Free to read; sign in free to run your code.