How the predict-first method works
Before each step runs, you say what you think will happen. Then the real code runs and you find out. That order — commit first, check second — is the whole method, and it is the reason this site is not an animation player.
Last updated
What predict-first means here
Every lesson on this site is built on one artifact: a trace. An algorithm is written once as an ordinary JavaScript function, and when it runs on an input it records each thing it did — this comparison, that swap, this node visited, that cell written — as an ordered list of steps with the state of the data at each one. Nothing about the lesson is drawn by hand. The player, the variable panel, the highlighted line of code and the operation counts are all projections of that same recording.
The Predict layer stops the recording before a step and asks you what comes next: which index gets compared, whether a swap happens here, which node leaves the queue first. You answer, and only then does the step play. Because the question and the correct answer are both read off the trace, there is no answer key that can drift away from the implementation — the right answer is what the code did. The Practice layer works the same way: reorder the real lines of the real function, fill in the line that was removed, or find the single mutation that makes a run go wrong. Nothing you type is executed; your choice is compared against the recorded behaviour of code that already ran.
A lesson is four layers in order — See, Understand, Predict, Practice — and the Understand layer itself ends on a question answered from memory rather than a “got it” button. Questions you have met once join a spaced review deck, so the recall happens again days later rather than only in the minute you first read it.
Why checking a prediction beats watching
The honest reason to prefer this to a nicer animation is that animations have been studied, and the thing that predicts whether they teach anything is not how good they look. The largest systematic review of the field analysed 24 experimental studies of algorithm visualization and concluded that how students use AV technology has a greater impact on effectiveness than what AV technology shows them
[6]. The same review spells out the consequence for products like this one: learners do not stand to benefit from the technology by merely passively viewing visualizations
, no matter how faithful the picture is. A visualizer that only plays is competing on the dimension that was shown not to matter much.
Asking a question instead moves the activity onto the dimension that does. Retrieving an answer is not merely a measurement of what you know; it changes what you will know later. A review of the evidence in medical education puts the mechanism plainly: the act of retrieving targeted information from memory strengthens the ability to use it again in the future, known as the testing effect
, and meta-analytic reviews provide evidence for the benefits of testing over restudy for long-term retention
[1]. Re-watching a sort is restudy. Being asked which two cells are about to be compared is retrieval.
Predicting does something beyond ordinary retrieval, though, and that is why the order matters. A review of predicting as an instructional strategy reports experiments in which the only difference between conditions was whether learners stated their guess before or after seeing the answer, and found that generating a prediction beforehand boosted surprise about the correct answer
[2]. Surprise is not decoration: the same review notes that prediction errors play a key role in knowledge restructuring. Recent neural and computational work makes the link to testing explicit, proposing an account in which testing (vs studying) facilitates predictions about study material and promotes learning from prediction errors
[3].
That is also why the site asks before you have been told, rather than only quizzing afterwards. Pretesting research finds that introducing tests before being exposed to the learning material can be more beneficial than mere re-reading
[4], even though learners get most of those pretest questions wrong. And wrong answers you were confident about are the valuable ones: This enhanced memory for corrective feedback to high-confidence errors is called the hypercorrection effect.
[5] The moment a confident prediction collides with what the real run actually did is the moment the lesson is most likely to stick — which is exactly the moment a play-only visualizer never creates, because it never asked you to commit.
Why a recorded run, not a diagram
A prediction is only worth making if something can genuinely contradict it. If the thing you check against is hand-authored narration, the check degrades into agreeing with the author, and quietly rots the first time the explanation and the implementation disagree. Checking against an execution removes that failure mode by construction: the comparison counts, the swap order and the visit order on these pages were produced by running the function, not typed in next to it.
It also makes the site’s numbers falsifiable rather than decorative. The operation counts behind the comparison pages and the race are tallied from the same traces, and the growth rates they illustrate are the ones described on Big-O notation explained. A sorting test in the repository re-runs every sorting lesson on every input case shown in the UI and asserts the trace ends on a correctly sorted array, so a visualization that drifted away from correct behaviour would fail the build rather than mislead a reader.
Honest limits of the method
The effect is not unconditional. A 2026 study that deliberately included the methodological features known to help — delayed post-tests, corrective feedback, both factual and application questions — still reported that No significant differences were found between groups at delayed test
[7], and attributed the null result to how hard sustained engagement is to obtain outside a classroom. That is the realistic risk for a self-paced website too. Clicking through predictions without actually committing to one should be expected to do roughly nothing.
None of the cited work studied this site. The research above is about retrieval, prediction and algorithm visualization in general. It is the justification for the design, not evidence about its outcomes. No measurement of learning gains on Simple Scope exists, and any claim of one here would be invented.
Step-level prediction teaches mechanics, not judgement. Knowing precisely how quick sort partitions will not tell you when to reach for it, how it behaves on nearly-sorted input in a real system, or how to design an algorithm you have never seen. The lessons deliberately pair the trace with prose, complexity and comparisons, because the trace alone over-teaches the particular input in front of you.
One implementation is one of many. Each lesson follows the classic textbook form of its algorithm in JavaScript. Variants exist, and a different implementation would produce a different, equally valid trace. The about page names the reference each lesson follows.
Sources
Each source below was fetched and read before being cited, and the quoted phrase was confirmed to appear in the published text. Where a paper is behind a paywall, the quotation comes from an openly-available full text of the same article; the DOI link is canonical.
- [1]
S. H. Fraundorf, Z. A. Caddick, T. J. Nokes-Malach, B. M. Rottman (2023). Cognitive perspectives on maintaining physicians' medical expertise: IV. Best practices and open questions in using testing to enhance learning and retention. Cognitive Research: Principles and Implications 8, article 53.
Confirmed phrase: “the act of retrieving targeted information from memory strengthens the ability to use it again in the future, known as the testing effect”
- [2]
G. Brod (2021). Predicting as a learning strategy. Psychonomic Bulletin & Review 28, 1839-1847.
Confirmed phrase: “generating a prediction beforehand boosted surprise about the correct answer”
- [3]
H. Chen, P. Verbeke, S. Mattioni, C. B. Calderon, T. Verguts (2025). Neural and computational evidence for a predictive learning account of the testing effect. Proceedings of the National Academy of Sciences 122, e2506530122.
Confirmed phrase: “testing (vs studying) facilitates predictions about study material and promotes learning from prediction errors”
- [4]
Y. Mera, N. Dianova, E. Marin-Garcia (2025). Testing before learning: Exploring the robustness of the pretesting effect. Memory & Cognition 54, 1334-1356.
Confirmed phrase: “introducing tests before being exposed to the learning material can be more beneficial than mere re-reading”
- [5]
J. Metcalfe, T. S. Eich (2019). Memory and truth: correcting errors with true feedback versus overwriting correct answers with errors. Cognitive Research: Principles and Implications 4, article 4.
Confirmed phrase: “This enhanced memory for corrective feedback to high-confidence errors is called the hypercorrection effect.”
- [6]
C. D. Hundhausen, S. A. Douglas, J. T. Stasko (2002). A Meta-Study of Algorithm Visualization Effectiveness. Journal of Visual Languages & Computing 13, 259-290.
Confirmed phrase: “how students use AV technology has a greater impact on effectiveness than what AV technology shows them”
- [7]
K. Sigayret, J.-F. Parmentier, F. Silvestre (2026). Testing the testing effect on prolific: when retrieval practice fails to boost learning. Frontiers in Psychology 17, 1727423.
Confirmed phrase: “No significant differences were found between groups at delayed test”
Try it
The method is easier to judge than to describe. Open a lesson, skip to its Predict layer and get one wrong on purpose. Binary search is the shortest honest test of it; quick sort is where most people discover their mental model was wrong. The full list of lessons is open from the start.