Batch processing strategies
Design efficient batch processing strategies.
This subtopic (4.5) sits in Prompt Engineering & Structured Output (D4) on Anthropic's Claude Certified Architect — Foundations (CCA-F) exam. The bank holds 18 practice questions here — 5 easy, 10 medium, and 3 hard — with 5 free to try, answers and explanations included. 3 of the free questions are below; the rest are in the practice stream.
What the exam tests here
- Message Batches API — 50% cost savings, 24-hour window, no guaranteed latency SLA
- custom_id fields for correlating batch request/response pairs
- batch API does not support multi-turn tool calling within a single request
- batch appropriate for latency-tolerant workloads — not blocking pre-merge checks
Free practice questions: Batch processing strategies
Your CI/CD pipeline submits 500 PR review jobs to the Message Batches API overnight. Each job uses a different CLAUDE.md context. When the JSONL results arrive, some PR comments are posted to the wrong pull request. What is the root cause and fix?
Show answer & explanation
Correct answer: B. Results arrived out of order; match each JSONL line to its PR using the custom_id assigned at submission
Message Batches API results may return out of order — custom_id is the required mechanism to correlate each JSONL result with its originating PR. 'The batch expired...' is a different failure mode. 'CLAUDE.md context was shared...' could cause wrong content but not wrong routing — only missing custom_id correlation causes mismatched posting. 'Output token limit exceeded...' causes truncation, not misrouting.
Your CI/CD pipeline generates PR comments using Claude for both pre-merge blocking checks and nightly report generation. Your team wants to cut token costs using the Message Batches API. Which workload is appropriate for batch processing?
Show answer & explanation
Correct answer: C. Nightly report generation, which is latency-tolerant and benefits from the 50% cost discount
The Message Batches API provides a 50% cost discount but has no guaranteed latency SLA and a 24-hour window — it is designed for latency-tolerant workloads like nightly reports. Pre-merge checks must complete before merge and cannot tolerate unbounded latency. 'Both workloads...' ignores the latency constraint on pre-merge gating. 'Pre-merge checks only when...' misapplies batch processing to a latency-sensitive gate.
Your structured data extraction system submits documents to the Message Batches API. Results arrive out of order. Which field lets you match each result back to its original request?
Show answer & explanation
Correct answer: D. The custom_id field provided when each request was submitted
Results from the Message Batches API may return in a different order than submitted. The custom_id is a developer-provided identifier, unique within the batch, included in every result line so each result can be matched to its original request.
2 more free questions on this subtopic in the practice stream, plus 13 in the full bank. Keep practicing →