CCAO-F Using the Claude API Practice Question
A developer is optimizing a high-volume classification workload on the Claude Messages API. Every request shares a long, static set of instructions and few-shot examples, followed by a short variable user input. The developer wants to cut cost and latency without changing output quality. Which feature should the developer apply?
⚠ Common exam trap
The trap here is assuming any prompt reorganization yields caching benefits, when caching only applies to an identical contiguous prefix and is invalidated by even small changes within it.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Enable prompt caching on the shared instruction and example prefix, placing the variable input after the cached portion.
When many requests share an identical leading block of tokens, prompt caching lets the API reuse the processed prefix. Cache reads cost less and reduce latency, and because the cached content is unchanged, output quality is preserved. The variable input must come after the cached prefix so the cacheable portion stays contiguous. Repositioning content, shrinking output limits, or swapping models does not achieve the same effect without side effects.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Move the static instructions into the system parameter and the few-shot examples into the final user turn.
Why it's wrong here
Relocating instructions and examples changes their position but does not create any reuse across requests, so each call still pays full price for every token. In fact, splitting the stable material can break the contiguous prefix that caching requires. This reorganization adds complexity while leaving the cost and latency problem untouched.
- ✓
Enable prompt caching on the shared instruction and example prefix, placing the variable input after the cached portion.
Why this is correct
Prompt caching stores the processed prefix so subsequent requests reuse it instead of reprocessing those tokens. Cache reads are billed at a reduced rate and reduce time to first token. Because the instructions and examples are identical across requests, caching that prefix while keeping the variable input after it directly lowers cost and latency without altering the model's output.
- ✗
Switch to a smaller model and remove the few-shot examples to compensate for the reduced capability.
Why it's wrong here
Changing models and deleting examples alters behavior and can degrade classification accuracy, which violates the requirement to preserve output quality. This is a quality-for-cost trade rather than an optimization. The developer needs a mechanism that reduces redundant processing of the unchanged prefix while keeping the same model and prompt content.
- ✗
Lower max_tokens to the smallest value that still fits a classification label.
Why it's wrong here
Reducing max_tokens limits output length, and classification labels are short anyway, so the savings are negligible. It does nothing about the large shared prefix, which dominates the token count and therefore the cost and latency in this workload. This choice targets the wrong part of the request and risks truncating valid responses.
About these practice questions
Courseiva writes every CCAO-F question from scratch — 259 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Anthropic exam blueprint
This CCAO-F practice question is part of Courseiva's free Anthropic certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the CCAO-F exam.