About

Algorithms, taught right.

Data structures and algorithms are still the gate. Not because the questions are hard, but because most resources teach the trick and skip the model.

The DSA Handbook is the opinionated, open-source textbook that teaches the model first — then the code, in four mainstream languages. Written in the open. Built to be forked. Chapters published in full under CC BY-SA 4.0.

Chapters
120
Words
338K
Languages
4
Parts
15
01 · Why now

Algorithms, in 2026.

Three forces have changed what an algorithm interview is actually measuring.

The keystrokes are free.AI coding assistants—Copilot, Cursor, Claude Code—will type out a sliding window before you finish reading the prompt. What survives is whether you can name the pattern, justify the complexity, and explain why a deque beats a sorted multiset. The mechanical layer is gone. The reasoning layer is the whole interview.

The bar moved earlier. Two-pointer, sliding window, prefix sum, hash-map — these used to be senior-grade tooling. They are now expected on day one. Internship rounds ask DP. New-grad loops ask graph traversals. The interview level you prep for matters less than whether you can teach the pattern back at a whiteboard.

The pattern set settled. Open up any of the modern prep curricula — Grokking the Coding Interview, NeetCode 150, the AlgoMaster patterns — and you will see the same shortlist: somewhere between fifteen and thirty patterns, depending on how finely you slice them. The overlap is the canon. It isn't a secret. It is textbook material. This handbook treats it that way.

Pattern recognition compounds. Memorising solutions does not.

02 · The problem

What's broken.

The DSA-prep landscape is enormous and uneven. Some resources are solution dumps — thousands of accepted answers with no organising idea behind them, where every problem feels like a one-off trick. Some are video courses behind a paywall — a free trailer, then a $400 funnel, with the actual teaching gated. Some are language-locked — the explanation assumes Python; if you write Java, C++, or Go, you translate as you go and lose the idiom. And some are pattern-dogmatic — a fixed list of N patterns, each forced onto problems it does not actually fit, until the framework starts lying to you.

This handbook is none of those things.

03 · What this is

An open-source textbook on algorithms.

Written as inline Markdown in a public Git repository. Rendered by a static site generator. Every chapter is peer-reviewable, forkable, and translatable. Nothing is paywalled. Every algorithm is taught in plain prose first — the mental model, the invariant, why it works — then implemented in Python, Java, C++, and Go side by side, with animated visualisations where they earn their place.

04 · Positioning

What this is not.

  • Not a solution dump.

    Every pattern is taught from first principles. Problems exist to practise the pattern, not to be memorised one by one. A reader who finishes a chapter can solve problems they have never seen.

  • Not a paid course.

    Every chapter is complete on its own. Nothing is gated, no email is collected, no upsell waits at the end. The text is CC BY-SA 4.0 — remixable and translatable.

  • Not language-locked.

    Every solution is shown in Python, Java, C++, and Go. The language tabs let you compare idioms side-by-side — the algorithm is the constant, the syntax is the variable.

  • Not interview-only.

    This is a textbook for working engineers. Interviews benefit from it; they are not the point. The same patterns ship production code — deduplication, rate limiting, log scanning, range queries, top-K telemetry.

05 · Pedagogy

How chapters are built.

Every chapter follows the same arc. A mental model gives you intuition — the invariant, the picture, the shape of the problem before any code is written. Multi-language code implements the pattern in Python, Java, C++, and Go side by side, so the algorithm reads cleanly in whichever language you write. A problem ladder walks from a representative easy problem to the hard variant interviewers actually ask, with the recognition cue spelled out at every rung. A complexity and pitfalls section names the mistakes that fail submissions and the edge cases that fail interviews.

  1. 01Mental modelInvariant before code.
  2. 02Multi-language codePython, Java, C++, Go side by side.
  3. 03Problem ladderEasy → medium → hard.
  4. 04Complexity & pitfallsWhat fails the submission.

Animated visualisations appear where a static diagram lies — binary-search step-throughs, sliding-window state, recursion trees, heap reshuffles, partition under quickselect. They are optional; the prose stands without them. Reduce-motion preferences are respected everywhere.

06 · Audience

Who this is for.

Starting out

New grads and interns building the algorithmic vocabulary.

  • New graduates targeting their first SDE loop.
  • CS students bridging coursework and interviews.
  • Bootcamp graduates filling the algorithms gap.
  • Career-switchers learning DSA from scratch.
Leveling up

Engineers prepping mid-level loops and on-sites.

  • SDE1 → SDE2 (Amazon L4 → L5).
  • L3 → L4 (Google, Meta).
  • Mid-level engineers refreshing the canon for interviews.
Going deep

Senior engineers and tutors who want a peer-reviewed reference.

  • SDE2 → Senior preparing harder loops.
  • Interviewers calibrating their own bar.
  • Tutors and bootcamp instructors needing forkable material.
07 · Lineage

Influences.

This project stands on the shoulders of others. We do not copy from any of them. We teach the same algorithms in our own words, with our own diagrams, and we cite them.

  1. Cormen, Leiserson, Rivest, Stein
    Introduction to Algorithms, 4th ed. (CLRS)

    The reference textbook for a generation of CS students — described by its publisher as “the leading algorithms text in universities worldwide.” Proof that algorithms can be taught with full mathematical rigour, and reminder that rigour alone is not enough to communicate intuition.

  2. Robert Sedgewick & Kevin Wayne
    Algorithms, 4th ed.

    The cleanest demonstration that visual, code-first teaching scales — with a free Princeton Coursera companion that put rigorous algorithms instruction within reach of anyone with a browser. The implementations in this handbook owe their structure to Sedgewick's discipline of one idea per file.

  3. Jon Bentley
    Programming Pearls

    Originally a column in Communications of the ACM. The model for teaching the thought process, not just the answer. Every chapter here borrows from Bentley's habit of walking the reader through wrong attempts on the way to the right one.

  4. Steven Skiena
    The Algorithm Design Manual

    Skiena's stated emphasis is “design over analysis” — and his “war stories” format proved that a textbook can teach how an algorithm gets discovered, not just what the finished version looks like. The problem-ladder structure here is a direct descendant.

  5. Gayle Laakmann McDowell
    Cracking the Coding Interview

    The book that taught a generation of candidates to think in interview frames rather than chase memorised answers — built from a former Google hiring-committee perspective. The problem-walkthrough cadence here is in conversation with hers.

  6. Donne Martin

    31 000+ stars on GitHub — proof that free, inline content with runnable code (Jupyter notebooks plus Anki decks) reaches more learners than any paywalled course. The open licence and inline-content stance of this handbook owe their courage to that example.

08 · License

License.

ContentCC BY-SA 4.0

Remix, translate, teach from, or build courses on top of this content — with attribution and under the same share-alike licence. Nobody can paywall the chapter text itself.

CodeMIT

The static site generator, templates, and tooling. Use them to build your own handbook if you want.

09 · Participation

How to help.

A 30-minute review from someone who interviews candidates is worth a month of solo writing.

  • Star the GitHub repo.
  • Contribute a fix, an extra language sample, or a new chapter — see the contributing guide.
  • Review a chapter in your strongest language. Idiomatic instincts compress weeks of writing into minutes.
  • Translate a chapter into another language. The licence explicitly permits it.