The site already told you the schedule exists. The Why this site makes you review article explained the forgetting curve, spacing, and why a “Due” badge means today is the day. It did not explain the algorithm behind that badge. That algorithm has a name, a proof, and uses beyond review queues. Your “Up next” list is a scheduling problem. The question “am I ready to stop practicing and take the interview?” is an optimal-stopping problem. Both have optimal answers. Both are older than you think.
Your review queue is a scheduling problem
Open the home page. The “Up next” list does not sort exercises by when you first met them, how hard they are, or what you feel like doing. It sorts by how due they are: overdue first, then due today, then due in a few days, then new. “Due today”, “Due in N days”, and “overdue” are not UI decoration. They are the output of a scheduling algorithm. The ordering rule is one of the oldest in the book.
Christian and Griffiths, in Algorithms to Live By, state the rule plainly: “start with the task due soonest: Earliest Due Date (EDD), also known as Jackson’s Rule.” The rule is one line: process tasks in due-date order. Your review queue does exactly that. An overdue exercise is already late, so it goes first. An exercise due tomorrow waits behind it. The scheduler needs one number per exercise - when it is next due - and a sort. It also uses a few secondary signals (difficulty and essentialness nudge the ranking), but due-ness leads. The theorem below explains why.
Earliest deadline first, and why it is optimal
EDD is not a folk heuristic. It is the provably best answer to a precise question. Given tasks with durations and deadlines, you want the single most- late task to be as little late as possible - to minimize the maximum lateness. Run the tasks in due-date order. No other ordering can make the worst offender any less late.
The proof is the same exchange argument the greedy article introduced. Start with any schedule that is out of due-date order. Find two adjacent tasks where the later-due task runs first, then swap them. The later-due task moves later and the earlier-due task moves earlier. Since the later-due task had more slack, the maximum lateness does not increase. Repeat until the schedule is in due-date order. That proves EDD is at least as good as every other schedule. The intuition fits in one line: the task that can afford to wait most should wait.
defmodule Schedule do
# Each task is {name, duration, due}. EDD sorts by due date and reports
# each task's finish time and lateness (0 when on time).
def earliest_due_date(tasks) do
{_clock, rows} =
tasks
|> Enum.sort_by(&elem(&1, 2))
|> Enum.reduce({0, []}, fn {name, dur, due}, {clock, acc} ->
finish = clock + dur
{finish, [{name, finish, max(0, finish - due)} | acc]}
end)
Enum.reverse(rows)
end
end
tasks = [{"report", 3, 5}, {"email", 1, 1}, {"review", 2, 3}]
Schedule.earliest_due_date(tasks)
The output is the due-date order - email (due in 1), review (due in 3),
report (due in 5) - and the worst lateness is one day. Run the report
first and the email is three days late. Put the tightest deadline first to
keep the worst case smallest.
Uncertainty makes it easier, not harder
Here is the part people get backward. It explains why a review queue works. Scheduling theory assumed that more knowledge would always help: a full calendar should beat a blank one. But the opposite is often true. With complete foreknowledge, many scheduling problems become intractable. As Algorithms to Live By observes, “the best you can do is much easier to compute” when jobs arrive one at a time and you simply react. The preemptive form of EDD - when a new task arrives that is due sooner than the one you are doing, switch to it - remains optimal in the face of uncertainty.
A review queue has exactly those conditions. Sitting down today, you do not know what you will learn tomorrow, when your next free evening is, or how long the next exercise will take. You do not need to know. The scheduler answers one question: “which thing is due soonest right now?” Then it serves that exercise. The book’s closing line for the chapter says it plainly: “when the future is foggy, it turns out you don’t need a calendar - just a to-do list.” The site’s “Up next” is that to-do list.
When to stop: the 37% rule
Scheduling gives you the order. It does not tell you when you have practiced enough. When do you stop preparing and take the interview? That is a different family - optimal stopping - with a famous answer.
The setup is the secretary problem. You interview applicants one at a time, in random order. After each one, you must hire or reject forever. You can compare applicants with each other, but you have no absolute score. How long do you look before committing? The answer is the 37% rule: look at the first 37% of applicants without hiring anyone, remember the best of them, then hire the first applicant who is better than everyone in that opening phase. Christian and Griffiths put it directly: “what mathematicians call an ‘optimal stopping’ problem, and it may actually have an answer: 37%.”
defmodule Secretary do
def trial(n) do
applicants = Enum.shuffle(1..n)
look = round(n * 0.37)
baseline = applicants |> Enum.take(look) |> Enum.max(fn -> 0 end)
{_rejected, rest} = applicants |> Enum.drop(look) |> Enum.split_while(&(&1 <= baseline))
case rest do
[] -> :none
[hired | _] -> hired
end
end
def success_rate(n, trials) do
Enum.count(1..trials, fn _ -> trial(n) == n end) / trials
end
end
Secretary.success_rate(100, 10_000)
Run it. The empirical success rate lands near 0.37 - the best odds any strategy can reach in the no-information setting, where relative rank is the only signal. The 37% is a rounding of 1/e, the reciprocal of e, a little under 0.368.
The connection to practice is direct. You are the applicant pool, and your readiness is the interviewer. You cannot measure your skill on an absolute scale - and mostly you cannot. Spend the first chunk of preparation gathering data about where you stand without committing to a verdict. Then take the first opportunity where you are clearly better than everything you have done so far. The site is the “gather data” phase: the review schedule, the due badges, and the pass celebrations are the opening 37%, when you look without hiring. The interview is the hire.
Two honest caveats. First, the 37% rule is the no-information answer. Once you have an absolute score - a mock-interview result, a solved-count that correlates with skill - the optimal threshold rises, and the full-information version of the problem succeeds about 58% of the time. A score lets you stop earlier and more confidently. Second, the rule maximizes the chance of picking the single best option, not your expected value when “good enough” is acceptable. In a job search, a good-enough offer taken early often beats waiting for the perfect one. The rule is the baseline for the pure case, not a mandate.
What this means for practice
These algorithms answer different questions. Keep them separate. EDD tells you which exercise to do next - the most overdue one - and it is optimal not because it feels productive, but because it minimizes the worst lateness, which erodes memory. Optimal stopping tells you when preparation is done. Its answer is not “when you feel ready” - feeling is the no-information trap. It is “after you have looked long enough to have a benchmark, then taken the first thing better than the benchmark.”
The site automates the first question and leaves the second to you. The schedule runs on autopilot: due reviews surface without your asking, in the order that keeps the worst forgetting at bay. Scheduling has a closed-form answer the machine can run. No scheduler can tell you when to stop, because stopping needs an absolute judgment of readiness from you, an interviewer, or a mock score. That is why the site nags about reviews and stays silent about the interview. One is a scheduling problem with a theorem behind it; the other is a stopping problem whose answer is a number you must gather data to use.
Where to go next
-
Why this site makes you review
- the forgetting curve and spacing that this article’s scheduler exists to serve.
-
Greedy: when the local choice is the global one
- the exchange argument that proves EDD optimal; EDD is the greedy algorithm for lateness.
-
Algorithms past the interview
- the “take the interview” half of the stopping question, and what the interview actually rewards.
The “Due” badge looks like homework. It is not. It is the tip of a sixty-year-old scheduling theorem - Earliest Deadline First, optimal for keeping your worst lateness small - running quietly against your memory. It does not need your calendar, your mood, or your five-year plan to work. The question it cannot answer, “am I ready?”, belongs to a different theorem with a stranger answer: look for a while without committing, then take the first thing better than everything you have seen. The site runs the first for you. The second is the number you gather and the decision you make.