Skip to content

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 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.

269 problems

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.

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.

1107 due · 0/1107 seen · 0 mature

____ — 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.

0 graded this session

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 pageCountWhat the deck shows you
**Cue**"contiguous" and — the bold names an aspect614Front is the aspect, back is the content. A straight question
**The merge is one pass** — compare the two fronts … — the bold is the claim489The claim is hidden and the remainder is the front. A cloze deletion
A bold-only bullet with no second half4Kept 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.

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 rr comes back every IrI_r days, so a deck of NN items sitting at rung rr costs N/IrN / I_r reviews per day. The ladder is 1,3,7,16,35,75,1601, 3, 7, 16, 35, 75, 160 days.

Where the deck sitsReviews 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 1+3+7+16+35+75=1371+3+7+16+35+75 = 137 days of successful reviews, and a first pass at 40 new prompts a day takes 28 days.

OperationCost
Grading one promptO(1)O(1) — one localStorage write
Building the due queueO(N)O(N) over the selected phase, on every grade
StorageO(N)O(N), four small integers per prompt seen

O(N)O(N) per grade is not worth optimising at N=1,107N = 1{,}107; it would be at 100,000.

  • 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:v1 and round history under pch:dsa:mock:v1, separate from your solved-problem progress so that resetting one cannot damage the other — but a cleared cache takes all three.
QuestionWhat it testsThe answer
“How do you prepare?”Whether you have a system or just grindTimed 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 budgetOperation count against roughly 10810^8 per second — the complexity cheatsheet has the crossings
“You have 10 minutes left and no working code. What now?”Pacing judgement under pressureSay it out loud, fall back to the brute force, and get something running. A working O(n2)O(n^2) beats an unfinished O(n)O(n) every time
“Talk me through how you tested that.”Whether testing is a habit or an afterthoughtName 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 honestyAnswer with the actual one and what you did about it. A candidate who claims no weak pattern is either inexperienced or not listening

Good problems for a first timed round — well-specified, no trick, and each one the plain case of a pattern you should already have:

31 problems
10 easy21 medium0 hard

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.

pch.quizTag pch.quizDefaultTitle
  1. You reveal a card and immediately think 'oh yes, of course.' You could not have said it unprompted. What do you grade it?

    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.

  2. The judge prints 'all assertions passed'. What does that establish?

    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.

  3. All 1,107 prompts are mature at the top rung of 160 days. Roughly how many reviews does a day cost?

    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.

  4. Why does the mock round draw a problem at random rather than letting you choose?

    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.

  5. You have ten minutes left and no working code. What is the best move?

    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.

  • 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 N/IN / I 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 pagesnpm 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.coffeeCta

pch.feedbackHeading

pch.feedbackSubheading