The interview problem

Practice prompt

Design a next-exercise recommender for an adult software-engineering learning platform. Learners have different prerequisite knowledge and limited study time. Recommend useful practice while avoiding repetitive easy questions. Explain learner state, prerequisite constraints and evidence that recommendations improve retained knowledge.

Original ML-design practice, not a reported company interview. Examples and probabilities are hypothetical. Primary research retrieved September 27, 2026; interview date not applicable.

1. Define learning separately from engagement

A click is exposure, a completed exercise is activity, and a correct answer is evidence about performance on that item. None alone proves transferable mastery. Optimize progress toward a learner-selected goal, with delayed retention and unfamiliar transfer tasks as outcomes. Keep completion, satisfaction and study time as useful secondary measures.

Scope the product as practice guidance, not employment screening or formal credential decisions. Learners can override recommendations and inspect why an exercise was suggested. An uncertain model estimate should not permanently lock someone out of advanced material.

Define a content map with skills, prerequisites, difficulty, expected time, accessibility requirements and exercise-family identity. The same template with renamed variables is not independent evidence of transfer. Subject-matter experts validate prerequisite edges and resolve cycles or contradictory labels.

2. Separate state estimation from teaching policy

attempts + hints + timing + content version
                    ↓
          time-correct learner-state estimator
                    ↓
  prerequisite/availability filter → candidate exercises
                    ↓
     learning-value policy + review/exploration slots
                    ↓
          recommendation + reason + event log
                    ↓
       delayed assessment and policy evaluation

Store attempts with item and skill versions, first-attempt correctness, hints, retries and submission times. Distinguish independently solved answers from assisted completion. Update the state once per accepted event with idempotent processing; a retried submission must not create additional evidence.

Begin with transparent rules and simple per-skill estimates. Sequence models can represent richer interaction histories, but require versioned state and reliable event semantics. Deep Knowledge Tracing studies predictive modeling of learner interactions; prediction improvements do not by themselves establish that a recommendation policy causes learning gains.

The serving policy considers uncertain skills, prerequisites, time budget and recent repetition. Include review opportunities and exploration within an approved content set. A failed state lookup falls back to the declared curriculum and learner-selected level, not a fabricated mastery score.

3. Interpret evidence with an explicit toy model

Suppose a latent skill has prior mastery probability 0.4. A mastered learner answers a particular item correctly with probability 0.9; an unmastered learner does so with probability 0.2. After one correct answer, Bayes' rule gives posterior mastery 0.4×0.9/(0.4×0.9+0.6×0.2)=0.75.

If a second distinct item has the same response probabilities and responses are conditionally independent given an unchanged mastery state, another correct answer raises the posterior to 0.75×0.9/(0.75×0.9+0.25×0.2)=27/29≈0.931. This does not mean the learner acquired 53.1 percentage points of knowledge. The calculation updates belief under a fixed-state model; it contains no learning transition.

Repeated attempts on the same item violate the useful independence interpretation, especially after a solution reveal. Real systems need to model or distinguish learning, forgetting, item difficulty and assistance. If the assumed guess/slip rates are wrong, the posterior is not calibrated simply because the arithmetic is correct.

For a prerequisite A→B, a low or uncertain estimate for A can prompt a short diagnostic or review before B. Do not interpret a noisy threshold as a universal prerequisite law. Permit a learner to demonstrate competence with a fresh diagnostic instead of endlessly repeating the same easy exercise.

4. Choose practice under a time budget

In a toy policy, exercise X has predicted expected mastery gain 0.08 in eight minutes, while Y has gain 0.05 in three minutes. Their estimated gains per minute are 0.01 and about 0.0167, so a naive ratio prefers Y. But these gains are counterfactual quantities, not automatically available from a next-answer classifier. They need outcome evidence and uncertainty.

Repeatedly choosing short easy items can improve the ratio while neglecting important hard skills. Apply curriculum coverage, prerequisite and repetition constraints, and evaluate the full learning path. A thirty-minute session may include explanation, practice and delayed review; summing independent exercise gains is unjustified when exercises interact.

Cold-start learners can choose a goal and complete a brief diagnostic, with an option to skip. New content starts with expert annotations and bounded exposure. Avoid inferring low ability from slow responses when interruption, language or accessibility needs explain the timing.

5. Avoid training and evaluation leakage

Train response prediction on prefixes available before the target attempt. Exclude future hints, final-session summaries and later corrected labels from historical features. Use chronological evaluation and prevent closely related exercise templates from appearing on both sides of a transfer test. Fit preprocessing and content statistics within the permitted training window.

Evaluate both returning learners with prior histories and new learners without histories; they answer different deployment questions. A learner-disjoint test alone does not measure adaptation for returning users, while a within-learner future test can hide poor cold-start behavior.

Historical exercise assignment is selective: a teacher or prior policy chose what was shown. Missing responses are not wrong answers. Logged recommendation probabilities can support some off-policy analyses only with overlap and defensible assumptions; a deterministic historical curriculum cannot identify outcomes for unshown alternatives from logs alone.

6. Measure retained progress honestly

Use assessments on a comparable scale before and after the learning period, including delayed retention and new problems testing the same skills. Keep assessment items separate from recommended practice and protect against template memorization. Compare policies on the same objective rather than allowing each to select its easiest exam. Predeclare how baseline scores enter the analysis; a post-test score difference is not itself an individual pre-to-post gain.

Suppose a randomized pilot assigns 100 learners to each policy. Eighty in the new-policy group complete the delayed assessment and average 75/100; ninety controls complete it and average 70/100. The five-point completer difference may be biased by selective attrition; even equal completion rates would not rule out different missing-outcome patterns between arms. With missing scores bounded between zero and 100, the new arm's full-assignment mean lies between 60 and 80, while control lies between 63 and 73. The corresponding difference can range from −13 to +17 points. These are worst-case missingness bounds, not confidence intervals.

Report completion and reasons for missing assessments, analyze uncertainty at the randomization unit and avoid treating repeated attempts as independent learners. Classroom or shared-study spillovers may require a different design. Engagement improvement with no retained-learning evidence supports an engagement claim only.

7. Monitor model and curriculum failures

A stale skill map can send learners to exercises whose prerequisites changed. Version content and state together, and decide how revised or removed items affect existing estimates. Preserve a readable explanation such as “reviewing indexing before query plans” without presenting a hidden model score as a diagnosis.

Watch repeated remedial loops, excessive difficulty, abandoned recommendations, subgroup outcome gaps and state-update delays. Investigate content ambiguity and scoring defects before blaming learners. If a grader changes, revalidate the resulting state transitions and downstream recommendations.

For scale, one million learner profiles with 100 skill records at an illustrative 24 bytes each occupy 2.4 GB of raw state before keys, histories, replication and indexes. Long attempt histories may dominate storage. Keep serving summaries separate from retained research data and follow the product's stated retention and deletion policy.

8. Trade-offs and self-review

Transparent rules are easier to explain but may miss interaction patterns. Complex tracing models can improve prediction while making state harder to audit. Diagnostics improve initial targeting but consume study time. Exploration provides evidence but must remain educationally appropriate.

Follow-ups: Does predicted correctness equal expected learning gain? No. Do two correct retries prove independent mastery evidence? No. Can a five-point completer gain establish a treatment effect despite unequal attrition? Not alone. Should a low estimate permanently block advanced practice? No.

Score 0–2 each for objective choice, state/evidence interpretation, prerequisite policy, leakage controls and delayed-outcome evaluation.

Sources and next steps

Architecture, Bayesian toy example and attrition calculations are original. See missing-data mechanisms for the limits of observed-only comparisons.

Continue your preparation

Choose a connected learning path or browse more ML system design questions. Read our editorial method and attribution policy.