Design an Invoice Ingestion and Extraction Pipeline
Last updated: November 29, 2026
Quick Overview
Customers forward vendor invoices to a dedicated inbox or upload PDFs. Design the pipeline that ingests them, extracts header and line item fields, detects duplicates, matches them to purchase orders, and routes exceptions to AP clerks.
ZipHQ
November 29, 20260
0
0 solved
Customers forward vendor invoices to a dedicated inbox or upload PDFs. Design the pipeline that ingests them, extracts header and line item fields, detects duplicates, matches them to purchase orders, and routes exceptions to AP clerks.
Zip's AP product depends on turning unstructured invoices into structured records reliably. The interviewer wants an asynchronous, reprocessable pipeline with a human in the loop where confidence is low, and sensible handling of duplicates since double payment is the costliest failure.
What the Interviewer Expects
- Use asynchronous stages with durable storage of the raw document first
- Combine OCR or layout parsing with an extraction model and per-field confidence
- Detect duplicates on vendor, invoice number, amount and date, not file hash alone
- Route low-confidence or unmatched invoices to a review queue
- Keep everything reprocessable when the model improves
Key Topics to Cover
How to Approach This
- Start by clarifying functional and non-functional requirements with the interviewer.
- Estimate the scale: QPS, storage, bandwidth. This drives your design decisions.
- Draw a high-level architecture first, then deep dive into 1-2 critical components.
- Discuss trade-offs explicitly (e.g., consistency vs availability, SQL vs NoSQL).
- Address failure scenarios, monitoring, and how the system handles 10x traffic spikes.
Possible Follow-up Questions
- How would you measure extraction accuracy in production without labeling everything?
- A vendor sends the same invoice as a PDF and a reminder email a week later. What happens?
- How do you handle a 40-page invoice with 900 line items?
- How would you onboard a new customer whose vendors use unusual layouts?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice System Design ProblemsSample Answer
Requirements
Inputs: email with attachments, uploads, vendor portal. Outputs: invoice record with vendor, number, dates, currency, totals, tax, lines, PO reference, plus a match status. Scale: tens of thousands of...
High-Level Design
- Ingest: inbound email webhook stores raw MIME and attachments in object storage, writes a
documentrow, enqueues work; message id gives idempotency. 2) Classify: is this an invoice, credi...