Design an Asynchronous Batch Inference Service for Model APIs

Last updated: November 29, 2026

Quick Overview

Design a service where customers submit files of up to tens of thousands of model requests, the system processes them within 24 hours using spare inference capacity at a discount, and customers poll for status and download per-request results.

Anthropic
System Design
Software Engineer
Anthropic
November 29, 2026
Software Engineer
Onsite
System Design
Hard

0

0

0 solved


Design a service where customers submit files of up to tens of thousands of model requests, the system processes them within 24 hours using spare inference capacity at a discount, and customers poll for status and download per-request results.

Anthropic offers a Message Batches API that runs large request sets asynchronously at lower cost, which works only if batch traffic soaks up idle accelerator capacity without hurting interactive latency. A senior system design onsite uses this to test job queue design, preemptible scheduling against a shared fleet, exactly-once result accounting, and how you meet a deadline SLA without reserved capacity.

What the Interviewer Expects
  • Defines the API: create batch, get status, cancel, list results, with per-request custom ids
  • Splits a batch into individually tracked requests in a durable queue
  • Schedules batch work into idle capacity with priority below interactive traffic
  • Guarantees each request is billed and recorded once despite retries
  • Tracks the 24-hour deadline and escalates priority for batches at risk
  • Explains result storage, expiry and how partial failures are reported
Key Topics to Cover
job queues
scheduling
idempotency
capacity management
object storage
SLAs
How to Approach This
  1. Start by clarifying functional and non-functional requirements with the interviewer.
  2. Estimate the scale: QPS, storage, bandwidth. This drives your design decisions.
  3. Draw a high-level architecture first, then deep dive into 1-2 critical components.
  4. Discuss trade-offs explicitly (e.g., consistency vs availability, SQL vs NoSQL).
  5. Address failure scenarios, monitoring, and how the system handles 10x traffic spikes.
Possible Follow-up Questions
  • Interactive traffic spikes for six hours and batch progress stops. How do you still meet the deadline?
  • How would you support prompt caching inside a batch where thousands of requests share a long prefix?
  • A customer cancels a batch that is 60 percent done. What happens to in-flight requests and billing?
  • How would you let a batch request use a different model or tools than its siblings?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice System Design Problems
Sample Answer
Requirements

Functional: submit a batch (JSONL of requests with custom_id), poll status with counts per state, cancel, fetch results as JSONL with per-request success or error. Non-functional: up to about 100k r...

High-Level Design

Batch API service validates the upload, stores the raw file in object storage, writes a batch row and fans out one request row per line (state queued) in a sharded metadata database. A scheduler...


Submit Your Answer
Markdown supported