The interview problem
Design a redaction pipeline for support logs that preserves useful context while minimizing missed sensitive spans.
Original practice, not a reported company interview. Scenarios and numbers are illustrative. Interview date: not applicable. Sources retrieved October 1, 2026.
1. Scope and worked approach
Combine structured-field rules, entity recognizers and customer-specific patterns. Resolve overlapping spans deterministically, replace them with typed placeholders and run a post-redaction scanner. Evaluate authorized samples with tightly controlled access; keep raw text out of ordinary debug logs.
2. Trace the design or derivation
Restricted input → recognizers and rules → span resolution → replacement → residual scan
Choose stable or per-document placeholders deliberately; stable tokens reveal relationships even when values are hidden. Evaluate document-level leakage as well as span recall, because one missed account number can invalidate a document intended for external sharing.
3. Calculate the example
In 200 labeled sensitive spans, 190 are found and 10 missed: recall is 95%. If 20 extra spans are also removed, precision is 190/210 ≈ 90.5%; neither proves an individual document is safe.
4. Failure cases and trade-offs
Unseen identifiers and OCR errors evade recognizers. Over-redaction removes debugging context. Hashing a phone number without a secret can still permit dictionary recovery.
5. Validation, follow-ups and self-review
Test nested entities, fragmented identifiers and multilingual text. Follow-up: should placeholders be linkable across documents? Self-review: explain residual risk, overlap handling and raw-data access.
Sources and related practice
Technical reference: presidio.dataprivacystack.org — Entity recognition/anonymization and limitations of automated detection.
Source publication/update: Not established. Retrieved October 1, 2026. The workflow, calculations and review exercises are original; this reference is not evidence that a company asked this question.
Continue with Debug with redacted customer evidence; Data leakage: when a model knows too much.
Continue your preparation
Choose a connected learning path or browse more ML system design questions. Read our editorial method and attribution policy.