The interview problem
A shared AI playground accepts prompts and attachments. A user uploads a 2 GB archive and asks a question about every document inside it. Design ingestion and execution so this request cannot exhaust the web tier, parser fleet or model context budget.
Original practice scenario informed by a second-hand Anthropic playground report posted July 26, 2026; the interview date is unknown. That report mentions oversized input follow-ups. The archive size and all constraints here are invented. Reviewed September 26, 2026.
1. Clarify what “process the whole file” means
Ask whether the user wants exhaustive extraction, a summary, or an answer supported by selected passages. These require different completeness guarantees. Assume private team workspaces, asynchronous processing for large inputs, bounded archive expansion and a visible cost/work estimate before model execution. Upload success does not imply parser success, retrieval completeness or model readiness.
Spend 5 interview minutes on product semantics, 10 on ingestion, 10 on execution budgets, 10 on failures and 10 on collaboration and trade-offs. Start by rejecting unsupported file types and impossible work sizes clearly. “Use RAG” is not a solution when the requirement is to inspect every page and prove none was omitted.
2. Keep large bytes away from synchronous web handlers
A proposed POST /uploads authenticates the workspace and reserves storage quota. It returns a scoped, short-lived upload capability for one new object identity. The client sends parts directly to object storage. Completion verifies expected size and integrity, commits upload metadata and queues scanning/extraction through an outbox. The serving API handles identifiers and progress, not gigabytes of buffered request bodies.
Logical flow: scoped upload → quarantine storage → bounded scan/extraction → immutable document version → chunk/index build → execution plan → model job → cited result. Record separate states such as uploading, quarantined, extracting, ready, rejected and deleted. Use immutable object/version IDs so replacing a filename cannot change an already-approved run's inputs.
Multipart transfer supports resumption, but incomplete uploads need cleanup and quota reconciliation. File extensions and client MIME labels are not trustworthy type checks. Isolate parsers with CPU, memory, execution-time and output-size limits; scan content and reject dangerous nesting or expansion. An archive with a small compressed size can still exhaust disk or memory after decompression.
3. Budget expansion and model work separately
At an illustrative 20 MB/s client upload rate, 2 GB takes at least 100 seconds using decimal units. Moving this outside the web request avoids a long upload occupying an application worker, but does not remove storage or network cost. A 20× expansion would produce 40 GB before text extraction. Enforce both absolute expanded-byte limits and expansion ratios; a ratio limit alone can still admit an enormous archive.
Suppose accepted extraction produces 5 million tokens and a model's illustrative context capacity is 128,000 tokens. Reserving 16,000 for instructions and output leaves 112,000 input tokens, so the document cannot fit in one invocation. Non-overlapping 4,000-token chunks require 1,250 chunks. At 100,000 aggregate processed input tokens/second, reading every token has a lower bound of 50 seconds, excluding output generation, scheduling, retries and reduction.
If each chunk produces 200 summary tokens, the combined summaries contain 250,000 tokens and still do not fit that input budget. Add a hierarchical reduction stage with provenance, or narrow the question. Explain that lossy summaries can miss rare details. For exhaustive extraction, track completion and coverage of every chunk and merge structured results rather than silently dropping chunks.
4. Choose an execution plan with visible limitations
For a targeted question, retrieval selects relevant chunks and the answer cites document version plus page/section offsets. Measure retrieval recall on representative questions; a fluent answer cannot demonstrate that all relevant evidence was retrieved. For broad summarization, process every chunk with bounded concurrency, then reduce and retain links to the underlying evidence. Neither strategy should be described as equivalent to placing the full original document in context.
Persist a run manifest containing exact document versions, prompt revision, model version, policy, token budget and child task IDs. Each task has a deterministic identity and one authoritative result commit. Maintain per-tenant concurrency and total-work budgets so one giant upload cannot monopolize extraction or inference. Cancel outstanding tasks when the user cancels; reconcile already-running work before releasing all reserved quota.
Treat document text as data, including embedded instructions aimed at the assistant. A summarization job should not gain authority to invoke tools or export other workspace documents because an attachment tells it to. Separate retrieval permissions from any explicitly granted action permissions.
5. Make partial failure and access changes explicit
If scanning fails, keep the object quarantined and never index it as ready. If a parser crashes after emitting half the text, publish no completed document version until an extraction manifest is committed. A failed chunk can retry independently; preserve the original version and attempt information so repeated work cannot merge mismatched outputs.
A finished answer must disclose missing sections if the user explicitly accepts partial processing. Otherwise mark the run incomplete and explain which stage failed. A job progress bar based only on uploaded bytes hides most work; show ingestion and analysis separately.
Recheck workspace access when starting jobs and when returning results. Access revocation should stop new reads and invalidate relevant cached results; cancellation may not instantly erase data already loaded by a worker. Deletion marks source versions unavailable immediately, then drives traceable removal from objects, indexes and derived artifacts according to retention rules.
6. Defend the product trade-off
Hard input limits provide predictable costs but reject useful workloads. Asynchronous processing improves capacity management but adds progress, cancellation and retention complexity. Retrieval is efficient for narrow questions; exhaustive processing is expensive but offers a measurable coverage contract. Give users those choices in understandable language rather than exposing internal queue names.
Foundation: distinguish upload size from token count. Senior: recover from a parser crash and a lost completion response. Staff: negotiate completeness, latency and budget for a workspace with uneven tenants. Score 0–2 each for bounded ingestion, versioned state, credible token arithmetic, partial-failure semantics and authorization. Full credit requires a mechanism plus its limit. Continue with file storage and retrieval-grounded answers.
Sources and next steps
- Republished Anthropic playground report — topic provenance only.
- Amazon S3 multipart upload — transfer lifecycle background.
- OWASP file upload guidance — validation and isolation background.
The proposed architecture and worked calculations are our own; context capacity and throughput figures are assumptions, not current product specifications.
Continue your preparation
Choose a connected learning path or browse more System design questions. Read our editorial method and attribution policy.