Product preview

Every LeetCode question looks new. Most of them are one of 22 patterns.


If you've solved a hundred problems and still blank on the next one, you've been learning answers. This book teaches the patterns underneath them, one chapter at a time and in the order you need them. It also trains you to tell from a question's wording which pattern it wants.


How it works

Each pattern comes down to two or three templates, short pieces of code with a few slots. You learn each template once. For a new problem you only decide what goes in the slots, such as what to keep track of and when to stop. Every template is drawn step by step on a real example, so you watch the pattern work before you write it.


What's inside

- Big O, then 22 patterns from hash maps and two pointers to graphs and dynamic programming, 23 chapters in all

- 46 templates, each worked through on three problems, plus the mistakes people make with them, each one drawn

- Drills, traces and fill-in pages in every chapter, with all the answers at the back

- 259 LeetCode problems in ladders from warm-up to stretch. You solve each one three times, once as you learn the chapter and twice in review

- A pace for your timeline, such as a Sprint at about 3 hours a day, or the Short path of 18 chapters if your interviews are close

- A Python appendix for interviews, a progress tracker and a week-by-week plan


Who it's for

You can write a loop and use a list and a dictionary, and you have coding interviews coming up. The code is in Python, and every idea carries over to Java, C++, JavaScript or Go.

It's a workbook, so most pages ask for a pen. If you want something to read on the train, this isn't it.


The format

A PDF of about 800 pages at 6 × 9 in. Print it, or write on it in a tablet app like GoodNotes or Notability. Most chapters run about 30 pages, and two pages in five are for you to write on.


$19, one payment. The download link arrives right after checkout.

Meet the creator

DSA Visualized · The 22 patterns behind coding interviews

$19