← Back

22 Context Management & Reliability Practice Questions & Answers

Every Context Management & Reliability practice question from the Claude Certified Architect – Foundations Practice Test, with the correct answer and a short explanation.

Start practice test
  1. 1. An internal support agent calls a ticketing API twelve times per session. Each response carries more than forty fields, of which the agent uses five, and by the eighth turn requests fail because the context window is full. What is the most effective fix?

    • A.Add a system-prompt instruction telling the model to skip the fields it does not need when it reads a tool result.
    • B.Move the ticketing calls into a subagent that receives the same full payloads and reports them back to the coordinator.
    • C.Reshape each tool's response at the integration layer so that only the defined fields ever reach the model's context.Answer
    • D.Summarize the conversation once context pressure appears so that the earlier tool results are compressed into prose.

    The Messages API is stateless, so the whole history is resent on every request: the unused fields from turn one are still being paid for at turn eight. Trimming each tool to a defined response shape at the integration layer removes that cost before the result ever enters context, whereas instructions, later summarization and subagent routing all still pay for the payload at least once.

    Source: Claude Certified Architect – Foundations Exam Guide, Domain 5, TS 5.1 (tool-result trimming at the integration layer)Report a problem with this question

  2. 2. A research agent works well for its first several tool calls, then starts returning vague, generic answers with no errors in the logs. The team proposes switching to a different model. What is the best first step?

    • A.Move the workload to a model advertised with a larger window and rerun the same session to compare the two outputs.
    • B.Lower the sampling temperature so that a long chain of tool calls produces steadier and more specific final answers.
    • C.Compare the input-token usage the API reports across the run to see whether the window steadily fills as history accumulates.Answer
    • D.Raise the output-token limit on every request so the model has more room to finish the answer it was cut off from.

    Degradation that appears only late in a long run is the signature of context exhaustion, a resource problem, not of model incapability. Usage figures are returned with every response, so the growth of input tokens can be measured directly instead of guessed at; changing model, output cap or temperature all leave the actual cause untouched.

    Source: Claude Certified Architect – Foundations Exam Guide, Domain 5 (context window as a finite resource; usage reporting)Report a problem with this question

  3. 3. A team places a large, stable policy document in the system prompt and enables prompt caching, but almost every request is billed as an uncached read. The system prompt's first line renders the current timestamp. Why is the cache never hit?

    • A.Caching matches a byte-identical prefix, so a timestamp on the first line changes it and voids everything after it.Answer
    • B.Caching is refused for any system block above a certain size, and a long policy document exceeds what one entry holds.
    • C.Caching requires the system block to render before the tool definitions, and a leading timestamp reverses that order.
    • D.Caching only covers the final user message in a request, so text placed in the system prompt is never eligible for reuse.

    Prompt caching is a prefix match: reuse begins at the start of the rendered request and ends at the first byte that differs. A per-request timestamp at the very front means no two requests share a prefix at all, so the entire cached region is invalidated on every call regardless of how stable the rest of the document is.

    Source: Anthropic docs — Prompt caching: cached content is matched as an exact prefix of the rendered requestReport a problem with this question

  4. 4. An assistant sends identical tool definitions and system prompt on every request, plus a per-user profile block that changes with each caller. Given that a request renders as tools, then system, then messages, where should the profile go for the best cache behavior?

    • A.At the top of the system prompt, so the model reads who it is serving before any of its standing instructions.
    • B.Inside each tool description, so that routing decisions can weigh the caller's entitlements while a tool is chosen.
    • C.In a per-user copy of the tool list, so each caller gets a prefix that stays stable for that one caller over time.
    • D.In the messages, after the stable tools and system blocks, so the shared prefix in front of it stays byte-identical.Answer

    Because the cache matches a prefix and the render order is tools, then system, then messages, stable content belongs as early as possible and volatile content as late as possible. Putting the per-user block in the messages leaves the tools and system blocks reusable across all users; putting it in the system block or in the tool list moves the first differing byte to the front and destroys sharing.

    Source: Anthropic docs — Prompt caching: request render order (tools, system, messages) and placement of volatile contentReport a problem with this question

  5. 5. A gateway builds its tools array by iterating a hash map, so the order of the tool definitions varies between worker processes. Cache hit rates are erratic across otherwise identical requests. What is the fix?

    • A.Emit the tool definitions in a fixed deterministic order, because the tools block renders first and a reordering breaks the whole prefix.Answer
    • B.Retry every request once whenever a miss is observed, since the second attempt will reuse whatever the first attempt wrote.
    • C.Add further cache breakpoints deeper in the prompt so that a reordered tools block can still be matched from a later position.
    • D.Move the tool definitions to the end of the request so that their ordering can no longer disturb the stable part of the prefix.

    The tools block is rendered first, so it sits at the head of the cacheable prefix; any reordering changes bytes at the very front and invalidates everything behind it. Deterministic serialization is the only fix, since breakpoints further down cannot rescue a prefix that already differs, and the request cannot be reordered to put tools last.

    Source: Anthropic docs — Prompt caching: silent invalidators (varying tool sets and non-deterministic serialization)Report a problem with this question

  6. 6. An architect wants proof that a newly cached prefix is actually being reused in production rather than merely assumed to be. What confirms it?

    • A.Counting the prompt's tokens locally and subtracting that number from the input total shown on the monthly invoice.
    • B.Diffing the rendered prompt against the previous request and treating two identical strings as proof of reuse.
    • C.Comparing response latency before and after enabling caching and reading a drop as evidence that the prefix was reused.
    • D.Reading the cache-read and cache-write token counts in the usage figures returned with each individual response.Answer

    Every response reports its input tokens split into cache-read and cache-creation counts, which is a direct per-request measurement of whether the prefix was reused. Latency varies for many unrelated reasons, an identical rendered string does not prove the entry still exists, and invoice arithmetic cannot attribute reuse to a particular request.

    Source: Anthropic docs — Prompt caching: verifying cache performance from the usage object (cache_read / cache_creation input tokens)Report a problem with this question

  7. 7. A team wants to cache a short preamble that is assembled fresh for every request and read only once inside that request. What should the architect tell them?

    • A.Caching that preamble helps, because a write and a read are billed identically once the prefix has been registered.
    • B.Caching that preamble adds cost, because a cache write is priced above an uncached read and nothing reads it later.Answer
    • C.Caching that preamble is cost-neutral and only improves latency, so it is worth enabling wherever it is available.
    • D.Caching that preamble saves nothing and adds latency, because a write is an extra step before the model responds.

    The economics run in one direction: a cache read costs materially less than an uncached read, while a cache write costs somewhat more than one. Content that is written but never read again therefore pays the premium without ever collecting the discount, which is why caching is reserved for prefixes that repeat across requests.

    Source: Anthropic docs — Prompt caching pricing direction (cache writes above, cache reads well below uncached input)Report a problem with this question

  8. 8. A long agent session uses compaction. The response comes back with compacted history, but the client stores only the assistant's text and appends it to its own transcript. Later turns behave as if earlier work never happened. What is wrong?

    • A.The compaction threshold is set too low, so history is summarized long before the window is under any real pressure.
    • B.Compaction discards the earlier turns permanently, so the client has to replay the original transcript from its own store.
    • C.The client appends the summary under the wrong role, and a user-role summary is read by the model as a new instruction.
    • D.The blocks the response returns are the new history and must be sent back on the next request, not only the text.Answer

    Compaction rewrites the earlier conversation into a shorter form and hands that result back in the response's content blocks. Those blocks are now the authoritative history, so a caller that keeps only the rendered text silently drops the compacted state and every later request is built on an incomplete transcript.

    Source: Anthropic docs — Compaction: the returned content blocks constitute the conversation history the caller must resendReport a problem with this question

  9. 9. An agent's history holds large tool payloads that are no longer needed, while the assistant's earlier decisions must still be readable word for word. How do clearing and summarizing differ here?

    • A.Clearing drops the older tool results and leaves surrounding turns intact; summarizing rewrites the history into shorter prose.Answer
    • B.Clearing and summarizing both replace earlier turns with a condensed description and differ only in how aggressively they cut.
    • C.Clearing removes every turn before the current one, so any decision taken earlier has to be re-derived by the model from scratch.
    • D.Summarizing drops the older tool results outright, while clearing rewrites the whole conversation into one compact narrative.

    Clearing and summarizing preserve different things. Clearing removes selected old tool results and leaves the rest of the transcript byte for byte, so decisions stay verbatim; summarizing compresses spans of history into new prose, so wording and precise values are at risk. When exact earlier reasoning must survive, clearing is the reduction that keeps it.

    Source: Claude Certified Architect – Foundations Exam Guide, Domain 5 (clearing versus summarizing context)Report a problem with this question

  10. 10. An agent pulls a large financial table through one tool call and needs a handful of exact figures from it three steps later, but the payload is crowding the window. What is the best way to keep those figures?

    • A.Let compaction summarize the payload and instruct the summarizer to preserve every figure a later step is going to need.
    • B.Keep the whole payload in context and add a note naming the rows that actually matter to the steps that remain.
    • C.Clear the tool result now and re-issue the same tool call each time one of the figures is needed by a later step.
    • D.Write the needed figures to a file and keep a short reference in context, so the exact values survive later reduction.Answer

    Externalizing puts the values somewhere that no context reduction can touch and costs only a pointer in the window. Summarization is lossy compression and cannot be instructed into preserving high-precision tokens, re-calling the tool repeats the whole payload each time, and keeping the payload with a note leaves the original pressure exactly where it was.

    Source: Claude Certified Architect – Foundations Exam Guide, Domain 5 (clearing, summarizing, or externalizing context)Report a problem with this question

  11. 11. A retrieval-backed agent was changed from eight retrieved passages per question to fifty. Accuracy fell even though the correct passage is now included more often. What is the best explanation and remedy?

    • A.Recall is still too low at fifty passages, so raise retrieval depth further until the correct passage is always present.
    • B.The model needs permission to skip noise, so keep fifty passages and instruct it to ignore the irrelevant ones.
    • C.Extra passages dilute attention and bury the right one mid-prompt, so retrieve fewer and better-targeted passages.Answer
    • D.The answer is being cut off by the output limit, so raise the output cap until all fifty passages can be used.

    Retrieval is context management, and more retrieved material is not better: every extra passage competes for attention and pushes the decisive text toward the middle of the prompt, where attention is weakest. Precision in what is retrieved beats recall once the correct passage is already usually present.

    Source: Claude Certified Architect – Foundations Exam Guide, Domain 5, TS 5.1 (retrieval scope and positional attention)Report a problem with this question

  12. 12. In a multi-agent research system each subagent returns the full text of every document it read. The coordinator runs out of context before it can synthesize. Where does the fix belong?

    • A.In the subagents: each returns structured findings with claims, sources and dates instead of the documents themselves.Answer
    • B.In the schedule: run fewer subagents at a time so the coordinator receives their full reports in smaller consecutive batches.
    • C.In the model choice: move the coordinator to a model whose window can hold the combined output of all of the subagents.
    • D.In the coordinator: it summarizes each subagent's returned text as soon as that text lands in the coordinator's history.

    Across an agent boundary, context bloat is fixed upstream: the subagent decides what crosses into the coordinator's window. Having it return structured key facts with citations and metadata keeps verbose reading isolated where it happened; summarizing after arrival, batching, or buying a bigger window all pay for the raw text first.

    Source: Claude Certified Architect – Foundations Exam Guide, Domain 5, TS 5.1 (subagents return structured facts, not verbose content)Report a problem with this question

  13. 13. A team sizes its agent's history by dividing the character count by four and trusting that estimate. Requests intermittently fail for exceeding the model's limit. What should they do?

    • A.Truncate the oldest messages whenever a request is rejected and resend it until the request finally goes through.
    • B.Add a fixed safety margin to the character-based estimate so the assembled request stays under the model's limit.
    • C.Adopt a third-party tokenizer library and treat its count as the authoritative size for every model they call.
    • D.Count the tokens of the assembled request with the API's own token counting facility before that request is sent.Answer

    What a prompt actually costs is counted, not estimated: tokenization varies with content and with the model, so a characters-over-four rule is wrong by an unpredictable margin. Counting the assembled request before sending turns a guess into a measurement; margins, retry-on-reject loops and third-party tokenizers all keep guessing.

    Source: Claude Certified Architect – Foundations Exam Guide, Domain 5 (measure context cost rather than estimate it)Report a problem with this question

  14. 14. A support agent runs long sessions with progressive summarization. Transcripts show that a $247.83 refund has become 'a refund' and the customer's 'by Friday' has vanished by turn twenty. What is the most effective fix?

    • A.Instruct the summarizer to preserve amounts, dates and identifiers whenever it compresses an earlier stretch of the session.
    • B.Keep a case-facts block of amounts, dates and identifiers and inject it verbatim into every prompt, outside the summary.Answer
    • C.Summarize less often so that more raw turns survive and the high-precision details stay in the history for longer.
    • D.Ask the customer to restate the amount and the deadline whenever the agent is about to take an action on the case.

    Progressive summarization is lossy compression and it destroys high-precision tokens first: amounts, dates, identifiers and stated expectations. You cannot prompt your way out of that, so the facts that must survive are held in a structured block injected verbatim into every request, while only the surrounding conversation is summarized.

    Source: Claude Certified Architect – Foundations Exam Guide, Domain 5, TS 5.1 (persistent verbatim case-facts block)Report a problem with this question

  15. 15. An agent receives aggregated research in which the decisive finding sits in the middle of a very long input, and it reliably misses that finding. What is the right mitigation?

    • A.Move the workload to a model with a larger window, since weak attention mid-input is a defect of this model.
    • B.Repeat the entire input a second time at the end of the prompt so the finding also lands in an attended position.
    • C.Place a summary of the key findings at the start of the input and mark each section with an explicit header.Answer
    • D.Raise the output limit so the model has room to work through the whole input before it commits to an answer.

    Weak attention to the middle of a long input is a structural property of how prompts are attended, not a defect of one model, so it is mitigated structurally: put a key-findings summary where attention is reliable, at the beginning, and use explicit headers so sections can be located. A bigger window, a larger output cap or a duplicated input leave the position problem in place.

    Source: Claude Certified Architect – Foundations Exam Guide, Domain 5, TS 5.1 (positional attention: structural mitigations)Report a problem with this question

  16. 16. Two subagents each return nothing. One reached the archive and its query matched no records; the other timed out before the archive answered. How should the coordinator treat them?

    • A.Accept both as answered, since the coordinator has no dependable way to know which of the two sources was reached.
    • B.Escalate both to a human reviewer, because an empty result from any source cannot be distinguished from a broken one.
    • C.Retry both of them, since an empty response is the same observable outcome and one more attempt costs very little.
    • D.Retry the timed-out call and accept the empty match as an answer, using the reported failure type to tell them apart.Answer

    An access failure and a valid empty result look identical on the wire but demand opposite handling: the timeout never reached the source and is worth retrying, while the empty match is the answer and retrying it only wastes the window. What separates them is the structured failure type the subagent reports, which is why error contexts carry a category rather than a bare status.

    Source: Claude Certified Architect – Foundations Exam Guide, Domain 5, TS 5.3 (access failure versus valid empty result)Report a problem with this question

  17. 17. A subagent's data source returns a permission error. The subagent returns an empty result set with status 'ok' so that the workflow keeps moving. What is the consequence?

    • A.The coordinator retries that subagent automatically and surfaces the underlying permission error on the second pass.
    • B.The coordinator concludes that the data does not exist and has no path to recover, since the failure never reached it.Answer
    • C.The coordinator records a coverage gap for the topic and notes in the synthesis that one source could not be read.
    • D.The coordinator halts the whole workflow, discarding the partial results the other subagents have already gathered.

    Silently converting a failure into an empty success is the worst outcome in error propagation: the coordinator cannot retry, cannot fall back and cannot annotate coverage, because from its point of view the source was read and held nothing. Structured propagation of the failure type, what was attempted and any partial results is what keeps recovery possible.

    Source: Claude Certified Architect – Foundations Exam Guide, Domain 5, TS 5.3 (silent error suppression anti-pattern)Report a problem with this question

  18. 18. Ten turns into a troubleshooting session the customer writes, 'Just get me a human.' The agent is one tool call away from what looks like a working fix. What should it do?

    • A.Complete the pending tool call first and escalate only if the resulting fix does not resolve the customer's problem.
    • B.Acknowledge the frustration, offer the fix, and escalate only if the customer asks for a person a second time.
    • C.Escalate to a person now and hand over the case facts, since an explicit request for a human is a hard trigger.Answer
    • D.Score the message for sentiment and escalate once the measured frustration crosses the threshold set for the queue.

    An explicit request for a human is one of the few hard escalation triggers and is acted on immediately, without first investigating or proving that the agent could have solved it. Acknowledge-and-offer is the correct handling of frustration alone, and sentiment scoring is not a reliable trigger at all because frustration does not track case complexity.

    Source: Claude Certified Architect – Foundations Exam Guide, Domain 5, TS 5.2 (escalation triggers: explicit human request)Report a problem with this question

  19. 19. A multi-agent pipeline crashes mid-run. On restart the coordinator must rebuild what each agent had established before the crash. What should the design rely on?

    • A.A clean rerun from the original task description, since re-deriving the findings is safer than trusting stale state.
    • B.The stored conversation history of every agent, replayed from its beginning so the run arrives at the same state.
    • C.A manifest of each agent's exported state, loaded on resume and injected into the prompts of the restarted agents.Answer
    • D.The coordinator's own record of what it told each agent, resent as the opening message of each restarted session.

    Crash recovery is designed around structured state persistence, not around transcripts: each agent exports its state to a known location and the coordinator loads a manifest on resume and injects it into the restarted prompts. Replaying history is expensive and may not reproduce the same tool outcomes, and a clean rerun throws away everything the crashed run had already established.

    Source: Claude Certified Architect – Foundations Exam Guide, Domain 5, TS 5.4 (structured state persistence and resume manifests)Report a problem with this question

  20. 20. Two hours into exploring an unfamiliar codebase, the assistant starts citing 'typical patterns' instead of the classes it read earlier and contradicts its own earlier answers. What is the most effective response?

    • A.Persist the findings so far to a scratchpad file and delegate further exploration to a subagent that reports summaries.Answer
    • B.Re-read the main source files at the start of every question so the details always sit in the most recent turns.
    • C.Split the work across two engineers' sessions so that each one keeps a smaller portion of the codebase in view.
    • D.Ask the assistant to be more careful and to cite a file path for every claim it makes about the codebase's design.

    Falling back on generic patterns instead of specific files is the recognized signature of context degradation in an extended session. The countermeasure is to move knowledge out of the window and keep verbose output away from it: a scratchpad the assistant can consult later, plus subagent delegation so exploration output stays isolated. Re-reading files each turn accelerates the same exhaustion.

    Source: Claude Certified Architect – Foundations Exam Guide, Domain 5, TS 5.4 (scratchpads and subagent delegation in large-codebase work)Report a problem with this question

  21. 21. Two subagents report the same metric: one gives 28% from a 2022 study, the other 32% from a 2024 study. How should the synthesis handle the pair?

    • A.Average the two figures and cite both studies, since both sources are credible and neither one can be ruled out.
    • B.Report both values with their sources and collection years, treating the pair as a trend rather than a contradiction.Answer
    • C.Flag the pair as an unresolved conflict and send the question back to the subagent that produced the lower value.
    • D.Report the 2024 figure alone and drop the older one, since the more recent study supersedes the earlier finding.

    Temporal metadata is what distinguishes a conflict from a trend: the same statistic measured in different years is a change over time, and dropping the dates manufactures a contradiction that does not exist. Values from credible sources are annotated with full attribution and carried forward, never averaged and never silently reduced to one.

    Source: Claude Certified Architect – Foundations Exam Guide, Domain 5, TS 5.6 (temporal metadata, provenance, and conflict annotation)Report a problem with this question

  22. 22. An agent with four similar lookup tools frequently calls the wrong one; each tool description is a single short phrase. The team's first instinct is that the context window is too crowded. What should they change first?

    • A.Add a routing model in front of the agent that picks the tool and passes that choice through as a fixed parameter.
    • B.Expand each tool description with input formats, example queries and the boundary against the other three tools.Answer
    • C.Trim the conversation history aggressively so the tool definitions sit closer to the end of the rendered prompt.
    • D.Provide few-shot examples in the system prompt showing which tool was chosen for a dozen past user requests.

    This looks like a context problem but is a tool-design one: descriptions are the primary routing mechanism, and four one-line descriptions give the model nothing to discriminate on. Expanding them with formats, examples and explicit boundaries is the proportionate first move; reordering the prompt, adding a routing layer or reaching for few-shot examples all precede the cheap fix that has not been tried.

    Source: Claude Certified Architect – Foundations Exam Guide, Domain 2 (tool descriptions as the primary routing mechanism)Report a problem with this question

Practice questions based on the official Claude Certified Architect – Foundations (CCAR-F) exam guide and Anthropic's public documentation. This is an independent study tool, not affiliated with or endorsed by Anthropic, and does not grant certification. It is delivered via Pearson VUE; Anthropic publishes the current question count, time limit, passing score and fee in the official CCAR-F exam guide. Official certification page →