CCAR-F - Prompt Engineering & Structured Output - Section 4.5

Design efficient batch processing strategies.

The Message Batches API gives 50 percent cost savings within a processing window of up to 24 hours and carries no guaranteed latency, which makes it right for overnight reports, weekly audits and nightly test generation and wrong for a blocking pre-merge check. It does not support multi-turn tool calling inside a single request. Candidates should correlate requests and responses by custom_id, resubmit only the failed documents, and refine prompts on a sample before processing volume.

Message Batches API24-hour processing windowno latency SLAcustom_id correlationbatch failure resubmission

Practice question for this objective

Free samplePrompt Engineering & Structured Outputmedium

A platform team runs Claude Code in the CI pipeline of a payments service, where every pull request triggers a blocking review job that must post its comments before the merge gate opens. To cut spend, the team moves that pre-merge review from synchronous API requests to the Message Batches API. Spend falls by roughly half, but the median time from push to posted feedback rises from 40 seconds to 3 hours and 20 minutes, and 64 percent of pull requests are now merged before any comment appears. Which change most effectively addresses this?

  • ASubmit each pull request as a single-request batch and poll the batch status every five seconds, so results are collected the instant processing finishes.
  • BRaise the CI job timeout to four hours so the blocking review job stays open until the batch results arrive and the merge gate cannot open ahead of them.
  • CReturn the pre-merge review to synchronous requests and reserve the Message Batches API for the nightly repository-wide scan, which carries no build-time budget. Correct
  • DSplit each submission into several smaller batches grouped by changed file type, on the basis that a smaller batch is processed proportionally sooner than a large one.
Batch processing trades latency for cost, so only workloads with no build-time deadline belong in the Message Batches API. The Message Batches API is asynchronous: requests are processed within a 24 hour target window with no latency SLA and no promise about when any individual request completes. A pre-merge gate has a hard build-time budget measured in minutes, so its correctness depends on a bounded response time that batching does not offer. The cost saving is therefore available to work that is read after the fact, such as an overnight repository scan.

Why A is wrong: Tempting because a one-request batch feels like the smallest possible unit of work and tight polling feels responsive, but batch processing carries no latency guarantee at any size, so a small batch can still sit for hours and the merge gate still opens first.

Why B is wrong: Tempting because it restores the blocking behaviour the gate depends on, but it holds a runner idle for hours per pull request, delays developers far beyond what the saving is worth, and still fails whenever processing runs past four hours.

Why C is correct: Correct because the batch discount is available in exchange for asynchronous completion, so it can be spent on work whose results are consumed later, while the workload gated on a build-time budget stays synchronous.

Why D is wrong: Tempting because smaller units of work usually finish sooner, but batch completion time is not proportional to request count and no deadline is promised, so the feedback delay is unchanged and the pipeline is now more complex.

See more CCAR-F practice questions, answers explained.

More in this domain

Back to all Prompt Engineering & Structured Output objectives, or the CCAR-F cert hub.

Examworthy is not affiliated with or endorsed by Anthropic. Original, blueprint-aligned practice material only.