Design a Pipeline That Extracts Data From 1 Million PDFs a Month
The interviewer asksAn insurer receives 1 million claim PDFs a month and wants key fields extracted automatically. Design it.
Forward Deployed EngineerAI Product EngineerCoreSystem design roundRepresentative15–20 min
On this page
The 30-second version
- Fields, document variety and the cost of a wrong field drive the design.
- Pipeline: parse text and layout → model extracts into a fixed schema → code validates → route.
- Validation: formats, totals that add up, dates that make sense, policy numbers that exist.
- Low-confidence or failed validation goes to a person; corrections become training and eval data.
- Measure field-level accuracy, not document-level.
What it's really testing
- Extraction design
- Validation in code
- Human-in-the-loop routing
How to structure your answer
- Requirements.
- Pipeline.
- Validation and routing.
- Measurement.
The interview, played out
- InterviewerAn insurer receives 1 million claim PDFs a month and wants key fields extracted automatically. Design it.
- CandidateWhich fields, how varied are the documents, and what does a wrong field cost?
- Revealed when asked20 fields; scanned and digital forms from hundreds of providers; a wrong amount causes a wrong payout.
- CandidatePipeline: parse each PDF into text and layout, with OCR for scans. A model extracts the 20 fields into a fixed schema. Then code validates: amounts are numbers, line items add up to the total, dates are plausible, the policy number exists in our system.
- Strong moveUses code to validate what the model extracts.
- CandidateAnything that fails validation or has low confidence goes to a human reviewer with the document and the suspect field highlighted. Corrections feed back into the eval set.
- InterviewerHow do you measure it?
- CandidateField-level accuracy on a labelled set of a few thousand documents, by provider and form type, with amounts measured separately because they matter most.
- Missed signalShould estimate the volume going to humans and the cost per document.
The strong answer, distilled
- Requirements: 20 fields, varied scans and forms, costly amount errors.
- Pipeline: parse/OCR → schema extraction → code validation → route.
- Validation: types, totals, dates, policy lookup.
- Humans: low confidence or failed checks; corrections feed evals.
- Metrics: field-level accuracy by provider and form; amounts separately; share routed to humans and cost per document.
This is one strong answer, not the only one.
How it's scored
| Dimension | Weak (2) | Passable (3) | Strong (5) |
|---|---|---|---|
| Pipeline | One model call | Extract then review | Parse, extract, validate, route |
| Validation | None | Format checks | Business-rule checks in code |
| Measurement | Document accuracy | Field accuracy | Field accuracy by slice, plus human share and cost |
Round scorecard: FDE: AI system design round, filled in for the mock candidate
| Dimension | Weak | Passable | Strong | The mock candidate |
|---|---|---|---|---|
| Requirements | Assumes them. | Asks about scale. | Users, data, scale, latency, cost and risk, before drawing anything. | Strong. Asked which fields, how varied the documents are, and the cost of errors. |
| Architecture | One component. | A reasonable flow. | Full skeleton, then depth on the parts this system depends on. | Strong. Parse, extract with schema, validate, route by confidence. |
| Quality and evals | None. | Mentions testing. | Evals per component and end to end, and how they're built. | Strong. Field-level accuracy on labelled documents. |
| Failure and cost | Ignored. | Mentions one. | Fallbacks, guardrails, latency and cost levers, tied to requirements. | Strong. Human review for low confidence; cost estimate. |
How the answer changes by role
| Role | What to emphasise |
|---|---|
| Forward Deployed EngineerForward Deployed Engineer. An engineer embedded with customers who scopes, builds and ships AI solutions into production. Read the full explanation | Integration with the insurer's systems |
| AI Product Engineer | Validation and review tooling |
Common mistakes
- Trusting extracted amounts without checks
- Document-level accuracy only
- No path for corrections
More follow-ups to practise
- "A new provider's form fails often." Hint: per-provider monitoring; examples in the prompt.
- "Reviewers are overloaded." Hint: tune confidence thresholds by field.
Go deeper
- Module: AI system design
- Framework: AI System Design Framework
- Framework: Opening Any Interview Answer
- Lesson: The shape of an AI system
- Lesson: Designing for failure
- Also tests: Orchestration and routing
- Also tests: Grading: code, judge, human
Sources
Representative question: written to match system design rounds for AI product roles, not a specific reported interview.