Mock Interviews and Spaced Repetition
Two tools, for the two things that reading cannot fix.
Solving problems untimed trains the wrong reflex: you learn to arrive at answers, not to arrive at them in forty-five minutes while talking. And a pattern you understood in March is not a pattern you can produce in June unless you have deliberately revisited it. The first half of this page is a timed round; the second is a review schedule.
The 45-minute round
Section titled “The 45-minute round”The clock is segmented into the four phases from the FAANG interview playbook: 5 minutes clarifying, 8 on the approach, 22 coding, 10 testing. The needle shows where you actually are against where you should be, which is the whole point — most people lose a round by spending 30 minutes coding and 0 testing, and they cannot feel it happening.
A problem is drawn at random from the 424 non-premium problems in the database (83 easy, 269 medium, 72 hard) and the clock starts immediately. You do not get to read it over first, because you do not get that in the round either.
Start a 45-minute round
A problem is drawn at random and the clock starts immediately — no reading it over first, because you do not get that in the round either.
What the judge does and does not do
Section titled “What the judge does and does not do”The Run button executes your code in Pyodide, the same Python runtime the rest of the site uses for its exercises — it is shared, so it is downloaded at most once per page.
There is no hidden test suite. You write your own assertions, and only your assertions are checked. That is deliberate, and it is not a shortcut: writing the cases that would catch your own bug is the skill the testing phase is scored on. A judge that hands you the edge cases removes the thing being practised.
The consequence worth stating: a green run does not mean a correct solution. It means your code agreed with the examples you thought of. If you thought of three and the problem needs five, the round should teach you that, and a rubric line exists for exactly that.
The rubric is self-scored, and that is the weak point
Section titled “The rubric is self-scored, and that is the weak point”Eight lines, ticked by you, immediately after the timer stops. Self-assessment is optimistic by default, so the value is not the total — it is the one line you keep failing. Five rounds in, the pattern in your own history is the signal; a single score is noise.
The rubric is shown the moment you finish and cannot be reached beforehand, because a rubric you have read while coding stops measuring behaviour and starts prompting it.
The recall deck
Section titled “The recall deck”Every spine-complete page in this course ends with a Recall card. Those cards are not a
separate artefact written for a flashcard app — the deck below is generated from the pages
themselves, so a prompt cannot drift from the page it came from. Regenerate with
npm run dsa:recall after editing a page and the deck follows.
The current deck: 140 cards and 1,107 prompts across 22 phases.
____ — The root is the smallest winner, so it is both the eviction candidate and the `k`th largest at the end. Heap type is always the opposite of what you are hunting.
Two kinds of prompt, because the pages have two kinds of bullet
Section titled “Two kinds of prompt, because the pages have two kinds of bullet”Recall cards are written in two shapes, and they want opposite treatment:
| Shape on the page | Count | What the deck shows you |
|---|---|---|
**Cue** — "contiguous" and … — the bold names an aspect | 614 | Front is the aspect, back is the content. A straight question |
**The merge is one pass** — compare the two fronts … — the bold is the claim | 489 | The claim is hidden and the remainder is the front. A cloze deletion |
| A bold-only bullet with no second half | 4 | Kept as a plain fact |
Showing the bold side of the second shape would hand over the answer, which is why it is blanked instead. The split matters more than it looks: assuming every card used the first shape picked up only 37 pages, because a page whose bullets are all claims contributed nothing at all. Handling both finds 140.
Complexity
Section titled “Complexity”The interesting cost here is not time or space — it is your review load per day, which is what determines whether a schedule survives contact with a real week.
An item at rung comes back every days, so a deck of items sitting at rung costs reviews per day. The ladder is days.
| Where the deck sits | Reviews per day, all 1,107 prompts |
|---|---|
| Rung 0 (everything new or lapsed) | 1,107 |
| Rung 2 (7 days) | 158 |
| Rung 4 (35 days) | 32 |
| Rung 6 (160 days, fully mature) | 7 |
The shape of that table is the argument for spaced repetition in one line: the steady-state cost of holding all 1,107 prompts is about seven reviews a day, but only once they are mature. Getting there is the expensive part — reaching the top rung takes days of successful reviews, and a first pass at 40 new prompts a day takes 28 days.
| Operation | Cost |
|---|---|
| Grading one prompt | — one localStorage write |
| Building the due queue | over the selected phase, on every grade |
| Storage | , four small integers per prompt seen |
per grade is not worth optimising at ; it would be at 100,000.
Pitfalls
Section titled “Pitfalls”- Grading “Good” because you recognised it. Recognition is not recall. If you could not have produced the back of the card unprompted, it is “Again”. This single habit decides whether the deck is worth anything.
- Drilling instead of solving. The deck holds statements about patterns. It cannot tell you whether you can implement one under time pressure — only the mock round can. A person with a perfect deck and no timed rounds is not prepared.
- Reading the rubric before you start. It stops being a measurement and becomes a checklist you perform. Score after, or the numbers mean nothing.
- Treating a green judge run as a correct solution. It only means your own assertions passed. See above; this is the most likely way to feel prepared and not be.
- Starting the deck at 200 new prompts a day. Every one of those comes back tomorrow, and again three days later. A fortnight in you have a 400-review backlog and you stop. Twenty to forty a day is a schedule you can actually keep.
- Doing mock rounds only on your strong patterns. Randomly drawn is the point. Filtering to what you like produces a comfortable, useless score.
- Clearing browser data. Both tools store everything locally with no account. The drill
schedule lives under
pch:dsa:drill:v1and round history underpch:dsa:mock:v1, separate from your solved-problem progress so that resetting one cannot damage the other — but a cleared cache takes all three.
Interview follow-ups
Section titled “Interview follow-ups”| Question | What it tests | The answer |
|---|---|---|
| “How do you prepare?” | Whether you have a system or just grind | Timed rounds against a random draw, plus spaced review of the patterns themselves. Name the weak line your last five rounds shared |
| “How long would this take to run on the real input?” | Whether you reason about the budget | Operation count against roughly per second — the complexity cheatsheet has the crossings |
| “You have 10 minutes left and no working code. What now?” | Pacing judgement under pressure | Say it out loud, fall back to the brute force, and get something running. A working beats an unfinished every time |
| “Talk me through how you tested that.” | Whether testing is a habit or an afterthought | Name the categories before the cases: empty, single, duplicates, boundary, and the one the algorithm is fragile at |
| “Which of these patterns is your weakest?” | Self-knowledge, and honesty | Answer with the actual one and what you did about it. A candidate who claims no weak pattern is either inexperienced or not listening |
Practice
Section titled “Practice”Good problems for a first timed round — well-specified, no trick, and each one the plain case of a pattern you should already have:
Work down the ladder. Tick each problem off as you go — progress is saved in this browser, and the Export button in the filter bar writes it to a file you can keep.
- 1Two Sumeasy
- 217Contains Duplicateeasy
- 26Remove Duplicates from Sorted Arrayeasy
- 27Remove Elementeasy
- 88Merge Sorted Arrayeasy
- 125Valid Palindromeeasy
- 219Contains Duplicate IIeasy
- 283Move Zeroeseasy
- 392Is Subsequenceeasy
- 643Maximum Average Subarray Ieasy
- 3Longest Substring Without Repeating Charactersmedium
- 153Summedium
- 11Container With Most Watermedium
- 49Group Anagramsmedium
- 36Valid Sudokumedium
- 80Remove Duplicates from Sorted Array IImedium
- 167Two Sum II - Input Array Is Sortedmedium
- 209Minimum Size Subarray Summedium
- 340Longest Substring with At Most K Distinct Characterspremiummedium
- 424Longest Repeating Character Replacementmedium
- 438Find All Anagrams in a Stringmedium
- 567Permutation in Stringmedium
- 763Partition Labelsmedium
- 846Hand of Straightsmedium
- 904Fruit Into Basketsmedium
- 1004Max Consecutive Ones IIImedium
- 1456Maximum Number of Vowels in a Substring of Given Lengthmedium
- 1493Longest Subarray of 1's After Deleting One Elementmedium
- 1838Frequency of the Most Frequent Elementmedium
- 2013Detect Squaresmedium
- 2461Maximum Sum of Distinct Subarrays With Length Kmedium
Self-check
Section titled “Self-check”-
You reveal a card and immediately think 'oh yes, of course.' You could not have said it unprompted. What do you grade it?
Recognising the answer once it is in front of you is a different and much easier task than producing it. Grading recognition as 'Good' pushes the card out to the next rung, so you will not see it again for weeks, and you still cannot produce it. This is the single most common way a spaced-repetition deck quietly becomes worthless.
pch.quizShowAnswer
A — Again — recognition is not recall — Recognising the answer once it is in front of you is a different and much easier task than producing it. Grading recognition as 'Good' pushes the card out to the next rung, so you will not see it again for weeks, and you still cannot produce it. This is the single most common way a spaced-repetition deck quietly becomes worthless.
-
The judge prints 'all assertions passed'. What does that establish?
There is no hidden test suite — only your own assertions run. That is deliberate, because writing the cases that would catch your own bug is the skill the testing phase exists to train. But it means a green run measures the quality of your test cases as much as the quality of your solution.
pch.quizShowAnswer
A — That your code agrees with the examples you personally thought of — There is no hidden test suite — only your own assertions run. That is deliberate, because writing the cases that would catch your own bug is the skill the testing phase exists to train. But it means a green run measures the quality of your test cases as much as the quality of your solution.
-
All 1,107 prompts are mature at the top rung of 160 days. Roughly how many reviews does a day cost?
A deck of N items each returning every I days costs N/I reviews per day: 1107/160 is about 6.9. That is the whole economic case for spaced repetition — holding the entire course in recall costs a few minutes a day, but only at maturity. Getting there takes 137 days of successful reviews per item.
pch.quizShowAnswer
A — About 7 — A deck of N items each returning every I days costs N/I reviews per day: 1107/160 is about 6.9. That is the whole economic case for spaced repetition — holding the entire course in recall costs a few minutes a day, but only at maturity. Getting there takes 137 days of successful reviews per item.
-
Why does the mock round draw a problem at random rather than letting you choose?
The round is a measurement, and you cannot measure readiness on a problem you picked because you like it. A real loop hands you what it hands you. Filtering by difficulty is offered because pacing differs genuinely between easy and hard, but within a difficulty the draw is blind on purpose.
pch.quizShowAnswer
A — Choosing produces a comfortable score that measures nothing — The round is a measurement, and you cannot measure readiness on a problem you picked because you like it. A real loop hands you what it hands you. Filtering by difficulty is offered because pacing differs genuinely between easy and hard, but within a difficulty the draw is blind on purpose.
-
You have ten minutes left and no working code. What is the best move?
A working brute force with stated complexity is a passable answer; an unfinished optimal one usually is not. Announcing the switch is part of it — it reads as judgement rather than defeat, and it is exactly the pacing decision the phase track is there to make visible before it is too late.
pch.quizShowAnswer
A — Say so, fall back to the brute force, and get something running — A working brute force with stated complexity is a passable answer; an unfinished optimal one usually is not. Announcing the switch is part of it — it reads as judgement rather than defeat, and it is exactly the pacing decision the phase track is there to make visible before it is too late.
Recall card
Section titled “Recall card”- Cue — you can solve the problem but not in 45 minutes, or you knew the pattern last month and cannot produce it now. The first is a pacing failure, the second a retention one.
- The round has four phases — 5 clarify, 8 approach, 22 code, 10 test. Losing a round almost always means 30 minutes of coding and no testing.
- A green judge run proves only that your own assertions passed. There is no hidden suite, so the run measures your test cases as much as your solution.
- Recognition is not recall — if you could not have produced it unprompted, grade it Again. Grading recognition as Good is what makes a deck worthless.
- Review load is per day — 1,107 prompts at the 160-day rung is about 7 a day, but reaching that rung takes 137 days per item. Start at 20-40 new a day, not 200.
- The deck is generated from the pages —
npm run dsa:recall. A prompt cannot drift from its Recall card because it is its Recall card. - Fails when — you drill instead of solving. The deck holds statements about patterns; only a timed round tells you whether you can implement one.
pch.coffeeTagline
pch.coffeeCtapch.feedbackHeading
pch.feedbackSubheading