The interview problem

Practice prompt

Design a review system for externally contributed examples used to train a customer-support intent classifier. Some contributions may deliberately associate an irrelevant marker with an incorrect routing label. Detect suspicious batches, preserve legitimate rare examples and determine which training runs need recovery after a suspicious contribution is discovered.

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

1. Bound the threat and the claim

Assume contributors can submit text and proposed intent labels, but cannot directly modify the training code, trusted evaluation set or release controls. An attacker may distribute related examples across accounts. Ordinary annotation mistakes, genuine domain shifts and rare language patterns are competing explanations. An anomaly is evidence for investigation, not proof of intent.

Distinguish three goals: detect suspicious records or sources, prevent unreviewed data from reaching training, and detect harmful learned behavior before release. These require different measurements. A high record-level detection score does not establish that a released model has no backdoor.

Recent classifier-poisoning research reports cases where malicious learned behavior need not cause an obvious degradation on ordinary robustness tests. This motivates targeted checks and data controls, but does not prove a particular detector works for this support task. Neither the study's attack counts nor its success rates are universal thresholds.

2. Gate immutable contributions before training

contribution → immutable raw record + source identity
                         ↓
              schema / duplicate / label consistency checks
                         ↓
              record signals + source/batch aggregation
                         ↓
                review queue / quarantine / approved version
                         ↓
              frozen training manifest → training run
                         ↓
              independent behavior tests → release gate
                         ↓
              model-to-data lineage and incident recovery

Keep raw bytes, normalized text, label, contributor, batch, timestamps and transformation versions. Record lineage for synthetic paraphrases and relabeled descendants. Store approvals against immutable content versions; changing a row invalidates approval. Training reads a frozen approved manifest, not a live table where a quarantined example can race inclusion.

Before a training run starts, resolve the manifest against the current quarantine policy and capture that decision. Recheck at release using an atomic approval tied to the current policy version, so a concurrent quarantine cannot race model promotion. If a source is quarantined during training, mark the running artifact affected and block its release pending review. Revoking a data approval does not retroactively remove examples already consumed by an optimizer.

Separate authority to submit data, approve labels and promote models. A signed upload proves which identity supplied bytes, not that the labels are correct. Preserve a restricted audit trail so an incident can reconstruct the accepted dataset without broadly exposing customer text.

3. Combine signals without treating novelty as guilt

Start with interpretable checks: repeated text with inconsistent labels, sudden class-distribution changes, unusual repeated substrings, highly similar examples with coordinated label changes and disagreement with an independently curated label rubric. Aggregate by contributor, upload batch, source domain and content family. Account for shared legitimate templates before inferring coordinated manipulation.

A content encoder can identify near-duplicate clusters or distance from known data, while a baseline classifier can highlight label disagreement. Both may inherit the same training contamination or struggle with new products. Keep these as triage features, with independent human adjudication for consequential removal. A detector that rejects all novel language damages exactly the rare cases the dataset needs.

For the support task, compare examples that differ only in an irrelevant marker and inspect whether routing changes despite identical intent. Build these controlled probes from approved benign fixtures. Preserve meaningful differences such as order type or requested action; a perturbation that changes the task is not evidence of a backdoor.

Protect the detector's own evaluation data and version its thresholds. Score distribution shifts can arise from tokenizer changes or new collection channels. Include trusted examples from those channels when investigating, rather than silently raising a global threshold to clear a growing queue.

4. Work through the base-rate problem

Suppose one million contributed records contain 1,000 poisoned examples, a prevalence of 0.1%. A detector with 90% recall finds 900, missing 100. At a 1% false-positive rate on the 999,000 clean records, it flags 9,990 clean records. The review queue has 10,890 records and precision is only 900/10,890≈8.26%.

Reducing the false-positive rate to 0.1% at the same recall would yield 999 clean flags and 1,899 total flags, with precision about 47.39%. Holding recall fixed is a hypothetical comparison, not a free threshold adjustment: real thresholds trade precision against recall. Estimate these rates on representative data and give uncertainty, especially when confirmed poisoning is rare.

At two minutes per flagged record, the first queue costs 21,780 minutes=363 reviewer-hours. Ten reviewers with five productive review hours each day need about 7.26 days to clear one day's queue, assuming no new arrivals or rework. A production system needs batch-level evidence, deduplicated review and a sustainable intake limit, not just a good-looking classifier metric.

Cluster review can reduce repeated work, but approving or rejecting a whole cluster from one example is unsafe when the cluster mixes valid and invalid labels. Sample within clusters, inspect the rule connecting them and retain record-level exceptions and appeal outcomes.

5. Explain why random audits alone can miss sparse contamination

If one million records contain 100 poisoned records, a simple uniform random audit of 1,000 records without replacement has miss probability C(999900,1000)/C(1000000,1000), approximately 0.9999¹⁰⁰⁰≈90.48%. A clean audit is weak evidence that no rare contamination exists.

The independent-draw approximation requires about log(0.05)/log(0.9999)≈29,956 draws for a 95% chance of seeing at least one poisoned record at that prevalence. This is only a detection calculation: the reviewer must still recognize a sampled poison, and adversarial clustering changes how source-level sampling performs. Sampling without replacement uses a finite-population calculation instead. The record-level formula depends on the number of poisoned records, not how they are arranged; clustering matters when the audit samples sources or batches rather than records uniformly.

Combine broad random audits with targeted review of suspicious batches, label transitions and repeated content families. Keep some unbiased audit capacity to discover blind spots. Report targeted-review precision separately from population prevalence; the enriched queue cannot directly estimate how much poison exists in all submissions.

6. Evaluate detection and model behavior separately

Use held-out contributors, time periods and content families so a detector cannot succeed merely by memorizing a known source identity. Include benign rare-language, new-product and accessibility-related text in false-positive analysis. Test detector failures on both isolated suspicious examples and coordinated batches, using harmless intent-routing simulations.

Measure record recall, clean-record rejection, source-level quarantine accuracy, review latency and the fraction of training data with unresolved status. Labels for malicious intent are often uncertain; distinguish confirmed label errors, confirmed controlled test insertions and unresolved real-world suspicion. Do not relabel every reviewed flag as a true attack simply to create a clean benchmark.

For model release, evaluate ordinary intent quality and controlled invariance tests independently. Compare models trained with and without the suspect batch while holding the rest of the recipe fixed, and repeat runs when training variability matters. An improvement after removing a batch supports a causal contribution under that intervention, but does not prove a particular contributor acted maliciously.

Keep development probes separate from withheld tests. Repeatedly tuning the data filter against the same small marker suite can overfit it. Passing known probes establishes only coverage of those probes; it does not establish absence of unknown triggers.

7. Quarantine the data and trace its descendants

Quarantine stops future inclusion of the suspect versions while preserving evidence and a reason code. Trace raw records to normalized examples, paraphrases, training manifests, checkpoints and deployed model versions. If transformation lineage is missing, widen the affected set conservatively and disclose the uncertainty rather than claiming complete removal.

For an affected model, roll back to a verified unaffected artifact where possible. If retraining is required, start from a checkpoint known not to have consumed the suspect data; restarting from the contaminated final checkpoint with a clean dataset is not removal. Data deletion and model unlearning are different claims. A specialized unlearning procedure needs its own validation and cannot be presumed exact.

Prevent quarantined content from reentering through a different account, export or generated descendant. Use content-family links and source restrictions with a path to correct mistaken matches. Restoration requires an explicit review decision, a new approved manifest and regression testing; simply clearing a dashboard alert must not reactivate all descendants.

For a concrete lineage incident, batch B contributes 200 raw records, expanded into 800 derived examples. Runs R1 and R2 include those descendants; R3 uses a manifest frozen before B arrived. Checkpoint C2 descends from R2, so a later run starting from C2 is affected even if its own new-data manifest excludes B. R3 is a rollback candidate only after verifying that its base checkpoint and other sources were also unaffected.

8. Operate the gate under overload and detector failure

If scoring or review is unavailable, place new unapproved batches on hold or continue training from a prior approved snapshot. Do not silently turn detector failure into approval. Set maximum queue age, intake quotas and review priorities, while preserving the distinction between delayed acceptance and rejection.

At one million records/day, average intake is about 11.57 records/s. With a tenfold peak and 50 ms of serial scoring work per record, ideal peak compute demand is about 5.79 worker-seconds per second before overhead. Batch accelerators and caching may change capacity, but review remains the bottleneck in the false-positive example. Monitor both queues.

Version a decision record with contributing signals, reviewer outcome and the exact quarantined scope. Limit sensitive text in general telemetry. Watch for detector drift, source-reset abuse, broken lineage and abrupt clean-data rejection. Give customer teams an explanation grounded in evidence, not an unsupported accusation against a contributor.

9. Trade-offs and follow-ups

Strict quarantine reduces immediate exposure but delays useful new data. Broad source removal is simpler than precise lineage repair but may erase legitimate domain coverage. Expensive retraining provides a clearer recovery boundary than continuing from affected weights, while consuming substantial time and compute. Ensemble detectors help only when their errors are sufficiently different; three models trained on the same contaminated labels can agree for the wrong reason.

Follow-ups: How would you detect a compromised trusted labeling account? What if only a final checkpoint is available? How do you audit generated data whose parent records were discarded? How would you lower review volume without hiding rare failures? Which evidence distinguishes a bad labeling rubric from deliberate manipulation? How do you keep a quarantine from permanently excluding a legitimate new language?

10. Self-review rubric

  • State the contributor's capabilities and separate anomaly from intent.
  • Gate immutable approved versions and prevent training/review races.
  • Combine record, batch and contributor evidence with legitimate novelty checks.
  • Calculate precision and review capacity at the real base rate.
  • Explain sparse-contamination audit limits and targeted-sampling bias.
  • Evaluate detector quality separately from learned model behavior.
  • Trace checkpoint ancestry and avoid claiming that deleting rows repairs weights.

Sources and related practice

Bowers and colleagues: Poisoning Fine-tuning Datasets of Constitutional Classifiers, published April 24, 2026. Used only for the scoped observation that ordinary robustness measurements may miss some backdoored classifiers. It does not validate this proposed detection system. All support-task examples and calculations are original.

Continue with training-data provenance, Bayes and base rates and selection bias.

Continue your preparation

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