How to Use This Course & Study Plan Overview
This page is the manual for the course. Read it once now, and come back when you need to pick a plan, set up your problem log, or decide whether to look at a solution. Everything else in the course assumes you know what is on this page.
What the course is
DSA: Zero to Mastery is a complete data-structures-and-algorithms curriculum: 13 modules, about 150 lessons, each one a full Archon page rather than a summary. It starts from "you can write a loop" and ends at competitive-programming techniques and the algorithms inside databases, Git and operating systems. It is built for two readers at once: the engineer preparing for interviews who needs patterns, practice and speed, and the engineer who wants to actually understand why the patterns work and where they run in real systems. Every lesson serves both; the interview reader skims the proofs, the deep reader skims the problem ladders, and both get the same code.
The whole thing is open source. The pages are Markdown in a public repository, the code in every lesson is tested in four languages before it is published, and every numeric claim is checked by a script. If you find something wrong, the fix is a pull request away (see How to get help and contribute).
The 13 modules
The course map at /algorithms/course shows your position and progress. Below is what each module contains, in order. Modules 0 and 1 are live now and linked; the rest are described so you know what is coming.
Module 0 · Foundations (overview). The tools every later lesson assumes: this page; Complexity Analysis: Big-O, Amortized Analysis & Recurrences; Recursion & Mathematical Induction; How Data Structures Live in Memory; Your Language's Data Structures: Python, Java, C++, JavaScript; How to Solve Any Problem: The Method; Testing & Debugging Algorithms; and the Capstone: Benchmark Your Language.
Module 1 · Linear Data Structures (overview). Arrays, strings and everything you lay out in a line: Arrays & Strings, Two Pointers, Sliding Window, Prefix Sums & Difference Arrays, Matrices & 2D Grids, Strings in Depth, Stacks, Queues, Deques & Circular Buffers, Monotonic Stack & Monotonic Deque, Intervals, Linked Lists, Hash Tables & Hashing in Depth, Bloom Filters, Count-Min Sketch & Probabilistic Structures, and the Capstone: Build an LRU Cache & Benchmark It.
Module 2 · Searching & Sorting. Elementary sorts and stability; merge sort and inversion counting; quicksort, partition schemes and introsort; heap sort; non-comparison sorts and the comparison lower bound; sorting in the real world (Timsort, pdqsort, radix sort in databases); binary search mastery; ternary, exponential, interpolation and meet-in-the-middle search; quickselect and order statistics. Capstone: a sorting library with benchmarks.
Module 3 · Trees. Binary trees and traversals; tree problem patterns; binary search trees; AVL and red-black trees; treaps, splay trees and skip lists; heaps and priority queues; tries; segment trees; Fenwick trees; sparse tables, sqrt decomposition and Mo's algorithm; LCA and binary lifting; heavy-light and centroid decomposition; spatial trees (interval trees, k-d trees, quadtrees, R-trees). Capstone: a range-query engine.
Module 4 · Graphs. Graph modelling and implicit graphs; BFS and DFS in depth; topological sort and DAG DP; shortest paths (Dijkstra, Bellman-Ford, Floyd-Warshall, Johnson, A*); union-find; minimum spanning trees; bridges, articulation points and SCCs; Euler and Hamiltonian paths; bipartite matching and the Hungarian algorithm; network flow; 2-SAT and colouring; graph algorithms in the real world. Capstone: Dijkstra on a real road network.
Module 5 · Algorithmic Paradigms. Recursion and backtracking; divide and conquer; greedy algorithms; bit manipulation; randomized algorithms. Capstone: a Sudoku and constraint solver.
Module 6 · Dynamic Programming. Twenty lessons from "state, transition, base case" through knapsack, sequence DP, string DP, grid DP, interval and partition DP, tree DP and rerooting, DP on DAGs, bitmask DP, SOS DP, digit DP, broken-profile DP, counting and probability DP, game DP, matrix exponentiation, the optimisations (monotonic queue, convex hull trick, divide and conquer, Knuth, Aliens), and a lesson on how to debug a DP and find the state. Capstone: a text diff and spell-correct toolkit.
Module 7 · String Algorithms. String hashing; KMP and the prefix function; the Z-algorithm; Aho-Corasick; suffix arrays and LCP; suffix automaton; suffix trees and Ukkonen; palindromes, Manacher and the eertree; minimal rotation, Lyndon words and Booth's algorithm; how regex engines work. Capstone: a mini search index.
Module 8 · Math for Algorithms. Number theory I and II (GCD, sieves, factorisation, Miller-Rabin, Pollard's rho, discrete logs); modular arithmetic; combinatorics; probability and expected value; linear algebra; FFT and NTT; computational geometry; game theory (Nim, Sprague-Grundy, minimax). Capstone: a big-number and modular toolkit.
Module 9 · Advanced Topics. Persistent data structures; online vs offline algorithms; streaming and sketching; cache-efficient and external-memory algorithms; parallel and concurrent algorithms; complexity theory (P, NP, NP-completeness, approximation); heuristics and metaheuristics; linear and integer programming. Capstone: sketches at scale.
Module 10 · Algorithms in the Real World. The algorithms inside databases, Git and diff tools, compression, operating systems and networks, distributed systems, search engines and recommenders, and cryptography. Capstone: write a diff tool.
Module 11 · Interview Mastery. The coding patterns map; problem ladders by pattern; a complexity cheat sheet; mock interview walkthroughs; online assessments and timed contests; the detailed day-by-day study plans (4, 8 and 12 weeks); common mistakes and how interviewers evaluate you.
Module 12 · Competitive Programming Track. Getting started with CP; the techniques toolbox; a practice roadmap by rating from 800 to 2400. Capstone: a virtual contest debrief.
flowchart LR
M0["0 Foundations"] --> M1["1 Linear"]
M1 --> M2["2 Search & sort"]
M2 --> M3["3 Trees"]
M3 --> M4["4 Graphs"]
M4 --> M5["5 Paradigms"]
M5 --> M6["6 DP"]
M6 --> M7["7 Strings"]
M7 --> M8["8 Math"]
M8 --> M9["9 Advanced"]
M9 --> M10["10 Real world"]
M6 --> M11["11 Interview mastery"]
M8 --> M12["12 Competitive track"]
The arrows are the recommended order, not hard dependencies. Module 11 is usable as soon as you have finished Module 6, which is why the crash plan jumps to it from there. Module 12 is for readers who want contest ratings, and it leans on Module 8.
How a lesson is structured
Every algorithm lesson in the course follows the same shape, so that after three or four lessons you can navigate a new one without thinking about it. We call it the Archon signature.
flowchart TD
W["Why this exists"] --> P["Pattern triggers"]
P --> I["Intuition & first principles"]
I --> M["Mechanics: diagram + trace table"]
M --> L["Ladder: brute force → better → optimal"]
L --> C["Correctness proof"]
C --> X["Complexity"]
X --> IMP["Implementation in 4 languages"]
IMP --> R["Real-world uses"]
R --> PF["Pitfalls & edge cases"]
PF --> V["Variations"]
V --> PR["Practice ladder"]
PR --> F["Interview follow-ups + quiz"]
- Why this exists. The problem the technique solves, a little history, where it shows up in real systems.
- Pattern triggers. A table of the literal phrases in a problem statement that should make you think of this technique: "sorted array", "contiguous subarray", "k-th smallest", "minimum number of operations". This is the section interview candidates should drill.
- Intuition and first principles. The idea built from scratch. Analogies are allowed, but every analogy is followed by the precise statement.
- Mechanics. The algorithm itself, a Mermaid diagram, and a trace table: the algorithm run by hand on a small concrete input, one row per step, every state variable a column. The values in trace tables are computed by a script, not typed from memory.
- The ladder: brute force → better → optimal. Each rung has a code idea, its complexity and, most importantly, why it improves on the rung below. Interviewers want to see you climb this ladder out loud; the lessons model it.
- Correctness. A proof or a rigorous proof sketch: a loop invariant, an exchange argument, induction, a potential function. Recursion & Mathematical Induction teaches you how to read and write these.
- Complexity. Time and space, best, average and worst case, amortized where relevant, and a sentence on constants and cache behaviour where it matters. Complexity Analysis teaches you to derive these yourself.
- Implementation. The canonical implementation in Python, Java, C++ and TypeScript, in a tabbed code group. Every block is complete, runnable and self-checking: it has the function and a small
mainwith asserts on the same test data in all four languages. Pseudocode is never used in these blocks. - Real-world uses. Where the technique runs in production: databases, operating systems, browsers, compilers, networking, libraries. These sections link into Archon's system-design and CS pages.
- Pitfalls and edge cases. Off-by-ones, overflow, empty input, duplicates, negative numbers: the mistakes people actually make, not a generic list.
- Variations. The related techniques and exactly how they differ.
- Practice ladder. Eight to fifteen problems from easy to hard, each with the platform (LeetCode, Codeforces, AtCoder, CSES, HackerRank), a one-line description in the lesson author's own words, what it teaches, a collapsed hint, and for the key problems a collapsed solution with code and complexity.
- Common mistakes and interview follow-ups. What the interviewer asks after you finish: "what if the input is a stream?", "what if memory is limited?", "what if there are duplicates?", with short answers.
- Quick quiz and further reading. Three to five questions with collapsed answers, then the sources: books with chapter numbers, cp-algorithms, papers, official documentation, and links to the previous and next lesson.
Guide pages like this one, module overviews and capstones do not use the full signature; they are shorter and shaped for their purpose.
Reading a lesson for the first time
Read sections 1 through 7 in order without touching code. Then open the code group in your language and read the implementation against the trace table until every line is accounted for. Only then go to the practice ladder. People who jump straight to the code tend to memorise it and forget it; people who read the mechanics and the proof first tend to be able to rebuild it.
How progress tracking works
Every lesson has a checkbox in the sidebar and a Mark lesson done & continue button at the bottom of the page. Either one marks the lesson complete and the button also takes you to the next lesson in the module. Completion is stored in your browser, so it survives reloads but does not follow you across devices unless you are signed in.
Each module overview shows a module progress bar (lessons done over lessons in the module), and the course map shows a course progress bar built from all 13 modules. The bars are there for one reason: to make the next action obvious. When you sit down to study, open the course map, find the first module that is not full, and do its first unticked lesson.
Two habits make the tracking honest. First, tick a lesson only when you have done its practice ladder up to at least the medium problems, not when you have finished reading. Second, if you come back to a lesson months later and cannot rebuild the core idea, untick it. The tracker is a model of what you know, not a record of what you have seen.
Three study plans at a glance
The detailed day-by-day versions, with exact problem lists per day and rest days built in, will live in Module 11 as "Study Plans: 4, 8 and 12 Weeks". The week-by-week summaries below are enough to start today. Pick by the time you actually have, not the time you wish you had.
All three plans assume roughly two hours a day, six days a week. The crash plan is tuned for an imminent interview and skips the deep lessons; the standard plan covers everything an interview at a strong company can ask; the deep plan covers the whole course including the real-world and competitive modules.
4-week crash plan
For an interview within a month. Modules 7 to 10 and 12 are skipped; within each covered module only the lessons that appear most in interviews are read.
| Week | Modules | Lessons and focus |
|---|---|---|
| 1 | Module 0, Module 1 | Complexity analysis, recursion and induction, your language's data structures, the method. Then two pointers, sliding window, prefix sums, stacks, queues and deques, monotonic stack, hash tables, linked lists. Skip the two capstones. |
| 2 | Module 2, Module 3 | Binary search mastery, merge sort, quicksort, quickselect. Binary trees and traversals, tree problem patterns, BSTs, heaps and priority queues, tries. Skip balanced BSTs, segment and Fenwick trees. |
| 3 | Module 4, Module 5 | Graph modelling, BFS, DFS, topological sort, shortest paths (Dijkstra and Bellman-Ford only), union-find, MST. Backtracking, divide and conquer, greedy, bit manipulation. |
| 4 | Module 6, Module 11 | DP foundations, 1D DP, knapsack, sequence DP, grid DP, DP debugging. Then the coding patterns map, the complexity cheat sheet, two mock interview walkthroughs, and common mistakes. The last two days are timed mock interviews only. |
8-week standard plan
For a serious interview push or a thorough first pass. Every lesson in Modules 0 to 6 is covered; Modules 7 and 8 are sampled; Module 11 closes.
| Week | Modules | Lessons and focus |
|---|---|---|
| 1 | Module 0 | All seven lessons and the benchmark capstone. Set up the problem log. |
| 2 | Module 1 | All lessons: arrays and strings through probabilistic structures, plus the LRU cache capstone. |
| 3 | Module 2, Module 3 (first half) | All of searching and sorting. Binary trees, tree patterns, BSTs, balanced BSTs. |
| 4 | Module 3 (second half) | Treaps and skip lists, heaps, tries, segment trees, Fenwick trees, sparse tables, LCA, the range-query capstone. Heavy-light and spatial trees are optional. |
| 5 | Module 4 | All of graphs, including flow and matching; the road-network capstone. |
| 6 | Module 5, Module 6 (first half) | All paradigms. DP foundations, 1D DP, knapsack, sequence DP, string DP, grid DP, interval DP, partition DP. |
| 7 | Module 6 (second half), Module 7 (core) | Tree DP, DP on graphs, bitmask DP, counting DP, game DP, DP optimisations, DP debugging. String hashing, KMP, Z-algorithm, Aho-Corasick. |
| 8 | Module 8 (core), Module 11 | Number theory I, modular arithmetic, combinatorics. Then all of Interview Mastery with at least four timed mock interviews. |
12-week deep plan
For mastery, a CP rating, or a reader who wants the whole course. Every module, every lesson, every capstone.
| Week | Modules | Lessons and focus |
|---|---|---|
| 1 | Module 0 | Everything, including re-deriving every complexity in the lesson by hand and running the capstone benchmark in two languages. |
| 2 | Module 1 | Everything plus the LRU capstone; implement the probabilistic structures from scratch. |
| 3 | Module 2 | Everything plus the sorting-library capstone with benchmarks. |
| 4 | Module 3 (lessons 1 to 8) | Binary trees through tries and heaps; start segment trees. |
| 5 | Module 3 (lessons 9 to 14) | Segment trees, Fenwick trees, sparse tables and Mo's algorithm, LCA, heavy-light and centroid decomposition, spatial trees, the range-query capstone. |
| 6 | Module 4 | Everything, including network flow and 2-SAT; the road-network capstone. |
| 7 | Module 5 | Everything plus the Sudoku and constraint-solver capstone. |
| 8 | Module 6 (lessons 1 to 10) | Foundations through tree DP and DP on graphs. |
| 9 | Module 6 (lessons 11 to 20) | Bitmask, SOS, digit, broken-profile, counting, probability and game DP, matrix exponentiation, DP optimisations, DP debugging, the diff toolkit capstone. |
| 10 | Module 7 | All string algorithms plus the mini search index capstone. |
| 11 | Module 8, Module 9 | All of math for algorithms; all of advanced topics; both capstones. |
| 12 | Module 10, Module 11, Module 12 | Algorithms in the real world and its diff-tool capstone; Interview Mastery with mocks; the CP track and a virtual contest debrief. |
Do not stretch a plan to fit a gap
If you have six weeks, do the 4-week plan and spend two weeks on mock interviews and weak spots. Do not do two-thirds of the 8-week plan: it leaves you with no DP and no interview practice, which is the worst possible stopping point.
How to practise
Reading a lesson gives you recognition. Only solving problems gives you recall under pressure, and recall under pressure is what an interview or a contest measures. Four rules.
Spaced repetition
Solve a problem once and you will have forgotten the approach in two weeks. Re-solve it on a schedule and it becomes permanent. Use roughly: 1 day, 3 days, 1 week, 2 weeks, 1 month after the first solve. On each revisit, write the solution from a blank file without looking at your previous one. If you get it right in under half the original time, the next interval doubles; if you fail, reset to 1 day. Most problems need three or four revisits to stick; the ones that keep failing are the ones that teach you most about your gaps.
The problem log
Keep one table, in a spreadsheet or a Markdown file, with a row per problem. The column set that has proved most useful:
| Column | What goes in it |
|---|---|
| Date | First attempt. |
| Problem | Name, platform, link. |
| Lesson | The Archon lesson it belongs to. |
| Pattern | The trigger you recognised (or should have): "sorted + pairs → two pointers". |
| Outcome | solved / solved with hint / read solution / gave up. Be honest; this column drives your revision. |
| Time | Minutes to a passing solution. |
| Complexity | What you achieved, and what was optimal. |
| Mistake | One sentence: the specific thing you got wrong or missed. |
| Next review | Date of the next spaced repetition. |
The Mistake column is the most valuable one in the log. After fifty problems, sort by it; you will find you make the same four or five mistakes, and those become your personal pitfalls list.
How many problems per lesson
The practice ladders have 8 to 15 problems. A good default is: all of the easy ones, all of the mediums, and at least one hard, which is usually six to nine problems per lesson. On the crash plan, do the easies and mediums only and leave hards for the mock-interview week. On the deep plan, do the whole ladder and then two or three more from the platform's tag for that topic.
A problem counts as done when your solution passes, you have stated its complexity, and you have compared it against the lesson's solution. If yours is slower than optimal, write down why in the Mistake column; do not just copy the faster one.
When to look at the solution
Set a timer. For an easy problem, 20 minutes; for a medium, 35; for a hard, 50. These are close to interview time budgets, which is the point. When the timer rings:
- If you have an approach but a bug, keep going for ten more minutes with the testing techniques from Testing & Debugging Algorithms.
- If you have no approach, open the lesson's Hint only. Restart the timer at half.
- If the hint does not unlock it, read the Solution, close it, and write it yourself from memory. Log the outcome as
read solutionand schedule a 1-day review.
Never read a solution before the timer rings. Struggling is not wasted time; it is the only time in which the pattern trigger gets wired to the pattern.
Say it out loud
Narrate your thinking while you solve, even alone. State the brute force and its complexity before you look for anything better. This is exactly what an interviewer wants to hear, and practising it silently does not transfer. How to Solve Any Problem gives the full script.
Which language to use
Every lesson's canonical code is in Python, Java, C++ and TypeScript. Pick one and use it for the whole course. Switching languages halfway resets your muscle memory for the standard library, and the standard library is half of what you type in an interview.
Guidance if you are undecided:
- Python is the fastest to write and read, has the best built-ins for interviews (
collections,heapq,bisect,itertools), and is accepted everywhere. Its weakness is speed: roughly 10⁷ simple operations per second against 10⁸–10⁹ for compiled languages, which matters in contests and in a few interview problems with tight limits. Most interview candidates should use Python unless their target company or role expects otherwise. - Java is the safe choice for companies that interview in Java, and its collections framework is complete and predictable. It is verbose; practise the idioms until
Map<Integer, List<Integer>>no longer slows you down. - C++ is the competitive-programming standard and the fastest. The STL (
vector,unordered_map,priority_queue,std::sort) is excellent once learnt. Use it if you are following the Module 12 track or interviewing for systems roles. - TypeScript/JavaScript is right if that is your production language, especially for front-end roles. Know its gaps: no built-in heap, no sorted map,
Array.prototype.sortneeds a comparator for numbers, andshiftis O(n).
Your Language's Data Structures gives the real complexity of every operation you will call in each of the four, and the cheat sheets for Python and TypeScript cover syntax.
Prerequisites
You need to be able to write loops, functions and classes in one of the four languages, and to use an array, a string and a hash map without thinking about how they work inside. You need high-school algebra; the course derives the logarithms, sums and probability it uses. You do not need calculus, discrete-mathematics coursework or any prior algorithms knowledge.
If the first paragraph does not describe you yet, start with CS Fundamentals, in particular How Computers Work, and come back. Module 0 will then make sense immediately.
How to get help and contribute
The course is developed in the open at github.com/ayush-jadaun/archon.
- Found an error? Open an issue with the page URL and the sentence or line. Numeric and complexity claims are the most valuable to report; each page states where it is uncertain, and a reader who checks is doing exactly what the course asks.
- Want to add a problem, a diagram, a variant, or a language? Open a pull request.
CONTRIBUTING.mdin the repository describes the page format, the code-group rules (every block must run and self-check), and the Mermaid conventions. Expanding a thin section is the single most useful contribution. - Stuck on a problem? The lesson's Hint and Solution are the first stop. After that, the problem's own platform discussion is the place for problem-specific help; the repository issues are for the course itself.
What to do next
Open Complexity Analysis: Big-O, Amortized Analysis & Recurrences. It is the longest lesson in Module 0 and the one every other lesson cites. Before you start it, create your problem log, pick your language, and pick your plan.
The module overview at Module 0 · Foundations shows all eight items and the order to take them. The course map at DSA: Zero to Mastery shows everything else.