Vault / wiki/301/practice/ccarp/domain-2-claude-models-prompting-context-engineer.md
updated 2026-07-16Practice — CCAR-P Domain 2: Claude Models, Prompting & Context Engineering (13%)
13 scenario-based MCQs. Answer key + explanations at the bottom.
Q1
A retail analytics team must classify 400K customer reviews into 12 fixed sentiment/topic labels every night, with results ready by morning. Cost is the dominant constraint and nothing about the job is interactive. Which design best fits?
A. Run Opus with extended thinking on each review to maximize per-label classification accuracy B. Stream synchronous Sonnet calls from parallel worker processes throughout the night C. Submit Haiku requests with few-shot examples in a cached system prompt via the Message Batches API D. Submit Sonnet requests via the Message Batches API with extended thinking enabled for each review
Q2
You are choosing between a single Opus call and a fleet of parallel Haiku workers for a contract-analysis workload. Which condition most strongly favors the single-Opus design?
A. The analysis needs integrated reasoning across the whole contract and resists decomposition B. The workload is high-volume classification of clauses against a fixed label set C. Each contract section can be scored independently against its own dedicated rubric without reference to the others D. Results are latency-sensitive and would benefit from parallel execution across sections
Q3
A team cached a 40K-token knowledge base in the system prompt. Three weeks later costs spiked: usage logs show sustained high cache_creation_input_tokens and near-zero cache_read_input_tokens, starting the day a commit added a "Current time: {timestamp}" line at the top of the system prompt. What is the root cause?
A. The request now exceeds the four-cache-breakpoint limit, which silently disables caching B. The default 5-minute TTL is expiring between requests at the team's traffic level C. Sustained cache-creation traffic is expected behavior, since writes always precede reads D. Volatile content ahead of the breakpoint invalidates the cached prefix on every request
Q4
A multi-tenant assistant receives roughly one request every 20 minutes per tenant. An architect proposes marking each tenant's 30K-token knowledge base with default ephemeral cache_control. What outcome should you expect?
A. Input costs will drop to roughly 10% of list price on every request after each tenant's first request warms the cache B. Each request re-writes an expired cache at a premium; only the 1-hour TTL tier would make caching pay off C. Caching pays for itself after two reuses of the prefix, regardless of how requests are spaced D. Moving the workload to the Batches API discount makes per-tenant caching unnecessary
Q5
A support assistant's system prompt has grown to 3,200 tokens with roughly 40 "if the user mentions X, do Y" rules. A critical compliance disclaimer is now applied only intermittently, and restating it more emphatically mid-prompt hasn't helped. Which change best addresses the root cause?
A. Anchor the critical rule at the start and end of the prompt and route conditionals to specialized prompts B. Upgrade the assistant from Sonnet to Opus so the model can reliably track a larger rule set C. Repeat the compliance disclaimer verbatim immediately after each conditional rule in the prompt D. Enable extended thinking with a generous token budget so the model deliberates over the complete rule list before each answer
Q6
A zero-shot extraction prompt returns labels with inconsistent casing and synonyms ("Billing", "billing issue", "BILLING"), and downstream code needs exact strings. The instructions are already clear and direct. Following the recommended escalation order of prompt levers, what is the next step?
A. Enable extended thinking so the model reasons about the label format before answering B. Assign a stronger expert persona at the top of the system prompt C. Add 3–5 diverse examples showing the exact output format, down to casing D. Move the workload to a larger model tier with better instruction following
Q7
A document pipeline runs a Haiku routing step, a Sonnet drafting step, and an Opus step that plans complex schema migrations. An engineer enabled extended thinking with a 4,096-token budget on every call; latency and cost jumped while routing accuracy was unchanged. What is the best remediation?
A. Keep thinking enabled everywhere but reduce budget_tokens to 1,024 across all calls B. Consolidate the three steps onto Opus so a single thinking budget is shared C. Disable thinking everywhere and add few-shot examples to the planning step instead D. Keep thinking on the Opus planning step and disable it for routing and drafting
Q8
An extended-thinking agent that uses tools performs well on its first tool call, but its reasoning quality collapses on subsequent turns. Inspection shows the app rebuilds the transcript each turn and strips thinking blocks to save tokens. What is the fix?
A. Raise budget_tokens so the model can re-derive its plan from scratch each turn B. Preserve prior thinking blocks, with their signatures, when replaying the transcript C. Summarize the dropped reasoning into the system prompt as a running plan D. Replace extended thinking with a scratchpad tool the model writes its plan into
Q9
Six production assistants share compliance boilerplate and tone guidelines that were copy-pasted into each system prompt. The copies have drifted, and one assistant shipped with stale legal text. Which prompt-reuse mechanism best fixes this?
A. Mark the shared boilerplate with cache_control so all six assistants read the text from a single cached prefix B. Maintain versioned, individually tested prompt fragments composed into each assistant at build time C. Merge the six assistants into one system prompt with conditional sections per assistant D. Repackage the boilerplate as a skill the model loads when compliance topics come up
Q10
A platform team rolling out Claude Code has written 30 internal workflow guides (~40K tokens total) and pasted them all into the shared CLAUDE.md. Sessions now start slow, and the model frequently ignores individual guides. Which approach best restores reliability?
A. Split the guides between CLAUDE.md and a cached system-prompt block to spread the load B. Register each guide as a slash command that engineers invoke by name when needed C. Package each workflow as a skill so only its description sits in context until a task triggers it D. Spawn a dedicated subagent per workflow with the full guide embedded in its brief
Q11
An assistant answers from a 180K-token stable reference corpus included in every request. Evals show answers grounded in mid-corpus material score much worse than answers grounded near the start or end, and per-request cost is high. Which redesign best addresses both problems while keeping every section of the corpus available to the model?
A. Move the corpus into the user turn so it sits adjacent to each question B. Enable extended thinking so the model attends more carefully to mid-corpus content C. Switch fully to top-K retrieval and drop the corpus from the prompt entirely D. Cache the corpus as a stable prefix and retrieve which sections to focus on per query
Q12
You need a 50KB internal policy document available in every conversation of a compliance assistant. Where should it live?
A. In a system-prompt content block marked with cache_control, ahead of any per-user data B. In the first user turn of every conversation, adjacent to the user's actual question C. Chunked across conversation turns as topics that reference it come up D. Behind a document-fetch tool that the model calls at the start of every conversation
Q13
A RAG-backed knowledge assistant confidently answers questions whose answers are absent from the retrieved context. Which guardrail most directly addresses this failure?
A. Reduce max_tokens so the model cannot elaborate far beyond the retrieved material B. Add grounding rules to answer only from the provided context and say so when the answer is absent C. Increase retrieval top-K so that any material needed to answer is more likely to appear in the retrieved context D. Move the assistant to a larger model tier, which hallucinates less on factual queries
Answers
Q1: C. Offline volume with no SLA is the Batches API case (50% off input and output), Haiku is the cost-aligned tier for fixed-label classification, and few-shot in a cached system prompt is the documented bulk-classification pattern. B forfeits the batch discount for streaming that no one is watching. D pays Sonnet rates plus thinking tokens (billed as output) on a task Haiku handles. A maximizes per-row cost with no accuracy requirement to justify it.
Q2: A. Fleet-of-Haikus economics only win when work decomposes into independent, narrowly scoped subtasks; when reasoning must integrate the whole document at once, you pay for a single stronger model because the task cannot be split without losing cross-section context. C and D are precisely the conditions that favor the Haiku fleet (sectioning/parallelization), and B favors Haiku as the classification tier.
Q3: D. Any change to a cached prefix invalidates it, so a per-request timestamp placed before the breakpoint turns every call into a fresh cache write (~125% of input cost) — exactly matching sustained cache_creation with near-zero reads. B would produce the same signature only if traffic were spaced beyond the TTL, which the correlation with a code commit contradicts. C is backwards — sustained creation traffic is explicitly a churn signal. A misstates the mechanics; the breakpoint limit doesn't silently disable caching.
Q4: B. The default ephemeral cache expires 5 minutes after last use, so at 20-minute spacing the prefix is always cold and every request pays the ~125% write premium with no reads — caching makes costs worse unless the 1-hour TTL tier keeps the prefix warm. A and C ignore TTL: "pays off after ~2 reuses" only holds when reuses land inside the window. D confuses the batch discount (offline throughput) with prefix reuse, and an interactive assistant can't absorb a 24-hour SLA.
Q5: A. This is dilution: dozens of same-priority conditionals cause the model to weight rules poorly, and the documented mitigations are critical rules at the start AND end (primacy + recency) plus splitting conditionals into routed specialized prompts. B treats an architectural problem with a bigger model — a band-aid that fails again as rules accumulate. C adds more same-priority repetition, deepening the dilution. D adds latency and cost without changing how rules are weighted.
Q6: C. The lever order is be-clear-and-direct, then few-shot, then let-Claude-think — and format fidelity is the canonical few-shot use case: examples must show the exact output format down to casing and whitespace. A skips ahead to a costlier lever that targets reasoning, not formatting. B is a later, weaker lever for output-format problems. D is not a prompt lever at all and adds cost without guaranteeing exact strings.
Q7: D. Extended thinking is for hard multi-step reasoning and is explicitly not for high-volume routing; since thinking tokens bill as output tokens, a 4K budget on every call inflates cost with no routing gain. A still pays thinking overhead where it adds nothing. B raises per-token cost across the whole pipeline. C removes thinking from the one step — complex migration planning — where the guidance recommends it.
Q8: B. With tool use, prior thinking blocks and their signatures must be passed back in subsequent turns or Claude loses its reasoning trace — stripping them is exactly the observed failure. A pays more tokens to re-derive what was discarded, with no guarantee of consistency. C loses the signed trace and mutates the stable prefix, churning any cache. D re-architects around a documented API requirement instead of following it.
Q9: B. This is the modular-prompts reuse mechanism: composable fragments that are versioned and tested individually, then assembled per assistant — restoring a single source of truth and eliminating drift. A solves cost, not consistency; each assistant still carries its own diverging copy of the text. C recreates the mega-prompt dilution anti-pattern. D fails because skills load lazily on detected relevance, while compliance guardrails must be unconditionally present in every request.
Q10: C. Skills are lazy: only the name and description sit in context until relevance is detected, so it's cheap to have many, and the model auto-invokes the right guide per task. A still front-loads all 40K tokens — caching cuts cost, not the attention dilution causing ignored guides. B loses auto-invocation: slash commands are user-invoked, so engineers must know and remember each one. D misuses subagents, which isolate task execution rather than make guidance discoverable.
Q11: D. The recommended hybrid pattern caches the long stable corpus (reads at ~10% of input cost) and retrieves pointers to the relevant sections per query, which counters "lost in the middle" by directing attention. A doesn't help — middle-weighting is about position within context, not which turn holds the text. B keeps full cost and the same attention pattern while adding latency. C fixes cost but drops the corpus from the prompt, violating the keep-every-section-available constraint and making retrieval quality the sole bottleneck.
Q12: A. A stable document needed in every conversation is the canonical cached stable-prefix case: a system content block with cache_control, with volatile per-user data placed after the breakpoint. B interleaves stable content with variable input, breaking the prefix alignment that caching depends on. C fragments the doc and loses guaranteed availability for a compliance-critical reference. D adds a round-trip every conversation and lands the doc in a per-conversation tool result instead of a reusable prefix.
Q13: B. Grounding instructions — answer only from <context>, say "I can't find that" when absent, quote exact phrases — are the documented guardrail that dramatically reduces hallucination, and they directly target answering-when-absent. C is the tempting runner-up: it improves recall when the answer exists but does nothing when the corpus genuinely lacks it, which is the failure described. D treats a grounding problem as a capability-tier problem. A limits length, not confident fabrication.