Courseiva

Claude Certified Architect - Foundations (CCAR-F) — Questions 1–75

417 questions total · 6 pages · All types, answers revealed

Page 1 of 6

Page 2
1
MCQmedium

During a long refactoring session, a developer realizes Claude Code has been operating with an outdated understanding of a utility module because the file was changed on disk by a teammate's branch merge. The developer wants Claude to re-read the current contents of that file before continuing. Which action accomplishes this most directly?

A.Use the /clear command to reset the session
B.Run the /compact command
C.Restart the Claude Code CLI process
D.Reference the file with the @ symbol in a new prompt
AnswerD

Prefixing a path with @ in a prompt instructs Claude Code to read the current file contents from disk and include them in the context. This refreshes the model's view of that specific module without discarding the rest of the session, which is exactly what the developer needs.

Why this answer

Using the @ reference in a prompt causes Claude Code to read the named file's current contents from disk and inject them into the conversation, updating the model's view without losing session context. Clearing or restarting discards valuable history, and compacting only summarizes dialogue rather than re-reading files.

Exam trap

The trap here is reaching for session-reset commands to fix a stale file view, when a targeted @ file reference refreshes just that file while preserving context.

2
Multi-Selectmedium

You are designing a code-migration assistant that converts legacy COBOL modules to a modern language. Stakeholders require high reliability and verifiable output. Which TWO architectural practices best support this requirement? (Choose two.)

Select 2 answers
A.Request the entire migration in a single response to preserve the model's global understanding of the module.
B.Add an automated test harness that compiles and executes the generated code against representative legacy inputs and compares outputs.
C.Maximize the model's creativity by raising temperature so it can find novel modernization opportunities.
D.Allow the model to omit edge-case handling when the legacy code is ambiguous, to keep outputs concise.
E.Define a fixed output schema for migrated code plus a structured migration report, and validate every response against that schema.
AnswersB, E

Compiling and running generated code against known inputs converts the migration from a text task into an empirically verified one. Behavioral equivalence with the legacy module is the strongest available signal of correctness. This practice catches semantic errors that schema validation alone cannot, making it essential for a pipeline where stakeholders demand verifiable, high-reliability conversion results.

Why this answer

Verifiable migration needs machine-checkable artifacts and empirical proof of behavior. A fixed schema plus structured report makes each response auditable, while a compile-and-execute harness compares generated behavior against known legacy outputs. Together they catch both structural and semantic defects.

Creativity, monolithic responses, and silent omission of edge cases all reduce verifiability rather than strengthen it.

Exam trap

The trap here is treating schema validation as sufficient proof of correctness, when only executing the generated code against known inputs verifies behavioral equivalence.

3
MCQhard

Which mechanism does Claude Code use to maintain session state across multiple prompts during a single refactoring task?

A.It keeps a long-running TCP connection open to the server.
B.It saves the full conversation history to a local SQLite database.
C.It manages conversation history in memory and sends it with each request.
D.It uses a global state variable on the Anthropic API servers.
AnswerC

By keeping the conversation history in the CLI's memory, the client can append new turns and tool outputs to the existing context. Sending this history with each request allows the model to maintain continuity, reference previous actions, and understand the progression of the task without requiring a stateful server.

Why this answer

Claude Code utilizes a stateless API connection, but the CLI maintains session state by managing a conversation history that is passed back to the model with every request. This history includes previous turns, tool outputs, and file modifications. This approach ensures that the model remains aware of previous decisions and code changes, allowing it to perform multi-step refactoring tasks logically and coherently while minimizing unnecessary re-computation of the base context.

Exam trap

Candidates mistakenly believe the API itself maintains persistent server-side sessions, confusing stateless API endpoints with the CLI tool's local conversation history management approach.

4
MCQmedium

An architect is building an agent that uses a 'Plan-and-Execute' pattern. The agent first generates a multi-step plan, then executes each step. During execution, the agent discovers that Step 2 is impossible due to a missing API key. How should the agent be designed to handle this?

A.The agent should skip the failing step and proceed to Step 3 automatically
B.The agent should return to the planning phase to modify the remaining steps
C.The system should hard-crash to ensure the developer is notified of the issue
D.The agent should retry Step 2 indefinitely until the API key is provided
AnswerB

This is the 'Re-planner' pattern. When a failure occurs, the agent should take the error information and feed it back into the planning model. This allows the model to generate an alternative strategy that achieves the goal without the missing API key, or to inform the user about the specific requirement needed.

Why this answer

Dynamic re-planning is a key feature of advanced agentic systems. When an agent encounters an obstacle that prevents the execution of a pre-defined plan, it must be able to recognize the failure, update its internal state, and generate a new plan that either bypasses the problem or addresses the root cause, rather than continuing to attempt a doomed plan.

Exam trap

Candidates often assume the agent should just retry the failed step or throw an error, failing to realize the agent must re-plan based on the new environmental constraint.

5
MCQmedium

An architect is designing an MCP server that exposes a tool to query a customer relationship management (CRM) system. The CRM API enforces per-tenant rate limits and returns HTTP 429 with a Retry-After header when exceeded. The architect wants the tool to behave predictably under load without the model having to reason about throttling. Which approach should the architect implement?

A.Cache every CRM response indefinitely and serve cached data whenever the API returns 429.
B.Return the raw HTTP 429 response body to the model and instruct it in the tool description to retry after a delay.
C.Implement server-side retry with exponential backoff and jitter that honors the Retry-After header, and surface a structured success or failure result to the model.
D.Configure the MCP client to automatically retry the tool call a fixed number of times without any server-side logic.
AnswerC

Handling retries inside the MCP server keeps throttling invisible to the model, honors the server-advertised Retry-After value, and uses jitter to avoid synchronized retry storms across tenants. The model receives a clean result envelope and can focus on the user's task. This is the standard pattern for integrating rate-limited upstream APIs behind a tool.

Why this answer

Rate-limit handling is an integration concern that should be encapsulated in the MCP server so the model never has to reason about HTTP 429 responses or timing. Honoring Retry-After with exponential backoff and jitter prevents synchronized retries and respects the upstream contract. The model then receives a normalized result it can act on, keeping tool behavior predictable under load.

Exam trap

The trap here is assuming the model should interpret transport errors and decide when to retry, when retry policy belongs inside the MCP server.

6
MCQmedium

An architect is designing a multi-agent system where a 'Summarizer' agent is tasked with processing a large document and returning the result to a 'Reporter' agent. To avoid losing the nuances of the original text during the handoff, what is the best strategy?

A.Instruct the Summarizer to provide the output as JSON, including both the summary and references to specific sections of the document.
B.Have the Reporter re-read the original document after receiving the summary to verify the Summarizer's work.
C.Have the Summarizer return a plain-text summary and rely on the Reporter to infer the context.
D.Force the Summarizer to keep the entire original document in its context window while it produces the final report for the Reporter.
AnswerA

Structured output with references ensures that the Reporter can programmatically access the summary while maintaining a link to the source material. This allows for verification of the summary's accuracy and ensures that the Reporter can provide a more grounded and reliable final report.

Why this answer

When handing off work between agents, it is critical to preserve the integrity of the data. By instructing the Summarizer to return its result in a structured format (such as JSON) and including key citations or relevant snippets, the Reporter can verify the summary against the original content. This approach minimizes the risk of 'information loss' that often occurs in multi-turn summarization pipelines, ensuring that the final output is grounded in the source data.

Exam trap

Candidates might suggest that the Summarizer should just append its output to the conversation, which makes it harder for the Reporter to distinguish between original data and processed insights.

7
MCQmedium

A financial firm uses a 'voting' architecture with three parallel calls to Claude Sonnet 5.5 to verify trade compliance. They notice that while the system is accurate, the costs are higher than expected. Which architectural change would most effectively reduce costs without significantly compromising the reliability provided by the voting pattern?

A.Use the Message Batches API to process the votes at a 50% discount.
B.Reduce the 'max_tokens' parameter to 50 for each voter to limit output length.
C.Enable prompt caching for the system prompt and trade guidelines used by all voters.
D.Switch the voting logic to a 'two-pass' system where a second vote only occurs if the first fails a validator.
AnswerD

This is a form of short-circuiting. By validating the first response, you only pay for additional 'votes' when the first one is uncertain. This preserves the accuracy benefits of an ensemble for difficult cases while drastically reducing the cost for straightforward, high-confidence compliance checks.

Why this answer

In a voting pattern most of the cost comes from always running every voter. A conditional or two-pass design runs one vote first and checks it with a validator, calling extra voters only when that first result fails or looks uncertain. Easy, clear-cut compliance checks then cost one call, while hard cases still get the full ensemble, so reliability holds where it matters and average cost falls.

Exam trap

Choosing 'prompt caching' as the answer when the primary cost is from redundant output tokens in a voting ensemble.

8
MCQhard

You are orchestrating a multi-step prompt chain and decide to use prompt caching to optimize performance. Which of the following changes to your request structure will most likely invalidate the cache?

A.Reordering the list of available tools provided in the API request.
B.Adding a new image block to the very last user message in the chain.
C.Increasing the max_tokens parameter for the final response.
D.Updating the user's latest question at the end of the message history.
AnswerA

Prompt caching depends on a strict prefix match of the request structure. Reordering the tool definitions changes the byte-sequence of the request prefix, which will cause the cache to be invalidated. This is why it is critical to keep the tool list stable and in the same order across requests.

Why this answer

Prompt caching is sensitive to the order and content of the request. Any change to the prefix, such as reordering tools, altering the system prompt, or adding a new message at the start of the sequence, will invalidate the cache for all subsequent content. Because the cache relies on a prefix match, the slightest modification to the structure or content of the cached portion forces the system to re-process and re-cache the entire sequence, incurring additional costs and losing the performance benefits.

Exam trap

Candidates often forget that prompt caching is based on a strict prefix match, not just the presence of content within the request.

9
MCQmedium

An analytics platform uses the Message Batches API to run overnight evaluations on 100,000 prompts. Because batch processing is asynchronous and results return out of order, how should the team instrument request tracing to correlate incoming results with internal job IDs?

A.Rely on the strict FIFO order of items returned in the batch results file to match original array indexes.
B.Embed internal trace identifiers in metadata.user_id and filter telemetry logs via the Admin API.
C.Include a cache_control breakpoint on each batch item to force synchronous trace logging.
D.Assign a unique custom_id to each item in the batch request payload and map results using custom_id upon retrieval.
AnswerD

Each individual item in a Message Batches API request accepts a custom_id string. The API guarantees this ID is returned unchanged alongside the result status and message output, enabling exact correlation across asynchronous bulk runs regardless of execution order.

Why this answer

The Message Batches API processes requests asynchronously across a 24-hour window, returning completed results in non-deterministic order. To correlate results back to internal evaluation runs, architects must provide a unique custom_id string in each batch request item. Every result returned by the API retains its original custom_id, allowing downstream observability collectors to map completed, errored, or canceled results back to the source task.

Exam trap

Relying on request order or attempting to use metadata.user_id for business task correlation.

10
MCQeasy

Which property of a well-structured prompt contributes most significantly to the reliability of a model's output in a zero-shot scenario?

A.Using a highly complex and verbose prompt to cover all possible edge cases.
B.Providing clear, domain-specific instructions and output format constraints.
C.Writing the prompt in a conversational tone to make the model feel more comfortable.
D.Omitting examples to allow the model to show its full range of reasoning.
AnswerB

Structured prompts with specific instructions and format requirements (like JSON) drastically improve reliability. By defining exactly what the output should look like, you reduce the model's freedom to hallucinate or deviate from the desired format. This level of clarity is the gold standard for production-ready prompt engineering.

Why this answer

Clear, role-based, and specific instructions define the 'context' in which the model operates. Providing explicit constraints (such as 'no markdown', 'format as JSON', or 'be concise') reduces ambiguity. Reliability is highest when the model's output space is narrow and clearly defined.

Without these constraints, models may interpret requests differently, leading to unpredictable formatting or content that violates the requirements of the downstream consuming application.

Exam trap

Candidates often assume the model will implicitly understand the output format, failing to realize that explicit, domain-specific constraints are required to eliminate ambiguity in zero-shot scenarios.

11
MCQhard

An orchestrator-workers system is being designed to handle incoming support tickets. The orchestrator delegates specific tickets to specialized workers based on the ticket category. When should the architect use a 'workflow' instead of an 'agent' for this delegation process?

A.When the system needs to learn from previous ticket resolutions.
B.When the routing logic is based on static, clear-cut business rules.
C.When the ticket categories are ambiguous and require complex reasoning.
D.When the number of workers is expected to change frequently.
AnswerB

Deterministic workflows are ideal for rule-based processes. If the routing logic can be expressed as a set of clear, static rules, a workflow provides predictable, efficient, and cost-effective performance compared to an agent, which would introduce unnecessary overhead and non-determinism into a simple routing task.

Why this answer

A workflow (a deterministic chain) is preferred when the routing logic is predictable, follows clear business rules, and does not require the model to make autonomous decisions about which worker to choose. If the ticket categories are well-defined and the routing path is static, a deterministic workflow is more reliable, easier to monitor, and cheaper to run than an agent that must 'think' to decide how to handle each ticket. Agents should be reserved for scenarios where the task is open-ended and requires autonomous decision-making.

Exam trap

Candidates often equate 'orchestrator' with 'agent', failing to recognize that an orchestrator can be a simple, deterministic function.

12
MCQeasy

A development team is building a high-volume automated classification service using Claude Haiku 5.5. The service processes millions of simple text items daily. Management mandates reducing token expenditure per request as much as possible. Which parameter adjustment offers the most direct and effective first lever to lower cost within the model?

A.Migrate the task from Claude Haiku 5.5 to Claude Opus 5.5 to benefit from better native token efficiency algorithms.
B.Set the sampling temperature parameter to zero to minimize token variance and prevent redundant reasoning loops.
C.Force the API to disable thinking entirely by passing a custom disabled flag in the model configuration block.
D.Lower the output_config.effort setting to reduce the depth of adaptive thinking and decrease token spend.
AnswerD

Lowering effort directly decreases the number of tokens spent on adaptive thinking during execution. This provides a fast, efficient, and model-native way to reduce operational costs for high-volume simple classification tasks.

Why this answer

Current models use adaptive thinking where output_config.effort controls thinking depth and overall token spend. Lowering the effort setting reduces token consumption, latency, and cost for simpler tasks. For a high-volume, low-complexity classification pipeline using Claude Haiku 5.5, reducing effort is the most direct architectural lever before attempting more complex model switches or risky parameter tweaks.

Exam trap

Candidates often look for legacy parameters like temperature settings or budget tokens, ignoring that sampling parameters are not accepted on current models and adaptive effort controls token expenditure.

13
MCQmedium

When implementing an MCP resource that provides large datasets, what is the best practice for managing data transmission to avoid hitting context window limits?

A.Serialize the entire dataset into a single JSON object and return it.
B.Implement a paginated or filterable resource endpoint.
C.Compress the data using GZIP before sending it to the model.
D.Store the data in an external database and provide the connection string.
AnswerB

Pagination and filtering allow for the controlled retrieval of data, ensuring the model only receives the specific information it currently requires. This architectural pattern optimizes token usage, improves response times, and keeps the overall model performance stable even when working with extremely large underlying data sources.

Why this answer

MCP resources should implement pagination or selective filtering to return only necessary data. By breaking down massive datasets into granular chunks, the architect prevents the model from consuming excessive tokens with irrelevant information. This pattern ensures the model remains focused on the relevant data subset, preserving context window capacity for actual reasoning and reducing latency during the tool-use lifecycle.

Exam trap

Test-takers frequently assume that passing an entire raw dataset to the model is safe, forgetting the hard limitations of context window sizes.

14
Multi-Selectmedium

An architect is optimizing a multi-agent system for a legal firm. The system uses a 'Router' agent followed by several 'Specialist' agents. Which THREE techniques will most effectively minimize latency in this specific architecture?

Select 3 answers
A.Implement prompt caching for the specialist agents' long system prompts
B.Use Claude 3.5 Haiku for the initial routing decision
C.Execute multiple specialist agents in parallel when their tasks are independent
D.Set 'max_tokens' to 1 for the specialist agents' responses
E.Force the model to use the 'computer_20241022' beta tool for all lookups
AnswersA, B, C

Specialist agents often require extensive context and detailed instructions that remain static across many requests. By using prompt caching, the architect ensures that these large prompts are not re-processed for every turn, drastically reducing the latency and cost of the specialist phase in a multi-agent conversation.

Why this answer

Latency is a primary concern in multi-agent systems due to the sequential nature of LLM calls. Prompt caching significantly reduces time-to-first-token for large system instructions, while selecting faster models like Claude 3.5 Haiku for routing tasks and executing independent specialist tasks in parallel ensures the overall workflow remains responsive and efficient for the end-user.

Exam trap

Candidates often focus on model intelligence for all steps, ignoring that routing should be fast and that prompt caching is essential for minimizing latency in multi-agent systems.

15
MCQeasy

In a long-running agentic workflow, why is it recommended to place the high-level 'rules of engagement' and system persona in the top-level system parameter rather than within the conversation history?

A.The top-level system parameter is cached automatically, whereas content in the conversation history is never eligible for caching.
B.Placing instructions in the message history consumes significantly more tokens than placing them in the top-level system parameter.
C.It ensures the model consistently follows the persona and safety constraints throughout the entire long-running session, even as the history grows.
D.The model only reads the top-level system parameter at the very beginning of the interaction and ignores any instructions found later in the messages.
AnswerC

The system parameter is the correct location for high-level instructions that should govern the entire agent behavior. Keeping these rules separate from the conversation history ensures they are always in context and not subject to being lost or diluted as the long-running conversation evolves and expands.

Why this answer

The top-level system parameter is designed specifically to hold operator instructions that persist throughout the interaction. Placing these rules here ensures they are always present and prioritized by the model, regardless of how long the conversation history grows. If these instructions were included in the message history, they might be pushed out of the context window as the history accumulates, or they could be inadvertently modified or misinterpreted if mixed with volatile data from previous turns.

Exam trap

Assuming that instructions in the message history carry the same weight and stability as the top-level system parameter.

16
MCQmedium

A document-triage agent uses Claude with a read_attachment tool. During testing, the agent calls read_attachment for a PDF, receives a tool_result containing the extracted text, and then immediately calls read_attachment again for the same file id, repeating several times until the orchestrator stops it. The tool itself works correctly and returns valid content each time. What is the most effective architectural fix?

A.Raise the tool's timeout so the repeated calls have more time to complete and the agent stops retrying prematurely.
B.Have the orchestrator detect repeated identical tool_use requests against the same arguments and short-circuit them by returning a cached tool_result or by injecting a message that the content was already provided.
C.Remove read_attachment from the tools list and paste the document text directly into the system prompt for every request.
D.Increase the agent's iteration budget so it has more chances to break out of the repetition on its own.
AnswerB

Idempotent tools plus orchestrator-level duplicate detection break the loop without changing what the model can accomplish. Returning the cached result or explicitly noting the content is already available gives Claude the information it needs to proceed, and the guard prevents unbounded repetition regardless of why the model re-requests. This keeps control in deterministic host code.

Why this answer

Repeated identical tool calls with valid results indicate the agent is not recognizing that its need is already satisfied, so the robust fix is deterministic duplicate detection in the orchestrator, paired with cached results or an explicit signal that the content was already supplied. Timeouts, larger budgets, and inlining documents all leave the loop mechanism intact or trade away needed flexibility.

Exam trap

The trap here is treating repeated successful tool calls as a tool reliability problem, when the tool is working and the loop actually originates in the agent's control flow and context handling.

17
MCQmedium

An architect is designing a verification loop where an agent must 'quote supporting text' before answering. Why is this specific technique recommended for reducing hallucinations?

A.It forces the model to locate and verify the source information before attempting an answer.
B.It enables the system to automatically calculate the similarity score between the quote and the user question.
C.It ensures the model uses the correct citation format for the final output.
D.It reduces the token cost by avoiding the need for the model to generate a long, explanatory preamble.
AnswerA

By mandating that the model quote the source text, you impose a verification step where the model must confirm the information exists in the provided context. This significantly reduces the likelihood of the model generating unsupported claims, as it is constrained to rely on the retrieved text rather than its internal parametric knowledge.

Why this answer

Requiring the model to quote supporting text from the provided documents forces it to ground its response in concrete evidence. This verification step creates a clear link between the source material and the final answer, making it much easier for the architect to verify the accuracy of the output. If the model cannot find a direct quote, it is less likely to synthesize a plausible-sounding but incorrect answer, as the requirement to provide evidence acts as a constraint against hallucination.

Exam trap

Candidates often think this technique is about improving readability, but its primary architectural purpose is hallucination mitigation through grounding.

18
MCQhard

A development team is deploying a long-running agentic document processing pipeline. During execution, network glitches occasionally trigger a 429 rate limit or 529 overloaded response from the API. The team is worried about how their custom application harness should manage these errors during high-throughput batch operations. According to platform specifications, how are these specific infrastructure errors handled?

A.Official Anthropic SDKs automatically retry transient infrastructure errors like 429, 529, and connection drops using exponential backoff, while non-retryable client errors require application handling.
B.The Messages API automatically queues failed requests on the server side and replays them once rate limits clear, requiring no client-side retry logic.
C.Developers must implement manual retry loops for 400 invalid request errors because they represent temporary payload validation glitches during heavy traffic.
D.Transient overload errors (529) should be handled by immediately switching the model ID to Haiku regardless of the quality requirements of the agent task.
AnswerA

SDKs come equipped with built-in retry logic for transient server and capacity issues, ensuring robust fault tolerance without requiring complex custom wrappers. Developers must ensure that 4xx errors other than rate limits are treated as fatal configuration or request issues.

Why this answer

Standard API infrastructure errors such as rate limits (429) or temporary overloads (529), along with connection drops and specific gateway errors, are automatically retried by official Anthropic SDKs using exponential backoff by default (typically two retries). For custom harnesses or high-throughput batch pipelines, developers should respect the retry-after headers returned with 429 responses and ensure proper error handling for non-retryable client errors like 400 or 401 which should not be automatically retried.

Exam trap

Candidates often assume that all HTTP error codes should trigger aggressive custom retry loops in application code without utilizing SDK defaults or respecting rate limits.

19
MCQmedium

Why are XML tags specifically recommended for structuring prompts in Claude, as opposed to other formats like JSON or simple bullet points, when managing large context?

A.Claude was specifically trained to recognize XML as structural delimiters.
B.XML tags use fewer tokens than JSON or Markdown syntax.
C.JSON is not supported by the Claude 3.5 Sonnet context window.
D.XML tags automatically encrypt the data sent to the API.
AnswerA

Anthropic's training process emphasizes the use of XML tags to help the model identify different parts of a prompt, such as instructions, examples, and context. This specific training makes XML more 'legible' to the model's attention mechanism, leading to better adherence to the intended structure in complex prompts.

Why this answer

Claude was specifically trained on a large amount of data containing XML-style tags, making it highly proficient at recognizing them as structural markers. While Claude can understand JSON, XML is more robust for wrapping large, multi-line blocks of text without needing to worry about escaping characters, which improves the reliability of the prompt's structure.

Exam trap

Candidates frequently assume that JSON is the superior format because it is standard for APIs, ignoring that Claude’s specific training on XML makes it more robust for parsing complex, nested content.

20
Multi-Selectmedium

When designing an MCP server, which TWO of these factors primarily influence the model's performance in selecting the right tool?

Select 2 answers
A.The total amount of system memory allocated to the MCP server.
B.The semantic quality and uniqueness of the 'name' field.
C.The clarity and verbosity of the 'description' field.
D.The character count of the internal code implementation.
E.The version number of the MCP server protocol.
AnswersB, C

The 'name' field is the primary identifier the model uses to categorize and evaluate the tool's utility. Unique, semantically meaningful names allow the model to distinguish between similar operations, significantly improving the precision of the selection process. This is a critical design element for maintaining high tool-use accuracy.

Why this answer

Performance in tool selection depends on the clarity of the interface presented to the model. The tool name and its description are the first indicators the model evaluates to determine relevance. Architects must ensure these are highly descriptive, specific, and concise.

Proper naming and documentation reduce ambiguity, ensuring the model reliably maps user requests to the correct tools, which is essential for consistent automation in complex, multi-tool environments.

Exam trap

Candidates focus overly on the underlying code performance or execution speed of the tool rather than the semantic interface exposed to the LLM.

21
MCQmedium

A multi-agent system has a coordinator that delegates research subtasks to worker agents. Workers often return verbose, partially relevant summaries, and the coordinator loses track of which findings map to which subtask. Which change best improves the coordinator's ability to assemble a coherent final answer?

A.Have each worker call the other workers directly to reconcile their findings before returning to the coordinator.
B.Instruct the coordinator to re-read the entire conversation history before composing the final answer.
C.Increase the coordinator's max_tokens so it has more room to write the final answer.
D.Define a strict output schema for workers, such as a JSON object with fields for subtask identifier, findings, and confidence, and validate it before the coordinator consumes it.
AnswerD

A strict schema forces each worker to declare which subtask its findings belong to and how confident it is, giving the coordinator structured, machine-checkable inputs to assemble. Validation catches malformed or missing fields before they corrupt the final synthesis. This directly addresses the mapping and verbosity problems described.

Why this answer

The coordinator's difficulty is traceability: verbose worker summaries carry no explicit link to the subtask that produced them. Imposing a schema with subtask identifiers, findings, and confidence makes each worker's contribution self-describing and validates it before synthesis, so the coordinator can assemble and reconcile results deterministically rather than inferring associations from prose.

Exam trap

The trap here is adding more context or output space to the coordinator when the actual defect is the absence of structure and identifiers in worker outputs.

22
MCQeasy

A team is designing a system where an orchestrator calls a tool that occasionally takes longer than the allowed HTTP timeout. What is the most appropriate way to handle this during agent orchestration?

A.Wrap the tool call in a retry loop that immediately restarts the call if it does not finish within 30 seconds.
B.Increase the HTTP client timeout to one hour to ensure that even the slowest tool calls are captured.
C.Use a smaller, faster model to perform the tool call to ensure it finishes well within the timeout limit.
D.Design the tool as an asynchronous operation where the orchestrator receives an initial acknowledgment and then polls for completion.
AnswerD

Asynchronous tool execution is the standard architectural pattern for long-running operations. It allows the orchestrator to remain responsive, manage multiple tasks, and poll for results only when they are ready, effectively bypassing HTTP timeout limitations and improving system robustness.

Why this answer

For long-running tools, the orchestrator should avoid holding the HTTP connection open indefinitely. Instead, it should initiate the tool call, receive a response indicating the task has started, and then periodically poll for status or use a webhook/callback pattern. This decouples the agent's interaction loop from the tool's execution duration, preventing timeouts and ensuring the system remains responsive throughout the process.

Exam trap

Candidates often think increasing the HTTP timeout is the correct solution, rather than changing the architectural pattern to be asynchronous.

23
MCQmedium

A developer is using Claude Code to refactor a large TypeScript repository. They notice that Claude Code is attempting to read and analyze thousands of generated log files in the /dist folder, slowing down performance. Which configuration change should the developer make to optimize this workflow?

A.Run the command with the --no-search flag permanently.
B.Set the CLAUDE_MAX_TOKENS environment variable to a lower value.
C.Add 'dist/' to the .claudeignore file in the repository root.
D.Use the --exclude-files flag during every terminal session.
AnswerC

The .claudeignore file functions similarly to .gitignore, allowing users to define patterns for files or folders that Claude Code should ignore. Adding 'dist/' ensures the agent skips these generated artifacts entirely, significantly improving performance by focusing the model's indexing and analysis on relevant source files only.

Why this answer

To optimize Claude Code's performance, developers must effectively manage the context window and search scope. By configuring the .claudeignore file, users explicitly instruct the tool to skip non-essential directories like /dist. This ensures that the model focuses its attention only on relevant source code, reducing latency, improving accuracy, and preventing token exhaustion during complex refactoring tasks, which is critical for large-scale enterprise development projects.

Exam trap

Candidates often try to modify global model parameters to ignore files, forgetting that repository-specific exclusion files control workspace scanning.

24
MCQmedium

When designing tools that perform destructive actions, such as deleting a cloud resource or sending a high-priority email, which architectural pattern is most recommended by Anthropic?

A.Implement a 'dry_run' parameter that the model must set to 'true' before it is allowed to set it to 'false'.
B.Require a Human-in-the-Loop (HITL) step where a human must review and approve the tool call before execution.
C.Use a specialized model with lower temperature settings to ensure the tool calls are always predictable and safe.
D.Encrypt the tool's API key and store it in a secure environment that only the model can access during runtime.
AnswerB

The Human-in-the-Loop pattern ensures that a person validates the model's intent and the specific parameters of a destructive action before it is finalized. This is the gold standard for safety in tool design, as it provides a critical manual check against model hallucinations or logic errors.

Why this answer

Safety and control are paramount when granting LLMs the ability to change the state of external systems. Implementing a Human-in-the-Loop (HITL) pattern for sensitive operations prevents autonomous errors that could have significant financial or operational consequences. This design choice balances the efficiency of AI with the necessary oversight for high-stakes tasks.

Exam trap

Candidates often suggest adding 'warning' prompts or 'confirmation' steps within the model's output, which can be ignored by the LLM, rather than implementing a mandatory, external Human-in-the-Loop architectural gate.

25
MCQmedium

A financial firm uses an agentic workflow to draft regulatory reports. The orchestrator delegates research to a worker agent. To ensure the worker does not hallucinate data, you implement a verification step where a separate 'Verifier' agent checks the worker's output against a provided document. How should you structure the handoff to ensure accuracy?

A.Provide the verifier with the source document and the worker's draft, instructing it to cite sources for each claim.
B.Have the worker summarize its own output for the verifier to inspect.
C.Configure the verifier to run in a loop until the worker's output matches the verifier's own internal knowledge.
D.Ask the orchestrator to perform a keyword frequency analysis between the draft and the source.
AnswerA

Providing the original source document alongside the draft allows the verifier to perform a grounding check. By requiring citations, you force the model to map every claim in the report to a specific piece of evidence in the provided document, effectively detecting hallucinations and ensuring the report is strictly supported by the provided data.

Why this answer

To minimize hallucination, you must ground the verifier's work in the source document provided to the worker. By passing the original source document and the worker's output to the verifier, you allow the verifier to perform a cross-reference check. The verifier should be instructed to cite specific sections from the source document for every claim made by the worker.

This approach forces the model to adhere to the provided context rather than relying on its internal knowledge, which is critical for compliance-heavy tasks like regulatory reporting.

Exam trap

Candidates often confuse the Verifier's role with a simple formatting check, failing to recognize that verification requires source-grounding to mitigate hallucination risks effectively.

26
MCQmedium

When designing an orchestrator-workers system, what is the most appropriate way to handle sensitive data that must be processed by a worker?

A.Instruct the orchestrator to encrypt the data using a shared key that all workers have access to.
B.Include a strong instruction in the worker's system prompt to ignore and redact any PII it encounters in the input.
C.Rely on the Anthropic API's built-in PII protection features which automatically strip sensitive data from requests.
D.Use deterministic preprocessing code in the orchestrator to redact PII before passing the data to the worker.
AnswerD

Deterministic code provides a reliable and auditable layer of security that ensures PII is removed or obfuscated before it ever reaches the worker, effectively isolating sensitive information and minimizing the risk of unauthorized access or data leakage.

Why this answer

Security in agentic architectures requires that sensitive data is handled with the principle of least privilege. The orchestrator should perform any necessary PII redaction or filtering before passing data to a worker. By ensuring only the minimum required information is sent to the worker, the architect reduces the blast radius of a potential prompt injection or data leakage.

This preprocessing should occur in deterministic code, not in the model instructions, to ensure consistent and reliable protection of sensitive information.

Exam trap

Candidates often suggest telling the model to 'redact PII' via system prompts, which is unreliable compared to deterministic code.

27
MCQmedium

A team is implementing a long-running prompt chain for report generation and notices that costs are increasing as the chain progresses. They want to maintain stability in the prompt cache across turns. What is the most important architectural consideration regarding the structure of their prompts?

A.Use the metadata field to pass dynamic variables instead of including them in the prompt.
B.Place all volatile data at the beginning of the prompt to ensure it is always fresh.
C.Ensure that the stable prompt prefix is identical across all requests in the chain.
D.Request a 24-hour TTL for the prompt cache to ensure it persists throughout the chain.
AnswerC

The prompt cache relies on a prefix match. By keeping the system instructions and tool definitions consistent and at the start of the message sequence, the architect ensures that the cache remains valid, allowing the system to benefit from cache-read pricing for the majority of the prompt.

Why this answer

Prompt caching is sensitive to the order and content of the prefix. Any change in the prefix, such as reordering tools, changing the system prompt, or including dynamic data like timestamps, invalidates the cache for all subsequent content. By ensuring that stable, non-volatile information (like the system prompt and core tool definitions) comes first, and volatile information (like current turn data) comes last, the architect maximizes cache hits.

This structure is critical for maintaining cost-efficiency throughout a long-running chain.

Exam trap

Candidates often forget that the cache is a prefix match. Even a minor change like a dynamic timestamp in the system prompt can completely invalidate the entire cached prefix.

28
MCQmedium

An architect is designing an agentic pipeline for processing customer feedback. The pipeline includes a verification step where a secondary 'Verifier' agent checks the sentiment classification performed by the first agent. What is the best way to prevent the Verifier agent from inheriting biases or errors from the first agent?

A.Include the first agent's entire thought process and reasoning trace in the Verifier's system prompt.
B.Force the Verifier to use a different, lower-capability model to save costs while checking the work.
C.Configure the Verifier to automatically accept the first agent's output unless it detects a major contradiction.
D.Provide the Verifier with the original feedback data and instruct it to perform an independent sentiment analysis.
AnswerD

Providing the raw data ensures that the Verifier is not influenced by the classifications or summaries generated by the first agent. An independent analysis is the most effective way to identify and correct potential biases or mistakes, as the Verifier is forced to derive its own conclusions from the source material.

Why this answer

To prevent bias propagation, the Verifier agent should operate with its own context window and system prompt that specifically instructs it to perform an independent assessment. By treating the first agent's output as raw data rather than an absolute truth, the Verifier can perform a fresh evaluation. Passing the raw source material to the Verifier, rather than just the first agent's summary, ensures that the Verifier has the full context necessary to reach an unbiased conclusion.

Exam trap

Candidates often think that passing the previous agent's reasoning trace is helpful, but this can cause the Verifier to anchor to the previous agent's errors.

29
MCQhard

A regulated insurance workflow requires Claude to extract coverage limits from policy documents and return them as JSON. During testing, the model occasionally emits prose commentary before the JSON, breaking the downstream parser. The team cannot change the parser and must guarantee the response begins with a valid JSON object. Which technique most reliably enforces that?

A.Shorten the policy documents before extraction so the model has less text to summarize.
B.Add the phrase 'respond only in JSON' to the end of the system prompt and retry on parse failure.
C.Prefill the assistant turn with an opening brace so Claude continues from that point.
D.Raise the temperature to encourage the model to explore more structured output formats.
AnswerC

Prefilling the assistant message with an opening brace forces the model to continue the response from that exact token, so the output cannot begin with prose. This gives a hard guarantee that the first character is part of a JSON object. Combined with a clear extraction instruction, it reliably satisfies the fixed parser without retries. Prefilling is the deterministic control the scenario demands.

Why this answer

Prefilling the assistant turn with an opening brace constrains generation so the response starts inside a JSON object, satisfying a parser that cannot tolerate leading prose. Instructions and retries are probabilistic, temperature changes add variance, and shortening inputs does not affect output formatting. For a hard formatting guarantee, the prefill is the reliable control.

Exam trap

The trap here is treating 'respond only in JSON' as a guarantee, when instructions are probabilistic and only constraining the assistant turn deterministically fixes the first token.

30
MCQeasy

A developer frequently runs the same multi-step task in Claude Code: lint the changed files, run the unit tests, and then draft a commit message. They want to invoke this entire sequence with a single reusable command rather than retyping the instructions each time. Which Claude Code feature should they configure?

A.An entry in the permissions.allow array of settings.json
B.A custom slash command defined as a Markdown file in .claude/commands/
C.A Git alias in .git/config
D.A shell script added to the PATH
AnswerB

Custom slash commands are Markdown files stored in .claude/commands/ (project) or ~/.claude/commands/ (personal) whose body becomes the prompt sent to Claude. Naming the file, for example lint-test-commit.md, creates a /lint-test-commit command, giving the developer a single reusable invocation for the whole workflow.

Why this answer

Custom slash commands are the documented Claude Code mechanism for packaging a reusable prompt as a Markdown file under .claude/commands/. Invoking the command sends the file's contents as the prompt, so a single command can drive linting, testing, and commit message drafting. Git aliases, shell scripts, and permission entries operate outside the model and cannot orchestrate that workflow.

Exam trap

The trap here is treating any reusable automation (Git alias, shell script) as equivalent to a Claude Code slash command, when only the latter feeds instructions to the model.

31
MCQmedium

In a parallel voting system, an agent returns a 'refusal' for one of the segments of a task. How should the orchestrator handle this to ensure the system remains resilient?

A.Treat the refusal as an empty result and proceed with the remaining two agents' votes.
B.Instruct the user to rephrase their request until the agent provides a successful response.
C.Automatically retry the same request with a higher 'effort' level to bypass the refusal.
D.Log the refusal, exclude the specific segment from the voting pool, and notify the system administrator for review.
AnswerD

A refusal should be handled as an exceptional event that requires visibility. By logging the event and isolating the segment, you prevent the failure from crashing the entire process while maintaining a clear audit trail. Notifying an administrator ensures that the cause of the refusal—whether it is a policy issue or a data quality problem—can be properly investigated.

Why this answer

A refusal indicates that the safety classifiers have blocked the content for that specific segment. Simply ignoring the refusal or outputting an error to the user is insufficient. A robust orchestrator should treat the refusal as a signal that the specific input might be problematic or that the agent needs a more nuanced instruction.

The best practice is to log the refusal for audit purposes and potentially re-route that specific segment to a different agent or a human reviewer, rather than allowing the entire parallel process to fail or producing an incomplete final result.

Exam trap

Candidates often assume that a refusal means the entire system must stop, ignoring that only one parallel branch might be affected.

32
MCQhard

An architect is designing a research agent whose context window is filling with raw web page HTML. The agent must keep working across dozens of sources without exceeding the context limit. Which architecture best preserves reasoning quality over a long session?

A.Store full page text in the conversation and rely on the model's long-context ability to attend to everything.
B.Increase the `max_tokens` output parameter so Claude can compress the HTML itself in one pass.
C.Run a sub-agent that reads each page and returns a structured summary, and keep only those summaries in the main agent's context.
D.Set the model's temperature to zero so responses become shorter and consume fewer tokens.
AnswerC

Delegating page reading to a sub-agent with its own context window keeps the main thread lean. The sub-agent absorbs the raw HTML, extracts structured findings, and returns a compact result. The orchestrator retains only distilled knowledge, preserving attention on high-value tokens and enabling the session to span far more sources than a flat transcript would allow.

Why this answer

Context management in agentic systems is an architectural concern, not a parameter tweak. Sub-agents act as context firewalls: they consume noisy inputs in their own window and return only distilled results to the orchestrator. This keeps the primary reasoning thread focused on high-signal tokens and enables the session to scale across many sources without truncation or attention dilution.

Exam trap

The trap here is treating context limits as a tuning problem solved by temperature or max_tokens, rather than as an architecture problem solved by sub-agents and summarization.

33
MCQmedium

You are building a research agent that must browse multiple websites and synthesize findings. You decide to use the Claude Agent SDK. Why is it advantageous to use the SDK's built-in WebSearch tool rather than building your own manual tool-calling loop?

A.The SDK's built-in tools allow Claude to ignore the system prompt's safety rules for more effective searching.
B.The SDK's built-in tools are faster because they bypass the standard API call limits for web search.
C.The SDK handles the complexity of the tool-calling loop, including error recovery and result formatting, natively.
D.The SDK allows you to define the tool's input schema in the system prompt rather than as a separate JSON schema object.
AnswerC

The SDK manages the turn-by-turn execution, including the sequence of tool calls and result handling. This significantly reduces the risk of logic errors in your code, such as failing to pass back a tool result correctly or handling a tool failure, which are common pain points in custom manual loops.

Why this answer

The Claude Agent SDK provides a pre-tested, integrated harness that includes robust error handling, permission management, and efficient state management for tool execution. By using the built-in WebSearch tool, you inherit the security best practices and standardized output parsing built into the SDK, preventing common issues like malformed tool results or unhandled API errors. This allows you to focus on the research synthesis logic rather than the plumbing of the tool-calling loop, which is already handled by the SDK's internal mechanisms.

Exam trap

Thinking that custom tools are always better because they allow more specific parameter control, ignoring the maintenance burden of robust tool-calling.

34
MCQmedium

Refer to the exhibit. The developer wants to ensure the summary is concise and follows a specific structure. What is the most effective way to improve this prompt?

A.Include the instructions directly inside the user content field.
B.Use a system prompt to define the task, format, and style constraints.
C.Increase the temperature setting to 1.0 to ensure more creative summaries.
D.Repeat the instruction three times within the user content to enforce it.
AnswerB

The system prompt is the appropriate location for defining formatting and behavioral constraints. By placing instructions here, the model treats them as immutable directives. This separation ensures the model consistently adheres to the desired structure and tone, regardless of the variations found in the document content provided.

Why this answer

Providing a system prompt to establish the 'Persona' and 'Task Constraint' is superior to relying on the user message. By separating instructions from content, you provide a stable context for the model. This is standard architectural practice for Anthropic models, ensuring that the model maintains its directive despite varying document lengths, thus improving the consistency and quality of the generated summarization output over time.

Exam trap

Candidates often suggest modifying the user message directly to include more instructions, failing to realize that system prompts are the architectural standard for defining task constraints and style.

35
Multi-Selectmedium

Your team is scaling a parallel processing system that uses the Message Batches API to classify thousands of customer emails. Which THREE of the following practices are essential to ensure the system remains performant and cost-effective?

Select 3 answers
A.Set the orchestrator to wait for every single request in the batch to complete before processing any results.
B.Use a unique `custom_id` for each request in the batch to facilitate reliable result mapping.
C.Account for the batch's 24-hour processing window, after which unfinished requests expire.
D.Include the entire email history in every request within the batch to ensure maximum context.
E.Implement prompt caching for the shared system prompt and common instructions across the batch requests.
AnswersB, C, E

The Message Batches API returns results in any order, not necessarily the order they were submitted. A unique `custom_id` allows the orchestrator to correctly map each processed email back to its original source data, ensuring that the system can maintain consistency throughout the asynchronous processing workflow of the large batch.

Why this answer

When using the Message Batches API, efficiency is driven by grouping tasks and minimizing redundant inputs. Using prompt caching for the shared system prompt and common instructions across the batch is critical to reducing costs. Additionally, because results return asynchronously and potentially out of order, using a unique `custom_id` for every request is mandatory for the orchestrator to match responses to the correct original email.

Finally, since batch processing can take up to 24 hours, designing the orchestrator to handle the asynchronous nature of the return is vital.

Exam trap

Candidates often forget the importance of matching results via custom_id or assume results will return in the same order they were submitted.

36
MCQmedium

An architect is designing an agent that performs complex calculations using a tool-calling loop. The architect wants to minimize costs while maintaining high accuracy. Which approach to 'effort' configuration is most appropriate?

A.Set effort to 'max' for all agent turns to ensure the highest possible accuracy for every single calculation step.
B.Set effort to 'low' for all turns to guarantee the lowest possible cost per request, regardless of the task complexity.
C.Disable thinking entirely to eliminate all thinking-related token costs, assuming the model can perform calculations directly via tool calls.
D.Use the default effort setting initially and only adjust it upwards if the agent demonstrates consistent failures on specific complex task types.
AnswerD

Starting with the default effort is the most cost-conscious approach, as it allows the model's adaptive thinking to handle most tasks efficiently; adjustments should only be made based on evidence of performance gaps, ensuring that extra token spend is only incurred when it leads to improved task outcomes.

Why this answer

Adaptive thinking allows the model to decide when deep reasoning is needed, and 'effort' levels provide a mechanism to tune this behavior. For tasks that fluctuate in complexity, setting an appropriate effort level prevents the model from spending excessive tokens on simple tasks while ensuring it has enough depth for complex calculations. The architect should start with the model's default effort and only scale up if the agent fails to solve specific, difficult cases, rather than forcing high effort on every single turn, which is a common source of wasted spend.

Exam trap

Assuming that 'high' or 'max' effort is always the best setting for agents performing tool-based calculations.

37
MCQmedium

A developer is building a system where a 'Controller' agent evaluates the output of a 'Generator' subagent. The developer is concerned that the Generator's internal 'thinking' or reasoning might influence the Controller's evaluation in an unintended way. What is the most effective way to isolate these processes?

A.Configure the Generator to return only the final structured output, omitting its internal reasoning trace.
B.Create a shared session where both agents can view each other's reasoning traces in real-time.
C.Require the Controller to generate its own reasoning trace based on the Generator's full output and raw input.
D.Pass the Generator's full reasoning trace to the Controller so it can understand how the result was reached.
AnswerA

Returning only the final output is the most effective way to isolate the evaluation process. It prevents the Controller from being influenced by the Generator's internal logic, ensuring an unbiased assessment of the final deliverable. This design keeps the evaluation process pure and focused on the quality of the final result.

Why this answer

For an objective evaluation, the Controller should judge the Generator's final output, not the reasoning that produced it. Passing only the final deliverable keeps a clean boundary between the agents, prevents the Controller from being anchored by the Generator's line of argument, and keeps the Controller's context focused on evaluation.

Exam trap

Candidates often believe that exposing the full reasoning chain is always beneficial for transparency, failing to recognize the risk of bias in agentic workflows.

38
MCQmedium

A developer wants Claude Code to always run the project's formatter after it edits a file, and wants this behavior shared with the whole team through version control. Which configuration mechanism is intended for this kind of automatic, tool-triggered action?

A.A descriptive paragraph in `CLAUDE.md` instructing Claude to format files after editing them.
B.A `postinstall` script in `package.json` that runs the formatter once when dependencies are installed.
C.A shell alias in each developer's profile that wraps the Claude Code invocation.
D.A hook defined in the project settings that fires after file edits and invokes the formatter.
AnswerD

Hooks are the designed extension point for deterministic, event-driven actions such as running a formatter after an edit. Because they can be declared in the committed project settings, every teammate gets the same behavior without manual setup. This matches both requirements: automatic execution and team-wide sharing through version control.

Why this answer

The requirement is an automatic action bound to a lifecycle event, shared through version control. Hooks exist for exactly this: they are configured declaratively, can live in the committed project settings, and execute deterministically when the matching event occurs. Memory text only nudges behavior, shell aliases are local and event-blind, and package install scripts fire at the wrong time.

Only the hook satisfies both the automatic and the team-shared criteria.

Exam trap

The trap here is assuming that a written instruction in memory will reliably produce an automatic action, when memory text is advisory and no lifecycle event actually triggers it.

39
MCQmedium

An architect is implementing an MCP server that exposes a tool to create a new project in a project management system. The tool requires a project name, a list of team member emails, and a due date. The architect wants to minimize the chance that the model provides invalid or missing arguments. Which design choice best achieves this?

A.Implement server-side validation that rejects invalid requests and returns an error message to the model.
B.Allow any string for each parameter and let the model infer the correct format from examples in the prompt.
C.Provide a detailed natural language description in the tool's description field explaining each parameter.
D.Define the input schema with JSON Schema, marking all properties as required and specifying formats for email and date.
AnswerD

Using JSON Schema with required properties and format constraints (such as email and date) gives the model explicit rules to follow. The MCP client can validate inputs before sending, reducing invalid calls. It also documents the expected types clearly, which helps the model generate correct arguments. This is the most direct way to minimize missing or malformed parameters.

Why this answer

Defining a JSON Schema with required properties and format constraints (e.g., email, date) gives the model a clear contract. The MCP client can validate against this schema before invoking the tool, catching missing or malformed arguments early. This proactive constraint is more effective at minimizing invalid inputs than relying on descriptions or server-side rejection alone.

Exam trap

The trap here is thinking that a detailed description or server-side validation is enough, when a strict input schema is the most effective way to guide the model to produce valid arguments in the first place.

40
MCQhard

An architect is building a Claude-based agent that must reconcile invoice disputes. The orchestrator runs a single loop where Claude may emit several tool_use blocks in one assistant turn: one block calls lookup_invoice, another calls fetch_payment_history, and a third calls get_contract_terms. A junior developer proposes executing the first tool_use block, feeding its tool_result back to Claude, and only then deciding whether to run the other two. What is the architecturally correct way for the orchestrator to handle this turn?

A.Execute all tool_use blocks from the assistant turn, then return every tool_result in a single subsequent user message keyed by tool_use_id.
B.Execute the first tool_use block, return its result alone, and let Claude re-issue the remaining two calls in a fresh assistant turn.
C.Execute the three calls sequentially, returning each tool_result in its own separate user message as soon as that call finishes.
D.Skip execution of the tool_use blocks and send a natural-language summary of the assistant text so Claude can decide what to do next.
AnswerA

Claude's tool-use contract expects the orchestrator to satisfy every tool_use block it emitted in that assistant turn and to return the results together in the following user message, each result carrying the matching tool_use_id. Because the three calls are independent lookups, running them in parallel and replying once preserves the turn pairing and avoids leaving an unresolved tool_use block, which the API rejects.

Why this answer

An assistant turn containing multiple tool_use blocks constitutes a single batched request for those tools. The orchestrator must execute each block and return all tool_result entries together in one subsequent user message, each tagged with the matching tool_use_id. This keeps the conversation structurally valid, lets independent lookups run concurrently, and minimizes model round-trips before Claude can reason over the combined evidence.

Exam trap

The trap here is assuming tool calls must be handled one at a time, when a single assistant turn can legitimately request several tools that must all be answered together.

41
MCQmedium

A team is implementing a document summarization agent that must reference information from a large, multi-part document. To optimize performance, they are using the Files API to store the document. What is the correct approach for managing the state of this document across multiple turns?

A.Upload the document once and assume the API automatically keeps the content in the session state for subsequent calls.
B.Use the Files API to edit the document in-place as the conversation progresses to reflect the latest state.
C.Store the document content in the assistant's metadata to make it available for all future turns in the session.
D.Reference the document using the file_id in every request and enable prompt caching for the document content.
AnswerD

Using the file_id allows for consistent referencing, while prompt caching ensures that the document content is not re-processed and re-billed at full cost for every request. This combination provides an efficient way to maintain access to the document state across a multi-turn conversation without excessive token consumption.

Why this answer

The Files API allows you to upload a document once and reference it using a 'file_id' across multiple API calls. However, the document's content is billed as input tokens every time it is referenced. To manage the state effectively, the architect should use prompt caching for the document content if it is reused across many turns.

This reduces costs significantly while allowing the model to maintain access to the document state without re-uploading the file or re-processing the full text in every request.

Exam trap

Candidates often assume that referencing a file via 'file_id' automatically persists its context across turns without incurring token costs.

42
MCQeasy

In a prompt chain where the output of Step 1 is required for Step 2, what is the best practice for handling the handoff if the model in Step 1 produces an error or a refusal?

A.Pass the error message directly to the next step so it can attempt to correct the previous step.
B.Implement application-level logic to detect the failure and stop or redirect the chain.
C.Retry the step indefinitely until the model provides a successful response.
D.Assume that the model will naturally handle the refusal and provide a fallback automatically.
AnswerB

Stateless chains require your application to manage the flow control. By checking the API response for errors or refusals, you can ensure that the system stops or takes corrective action before proceeding. This prevents cascading failures and ensures that downstream models are not forced to process invalid or erroneous data.

Why this answer

The system should detect the error using the stop_reason or by validating the response content and trigger a fallback logic. This could involve logging the failure, attempting a retry with a different model effort, or alerting a human operator. Simply passing the error or refusal text into the next step will likely cause the entire chain to fail or produce nonsensical results, which is why proactive error handling is essential.

Exam trap

Candidates often think the model will automatically handle errors in a chain if they just pass the output forward, ignoring the need for application-level control.

43
MCQmedium

Which strategy most effectively handles long documents that exceed the model's immediate focus in a single prompt?

A.Use a single prompt and ask the model to process the entire document at once.
B.Implement a Map-Reduce strategy to process document chunks independently.
C.Increase the 'max_tokens' parameter to its maximum limit.
D.Switch to a different model family that supports infinite input.
AnswerB

Map-Reduce is the industry-standard design pattern for large-scale document processing. By splitting the task into modular chunks, you ensure that the model can focus effectively on each part. The final aggregation step then combines these insights, providing a much more reliable and coherent final result than a single-shot attempt.

Why this answer

The 'Map-Reduce' pattern is the standard architectural approach for handling large datasets. You break the document into smaller chunks, process them independently to generate intermediate results, and then perform a final 'aggregation' pass to synthesize those results. This ensures that no individual prompt exceeds the optimal processing capacity, maintaining high quality throughout the pipeline while overcoming the limitations of single-prompt context handling for massive amounts of data.

Exam trap

Candidates often choose to increase the model's context window limit or attempt to pass the entire document in a single prompt, ignoring the efficiency and scalability benefits of chunking.

44
MCQhard

Refer to the exhibit. The developer observes that Claude occasionally includes conversational filler before the JSON block. What is the most reliable way to ensure the output starts immediately with the JSON object?

A.Include a strict JSON schema in the system prompt.
B.Prefill the assistant response with the '{' character.
C.Set the temperature to 0.0 for deterministic output.
D.Use a higher frequency penalty to avoid repetitions.
AnswerB

Starting the assistant's message with an opening curly brace forces the model to complete the JSON object immediately. This technical maneuver bypasses the model's tendency to explain its actions, ensuring that the very first character of the generated response is part of the structured data payload.

Why this answer

Prefilling the assistant's response is a powerful technique to force Claude to start its output with a specific character or string. By providing the opening brace of the JSON object in the assistant message, the model is constrained to continue the sequence as a valid JSON object, effectively eliminating any preceding conversational text or explanations.

Exam trap

Candidates often suggest using system prompts or specific output instructions like 'do not include conversational text,' which are frequently ignored by the model, rather than using the structural prefill technique.

45
MCQmedium

A developer wants a single Claude Code slash command available only to their own user account on a shared Linux workstation, not to other engineers who log into the same machine. Where should the command's Markdown file be stored?

A.In the project's .claude/commands directory at the repository root
B.In a CLAUDE.md file committed at the repository root
C.In the settings.json file under the project's .claude directory
D.In ~/.claude/commands in the developer's home directory
AnswerD

Personal slash commands live under the user-level ~/.claude/commands folder, so they load for that OS account only and are never committed to the repository. On a shared workstation, other engineers logging in under their own accounts use their own home directories, so they cannot see or invoke this command, which satisfies the isolation requirement.

Why this answer

Slash commands are Markdown files discovered from command directories, and scope follows location: files under the user's home .claude/commands are personal, while files under the project's .claude/commands are shared through the repository. To keep a command visible only to one developer on a multi-user workstation, it must be stored in that developer's home directory command folder rather than in any project-level location.

Exam trap

The trap here is assuming that any file placed under a .claude directory behaves the same, when user-level and project-level command directories deliberately differ in visibility and version control.

46
MCQeasy

A new engineer joins a team and clones the project repository. They run Claude Code and find it already follows the team's conventions for commit messages and test layout without any personal setup. Which explanation accounts for this?

A.The repository includes a project memory file that Claude Code loads automatically as context for sessions in that project.
B.The engineer's global user settings were synchronized from a shared team profile during installation.
C.Claude Code ships with built-in defaults that match most enterprise conventions out of the box.
D.Claude Code infers the team's conventions by analyzing recent commit history at session start.
AnswerA

A project memory file committed to the repository is picked up automatically whenever Claude Code runs in that directory, so conventions travel with the code. That is why a fresh clone behaves as if it were configured, with no per-developer action required. This matches the observed behavior exactly.

Why this answer

Behavior that appears automatically in a fresh clone, with no personal configuration, points to content that is committed alongside the code and loaded as session context. A project memory file does precisely that: it is read automatically for sessions rooted in that repository and carries team conventions to every developer. Commit-history inference, synchronized user profiles, and generic built-in defaults all fail to explain consistent, team-specific behavior.

Exam trap

The trap here is attributing team-specific behavior to built-in defaults or history analysis, when only committed project context can carry a specific team's conventions to a new clone.

47
MCQeasy

A support agent running on the Claude Messages API must look up a customer's order status before answering. The developer writes a single request that includes the get_order_status tool definition and the user's question, then expects the model to return the order status directly in its first response. What actually happens, and what must the developer implement?

A.Claude returns a tool_use block requesting get_order_status; the application must execute the tool and send back a tool_result, then call the API again to get the final answer.
B.Claude returns the order status immediately because tool definitions are executed server-side by Anthropic before the response is generated.
C.Claude executes the tool and returns both the tool output and its final answer in one response, so no second request is needed.
D.The request fails with a validation error because a tool definition cannot be supplied alongside a normal user text message.
AnswerA

The API is stateless and does not execute tools on the caller's behalf. When Claude decides a tool is needed, it returns stop_reason tool_use with a tool_use block containing the name and arguments; the application runs the function, appends a user turn with the matching tool_result, and issues another request so Claude can compose the answer.

Why this answer

Tool use in the Claude Messages API is a caller-driven loop: the model emits a tool_use request, the application executes the function and returns a tool_result, and a follow-up request lets Claude produce the final answer. Because the API is stateless and never runs customer functions itself, the developer must implement this round trip.

Exam trap

The trap here is assuming the model itself executes declared tools, when tool definitions only describe callable functions and every execution plus result round trip is the application's responsibility.

48
MCQmedium

Which of the following describes the 'Chain of Thought' prompting strategy, and why should it be used for complex logic tasks?

A.Providing the model with a list of facts and asking it to select the most relevant one.
B.Asking the model to outline its reasoning process step-by-step before providing the final answer.
C.Instructing the model to write its output in a specific programming language format.
D.Forcing the model to repeat the user's prompt back to them to ensure comprehension.
AnswerB

Chain of Thought forces the model to articulate its logic, which acts as a self-correction mechanism. This step-by-step articulation allows the model to verify its own intermediate conclusions, leading to much higher accuracy for complex, multi-step logical problems compared to asking for a single-step final answer.

Why this answer

Chain of Thought involves asking the model to show its reasoning process before delivering the final answer. This is critical for complex tasks because it forces the model to decompose the problem into intermediate steps, which significantly reduces logical errors. By 'thinking' through the steps, the model is less likely to hallucinate the result, leading to more reliable and verifiable outputs in complex analytical scenarios.

Exam trap

Many candidates assume Chain of Thought is only for complex math, ignoring its utility in reducing hallucinations and logical errors in general analytical or classification tasks.

49
Multi-Selecthard

An enterprise architect is designing a long prompt chain that involves 10 distinct steps to generate a comprehensive market research report. Which TWO risks are most inherent to this 'deep' chaining architecture compared to a 'wider' Orchestrator-Workers pattern?

Select 2 answers
A.The inability to use different model tiers for different steps within the same linear sequence.
B.Reduced token costs, because sequential steps can share a single cached context window across the whole chain.
C.Error propagation, where a small hallucination or formatting error early in the chain degrades all subsequent outputs.
D.Incompatibility with adaptive thinking, as Claude cannot use 'thinking' blocks in sequential workflows.
E.Cumulative latency, as the total time is the sum of every sequential model call and network round-trip.
AnswersC, E

Linear chains are fragile because each step depends on the absolute correctness of the previous one. A single 'hallucinated' fact in Step 3 becomes the 'ground truth' for Steps 4 through 10, making the final report highly susceptible to failures that are difficult to trace and correct.

Why this answer

Deep prompt chains suffer from 'error propagation' and high 'cumulative latency.' In a linear chain, if Step 2 makes a minor error, that error is compounded in every subsequent step. Furthermore, because each step must wait for the previous one to finish, the total time for the user is the sum of all 10 model latencies. In contrast, an Orchestrator-Workers pattern allows for parallelization of independent subtasks, reducing total latency and isolating errors to specific workers.

Exam trap

Thinking that linear chains are easier to scale because they don't require an orchestrator.

50
Multi-Selecthard

When building an application that requires Claude to extract information from a set of 50 uploaded PDFs, which THREE methods will most effectively increase the reliability of the extracted data?

Select 3 answers
A.Merging all PDFs into a single, continuous text block
B.Increasing the temperature to 0.7 to allow for flexible interpretation
C.Instructing the model to include direct quotes and document names
D.Using XML tags to separate each PDF with <source> and <id> tags
E.Giving the model an 'out' by allowing it to say 'I don't know'
AnswersC, D, E

Requiring citations or direct quotes forces the model to ground its response in the provided text. This makes it much easier for a human or a downstream process to verify the information, significantly increasing the overall reliability of the system by providing a clear audit trail for every claim.

Why this answer

Retrieving data from multiple documents is a complex task. To ensure reliability, architects should use XML tags to identify individual documents, request that the model provide direct citations or quotes from the text, and ask the model to state if the answer is not present in the provided context.

Exam trap

Candidates often forget to allow models an explicit 'out' or citation requirement, forcing hallucinated answers when information is missing from documents.

51
MCQmedium

In a 'voting' architecture used for sentiment analysis of customer reviews, an architect notices that the three parallel Claude Haiku 5.5 instances frequently agree on the wrong sentiment when the review contains heavy sarcasm. Which adjustment to the voting pattern would best address this specific failure mode?

A.Lower the temperature to 0.0 for all three Haiku instances to ensure they are more focused.
B.Use prompt caching to store the definitions of sarcasm in the system prompt.
C.Implement heterogeneous voting by replacing one Haiku instance with Claude Sonnet 5.5.
D.Increase the number of voters from three to five instances of Claude Haiku 5.5.
AnswerC

Introducing a more capable model into the mix allows the ensemble to benefit from different reasoning levels. Sonnet is much better at detecting sarcasm and can act as a 'sanity check' that breaks the incorrect consensus previously formed by the less capable Haiku instances.

Why this answer

This is a classic case of 'correlated error,' where a specific model tier (Haiku) struggles with a specific linguistic nuance (sarcasm). To fix this, the architect should introduce 'heterogeneous voting.' By replacing one of the Haiku instances with a more capable model like Claude Sonnet 5.5 or Opus 5.5, the ensemble gains a 'voter' with higher reasoning capabilities that can detect sarcasm. This prevents the simpler models from forming a wrong majority on nuanced inputs.

Exam trap

Increasing the number of voters (e.g., from 3 to 5) using the same model tier.

52
MCQhard

An architect is designing an evaluator-optimizer loop in a custom orchestrator built on the Messages API. The 'optimizer' agent is tasked with refining a technical document. To prevent the loop from running indefinitely, the architect wants to limit the total cost of the process. Which strategy is the most robust way to enforce this budget?

A.Use the 'stop_sequences' parameter to end the loop when the model reaches a certain number of iterations.
B.Use the 'max_tokens' parameter to set a global limit for the entire iterative loop across all turns.
C.Track the cumulative token usage (input_tokens + output_tokens) in the orchestrator's session state and terminate the loop when the total exceeds the defined budget.
D.Set the 'effort' parameter to 'low' for the entire evaluator-optimizer loop to ensure the cost stays within the budget.
AnswerC

Tracking usage programmatically at the orchestrator level is the most reliable method for budget enforcement. By summing the token counts from each response in the loop, the orchestrator can make an informed decision to stop the process once the budget is reached, providing a deterministic and secure financial guardrail.

Why this answer

The most robust way to manage budget in an agentic loop is to track the cumulative usage (input/output tokens) from each turn and compare it against a defined threshold within the application logic. By checking the cumulative cost after each turn, the orchestrator can force the loop to terminate if the budget is reached. This is more reliable than relying on model-side instructions alone, as it provides a deterministic, programmatic guarantee that the total spend for a given request will not exceed the organization's constraints.

Exam trap

Candidates often try to use internal model instructions to manage budget, which can fail if the model 'forgets' or gets trapped in a high-effort reasoning cycle.

53
MCQeasy

In a parallel voting system, what is the primary role of the orchestrator after receiving responses from all parallel worker agents?

A.The orchestrator should pass all responses to the end-user, allowing them to decide which agent provided the most accurate answer.
B.The orchestrator must synthesize or evaluate the multiple parallel outputs to produce a single, unified final response.
C.The orchestrator should send the worker responses back to the workers for a second round of voting to ensure total consensus.
D.The orchestrator should automatically select the first response received to minimize latency, as all agents are expected to provide the same answer.
AnswerB

The orchestrator's primary role is to aggregate the diverse outputs into a single, cohesive, and correct final decision. This involves analyzing the responses, potentially resolving conflicts, and ensuring the final result meets the system's requirements. This centralized logic is the core of successful parallel orchestration.

Why this answer

The orchestrator is responsible for the final decision-making logic in a parallel architecture. Once all agents have returned their results, the orchestrator must analyze, synthesize, or choose from those responses based on the defined business logic. This might involve a simple majority vote, a meta-evaluation, or a selection process based on confidence scores.

The orchestrator serves as the centralized gatekeeper that ensures the final output is consistent, safe, and aligned with the intended goal of the multi-agent workflow.

Exam trap

Candidates often think the workers should coordinate with each other, ignoring the central role of the orchestrator in maintaining system logic.

54
Multi-Selectmedium

You are building an RAG system. Which THREE factors most significantly impact the reliability of the retrieved information?

Select 3 answers
A.Chunking strategy (size and overlap).
B.The model's temperature setting.
C.Embedding model quality.
D.Relevance and accuracy of the vector search results.
E.The language of the user query.
AnswersA, C, D

Effective chunking ensures that relevant context is captured within the window limits without losing critical cross-reference information. Proper overlap is essential for maintaining continuity between chunks. Poor chunking leads to fragmented information, causing the model to miss key details, which directly undermines the reliability of the RAG system.

Why this answer

RAG reliability is entirely dependent on the quality of the ingested data and the effectiveness of the retrieval mechanism. If the source material is poor, the model's output will be poor regardless of prompt engineering. By focusing on chunking strategy, embedding quality, and retrieval relevance, you ensure that the context provided to the model is accurate, complete, and highly targeted for the user's intent.

Exam trap

Candidates often assume that sophisticated prompt engineering or model choice alone can fix poor RAG performance, ignoring that underlying data quality, chunking strategies, and embedding relevance dictate ultimate retrieval reliability.

55
MCQhard

A developer builds a Claude-powered assistant that answers questions over a 300-page policy manual. When the whole manual is placed in a single prompt, answers to questions about clauses in the middle of the document are frequently wrong or vague, while answers about the opening and closing sections are accurate. The manual must stay available in full, and the team wants to keep latency reasonable. Which technique most effectively improves accuracy for the mid-document clauses?

A.Split the manual into sections, embed each section, retrieve the most relevant sections for the question, and place only those retrieved sections in the prompt before the question.
B.Increase max_tokens substantially and instruct the model to think step by step before answering each question.
C.Ask the user to restate their question using exact phrases from the manual so the model can match keywords directly.
D.Keep the full manual in the prompt but move it so the manual text appears after the question rather than before it.
AnswerA

Retrieval-augmented prompting addresses the mid-document weakness by selecting the passages most relevant to the question and placing them near the end of the prompt, where attention is strongest. The model reasons over a small, on-topic context instead of a long document, improving accuracy for clauses that previously sat in the poorly attended middle. Keeping the full manual in the index preserves availability while bounding prompt size and latency.

Why this answer

Accuracy drops for material buried in the middle of a very long context because attention is spread thin across the document. Retrieving the sections most relevant to each question and placing only those in the prompt shrinks the context to on-topic passages, which restores accuracy for mid-document clauses while the full manual stays indexed for availability. Reordering or enlarging the same long context does not fix the attention problem.

Exam trap

The trap here is assuming that simply reordering the long document or enlarging the token budget fixes mid-context recall, when the real fix is reducing the prompt to retrieved, relevant passages.

56
MCQeasy

In a prompt chain, why is it recommended to place long documents at the top of the prompt?

A.It ensures that the document is not truncated by the max_tokens limit.
B.It helps the model ground its reasoning and reduces potential hallucinations.
C.It is required by the API to successfully parse the document content.
D.It allows the model to cache the entire document more effectively.
AnswerB

Providing the grounding material early in the prompt allows the model to refer back to it while performing the task. This leads to more accurate, cited, and grounded responses, which is essential for any agentic architecture that relies on external knowledge or documents to perform its work.

Why this answer

Anthropic guidance suggests placing long documents near the top of the prompt because it helps the model maintain focus and grounding when addressing the specific task or question that follows. By establishing the context early, the model can reference the document content more effectively as it processes the subsequent instructions. This structure improves performance and helps reduce hallucinations, as the model has immediate access to the source material before it begins generating its final response.

Exam trap

Thinking that the order of the prompt does not matter because the model processes the entire context at once.

57
MCQmedium

Which technique is most effective for ensuring an LLM correctly follows complex multi-step instructions?

A.Keep the prompt as short as possible.
B.Use Chain-of-Thought prompting.
C.Increase the frequency of model polling.
D.Use a higher temperature setting.
AnswerB

Chain-of-Thought allows the model to process problems linearly, making it much more likely to follow complex logic and adhere to constraints. By requiring a reasoning step, you force the model to 'check its work' as it proceeds, significantly increasing the probability of a correct and reliable final output.

Why this answer

Chain-of-Thought (CoT) prompting forces the model to articulate its reasoning process step-by-step before finalizing an answer. This is highly effective because it breaks down a complex task into manageable, sequential steps. When the model 'thinks aloud,' it is less likely to miss hidden constraints or make logical errors in the final result, which is crucial for reliability in complex workflows.

Exam trap

Test-takers often confuse few-shot examples with multi-step reasoning techniques, selecting generic example-based prompting when complex sequential breakdowns are required.

58
MCQmedium

Refer to the exhibit. A developer is experiencing slow response times during complex refactoring tasks. Based on the provided configuration, what is the most likely cause of performance issues?

A.The temperature of 0.2 is too high for code generation.
B.The model version is experimental and suffers from high latency.
C.The max_tokens setting is causing extended generation times.
D.The configuration is missing the system_prompt field.
AnswerC

Requesting a very large max_tokens limit forces the model to potentially generate long outputs. In the context of coding, excessive generation without proper modularization increases latency. By lowering this limit, the developer can encourage the agent to produce more concise, targeted responses, improving overall tool responsiveness during complex tasks.

Why this answer

The configured max_tokens value of 8192 is significantly high, which directly impacts the latency of the API responses. During complex refactoring, if the model attempts to generate very long sequences, the time-to-first-token and total generation time increase. Reducing this value to a more constrained scope ensures faster turnaround times while still allowing sufficient room for code generation, optimizing the developer's workflow during iterative coding sessions.

Exam trap

Candidates often blame network latency or API server load, overlooking that a high max_tokens setting forces the model to generate more content, directly increasing the total request processing time.

59
MCQeasy

In an evaluator-optimizer loop, the architect wants to ensure the optimizer does not enter an infinite loop of 'failed' attempts. Which mechanism is most appropriate to implement for termination?

A.Set a maximum iteration counter and a fallback action to trigger if the target quality is not met.
B.Set the temperature to 0 to make the model deterministic, hoping it will eventually reach a stable state.
C.Use the stop_sequences parameter to detect when the model is stuck in a repetitive pattern.
D.Rely on the optimizer to recognize it is not improving and self-terminate by returning a 'stop' command.
AnswerA

A counter provides a deterministic way to stop the loop after a set number of attempts. A fallback action ensures that the process ends gracefully, either by returning the best-effort result or by flagging the issue for human intervention.

Why this answer

A hard limit on the number of iterations combined with a 'fallback' policy is the standard approach to prevent infinite loops. By tracking the number of iterations and forcing a transition to a final state or a human-review step after a threshold is reached, the architect ensures the system remains predictable. This allows the system to gracefully handle scenarios where the model cannot achieve the desired quality within the specified constraints.

Exam trap

Candidates often suggest relying on the model to 'know' when to stop, which is unreliable in autonomous agentic loops.

60
MCQmedium

When designing an MCP server, what is the best practice for handling dependencies between multiple tools?

A.Chain tool calls by storing state in a global variable within the MCP server process.
B.Combine dependent tools into a single, monolithic tool to guarantee the order of execution.
C.Design each tool to be atomic and rely on the model to orchestrate the sequential execution.
D.Force the model to provide a 'chain_id' parameter to track the context across multiple tool calls.
AnswerC

Atomic tools allow the model to manage the flow based on the results of each step. This approach is more resilient because the model can handle errors, branch logic, or request clarification between steps, providing a more robust and flexible integration than hard-coded, server-side chaining.

Why this answer

The best practice is to design tools to be stateless and independent, requiring the orchestration logic to reside within the LLM agent or client. By ensuring that each tool performs a single, atomic action, you minimize coupling. This approach makes the tools easier to test, reuse, and maintain, and prevents complex state-dependency issues that can occur when one tool relies on the side effects of another in the same session.

Exam trap

Candidates often try to chain tools together inside the server code, creating tightly coupled, stateful dependencies that are difficult to debug, rather than letting the LLM orchestrate them as atomic, independent steps.

61
MCQmedium

A development team is monitoring a production orchestrator-workers system. They observe that periodically, the orchestrator reports a 'tool_use' stop_reason, but the subsequent request from the client fails with a 400 error. The team wants to improve observability of these failed tool-use cycles. What is the most effective architectural change to ensure these failures are captured in their logs?

A.Enable server-side error logging for the Anthropic API key to capture the missing tool_result payloads.
B.Implement a retry mechanism that automatically resubmits the last user message without tool_result blocks.
C.Switch to a model that does not require tool_result blocks to simplify the orchestration logic.
D.Log the tool_use ID and the generated tool_use block in the orchestration layer immediately before sending the API request.
AnswerD

Capturing the tool_use details at the orchestration layer provides a clear audit trail of what the model requested. If the subsequent client-side execution fails to produce a result, the logs will show exactly which tool call was pending, allowing developers to correlate the 400 error with the specific missing tool execution.

Why this answer

In a tool-use loop, every tool_use block generated by Claude must be answered by a corresponding tool_result in the next user message sent to the API. When the client fails to provide this result, the API returns a 400 error because the conversation history is considered invalid or incomplete. To improve observability, the orchestration layer must implement a strict validation hook or middleware that logs the tool_use ID and the payload before the client attempts to send the next turn, ensuring that even if the request fails, the system has a record of the expected tool response.

Exam trap

Candidates often assume that the API itself logs missing tool results, but the API is stateless and simply rejects invalid sequences, making client-side logging of the loop state essential for debugging.

62
MCQmedium

When Claude Code suggests a series of file edits, what is the best strategy to ensure the integrity of the project?

A.Accept all suggested changes immediately to save time.
B.Apply changes in a feature branch and perform a full test suite run.
C.Use an automated script to verify the syntax of the generated code.
D.Only use Claude Code for small, non-production helper functions.
AnswerB

Applying changes to a branch allows for a structured review process. Running the full test suite ensures that the changes do not break existing functionality. This creates a secure sandbox for validation, allowing the developer to confirm the correctness of the generated code before it enters the production codebase.

Why this answer

Treating Claude's suggestions as a draft is the safest workflow. By applying changes in a temporary branch, the developer can run tests, review the diffs, and ensure the logic is sound before finalizing the merge. This approach leverages the speed of the model for generation while maintaining the human oversight necessary for mission-critical code, preventing potential issues caused by subtle hallucinations or logic errors in the generated output.

Exam trap

Candidates often assume that code generated by Claude is completely bug-free and commit changes directly to the main branch without running test suites.

63
MCQmedium

An architect is designing an MCP server that retrieves real-time financial data. To ensure the model does not hallucinate during tool execution, which design pattern is most effective for tool definition?

A.Using a generic string field for all parameters to allow for flexibility.
B.Embedding the tool logic directly into the system prompt instead of using MCP tools.
C.Defining explicit JSON Schema objects for every argument with strict validation.
D.Allowing the model to infer tool parameters based on conversational history.
AnswerC

Defining explicit JSON Schema objects provides the model with clear structural requirements and constraints for every argument. This formal approach enables the model to validate parameters before invocation, significantly reducing hallucination risks and ensuring that the tool receives inputs that strictly conform to the expected format and constraints.

Why this answer

Providing specific, constrained schema definitions within the MCP tool declaration ensures the Claude model understands the exact parameters required. This minimizes ambiguity and prevents the model from attempting to pass invalid data types. By explicitly defining the input schema using JSON Schema, the architect enforces strict structural integrity, which is critical for tool reliability and successful integration with Anthropic's platform capabilities during runtime execution.

Exam trap

Exam takers often rely solely on natural language descriptions within tool definitions, underestimating the strict structural requirement of JSON Schema validation.

64
Multi-Selectmedium

Which THREE of the following are benefits of using JSON Schema for MCP tool input definitions?

Select 3 answers
A.It enforces strict type-checking on the input arguments before the tool logic is invoked.
B.It automatically generates a graphical user interface for the end-user to trigger tools manually.
C.It provides clear constraints that guide the model to select the correct parameters.
D.It enables consistent error messaging when the model provides arguments that do not match the expected format.
E.It allows the server to change the tool's input structure dynamically based on the current time.
AnswersA, C, D

Type enforcement at the protocol boundary prevents malformed data from reaching the internal logic. This ensures that the code inside the tool doesn't need to manually check every input, resulting in cleaner, safer, and more maintainable code that adheres to standard expectations for data processing.

Why this answer

JSON Schema provides a formal contract that facilitates three key areas: automated validation, clear documentation for the model, and consistent error handling. By defining the structure, types, and constraints of inputs, you ensure that the server rejects invalid requests before they reach sensitive business logic. This proactive approach significantly reduces runtime errors and provides the model with the necessary constraints to generate accurate tool calls, leading to a more reliable agent.

Exam trap

Candidates often believe JSON Schema is exclusively used for documentation purposes, overlooking its critical role in runtime validation and security.

65
MCQhard

A team is extracting medication names and dosages from clinical notes. The notes contain many similar-looking terms, and the team needs high precision to avoid false positives. They plan to use few-shot examples. Which design of the few-shot examples best supports high precision in this scenario?

A.Include a mix of positive examples and carefully chosen hard negatives that resemble medications but should not be extracted.
B.Provide many examples of correct extractions only, covering a wide range of medication names.
C.Randomly sample examples from the dataset without regard to difficulty or similarity.
D.Use a single detailed example and rely on the model to generalize to all other notes.
AnswerA

Hard negatives show the model the boundary between true medication mentions and lookalikes, which directly improves precision. In this scenario, where similar terms cause false positives, contrastive examples clarify what to exclude. This design teaches the decision boundary rather than only the target class, making it the most effective choice for high precision.

Why this answer

High precision in a field with lookalike terms depends on teaching the model where the boundary lies. A mix of positive examples and hard negatives does that by showing both what to extract and what to reject. Positive-only, single-example, or random sampling designs do not surface the confusing cases, so they are less likely to reduce false positives in clinical extraction.

Exam trap

The trap here is assuming that more positive examples alone improve extraction, when precision in a lookalike-rich domain depends on contrastive hard negatives.

66
MCQmedium

A financial analyst uses Claude via the Messages API to extract line items from scanned invoices. The response must be valid JSON conforming to a fixed schema with fields invoice_number, date, and total. During testing, the model occasionally adds a trailing sentence after the JSON object or wraps the JSON in a markdown code fence. Which approach best guarantees the response parses cleanly while preserving extraction accuracy?

A.Instruct the model to begin the response with a tool_use block whose input_schema defines the invoice fields, then read the structured tool input from the response.
B.Set the max_tokens parameter to the exact length of the expected JSON string so the model cannot emit extra characters.
C.Request the JSON inside <output> tags and run a regular expression that captures everything between the opening and closing tags.
D.Append the phrase 'Return only JSON' to the end of the system prompt and set temperature to 0.0 before each request.
AnswerA

Defining a tool with an input_schema and instructing the model to call it constrains generation through the model's structured tool-calling pathway, so the extracted fields arrive as a parsed JSON object inside the tool_use block rather than as free text. This removes code fences and trailing prose while keeping the model focused on the invoice content, giving both clean parsing and high extraction accuracy.

Why this answer

Constraining the response through a tool definition with an input_schema channels generation into the model's structured tool-calling pathway, so the extracted invoice fields arrive as an already-parsed object instead of free-form text. This eliminates markdown fences and trailing commentary while keeping the model focused on the document content. Prompt phrasing and sampling parameters reduce, but do not remove, format drift.

Exam trap

The trap here is assuming that adding 'Return only JSON' or lowering temperature guarantees parseable output, when only schema-constrained generation removes format drift.

67
MCQeasy

In an Evaluator-Optimizer loop, which component is responsible for ensuring that the generated content adheres to the organization's safety and brand guidelines?

A.The Evaluator agent.
B.The Optimizer agent.
C.The end-user.
D.The underlying model provider's safety filters.
AnswerA

The Evaluator acts as an independent quality gate that reviews the output produced by the Optimizer. By incorporating safety and brand guidelines into the Evaluator's prompt or logic, you ensure that all generated content is vetted for compliance before being finalized, which is a critical design pattern for maintaining organizational standards.

Why this answer

The Evaluator component is responsible for checking the output against a predefined set of rules, which include safety and brand guidelines. By acting as a quality gate, the Evaluator can intercept problematic content before it is finalized or presented to the user. This ensures that the Optimizer's output is not only functional but also compliant with organizational standards, providing a necessary layer of control in an autonomous agentic process.

Exam trap

Candidates often think the Optimizer (the generator) should be trusted to follow guidelines, ignoring the need for an explicit check.

68
Multi-Selecthard

An architect is standardizing Claude Code usage across a large engineering organization. They want to ensure that every developer's sessions automatically inherit a curated set of project conventions and that destructive shell commands are blocked unless explicitly approved. Which TWO configurations should the architect implement? (Choose two.)

Select 2 answers
A.Instruct each developer to run /config and manually set the desired conventions on first launch
B.Enable auto-approval for all Bash commands to reduce interruptions during long sessions
C.Commit a CLAUDE.md file at the repository root containing the shared coding conventions and architectural notes
D.Place convention notes in a README.md and expect Claude to infer them from repository files
E.Add deny rules for destructive commands such as rm -rf to the project's .claude/settings.json permissions block
AnswersC, E

A committed CLAUDE.md at the repository root is read automatically by Claude Code at session start for every developer who clones the repo, delivering shared conventions without individual setup. It is the documented project memory mechanism and the correct vehicle for durable, team-wide natural-language guidance.

Why this answer

A committed CLAUDE.md at the repository root distributes shared conventions automatically to every session, and deny rules in the project's .claude/settings.json enforce hard blocks on destructive commands organization-wide. Manual per-developer setup and README-based expectations lack reliability and auditability, while blanket Bash auto-approval undermines the safety objective.

Exam trap

The trap here is assuming documentation in a README or manual per-developer configuration provides the same automatic, enforceable coverage as committed project memory plus structured permission rules.

69
MCQeasy

When designing an MCP tool that interacts with a high-latency external API, which strategy should be implemented to ensure a smooth interaction for the end-user?

A.Increase the timeout values on the client side to wait indefinitely for the tool response.
B.Utilize MCP progress notifications to inform the client about the long-running operation's status.
C.Cache all API responses locally on the server to avoid calling the API during tool execution.
D.Split the request into multiple smaller tools to reduce the overall latency of the single API call.
AnswerB

MCP progress notifications allow the server to send updates to the client during a tool execution. This provides real-time feedback to the user, managing expectations during high-latency operations and preventing the perception of a frozen or broken integration while waiting for the final response from the external API.

Why this answer

Implementing asynchronous status updates or progress reporting is critical for long-running tool operations in MCP. Since the protocol supports tool-initiated notifications, the server can inform the client about the status of a request before final completion. This prevents timeouts and provides transparency, ensuring the user experience remains responsive even when the underlying tool depends on slow, external network-bound API calls.

Exam trap

Candidates mistakenly suggest standard synchronous waiting or polling mechanisms implemented on the client side, rather than leveraging protocol-native progress notifications.

70
MCQmedium

An architect is building an agentic workflow that interacts with an external, potentially slow API. To prevent the agent from waiting indefinitely for a response, what is the best practice for implementing a timeout and stopping condition?

A.Use the 'stop_sequences' parameter to stop the agent if the API response takes too long.
B.Configure the agent's system prompt to 'time out' after a certain amount of reasoning time.
C.Implement a client-side timeout in the tool execution code and return a tool_result with is_error: true when the timeout is reached.
D.Set the 'max_tokens' parameter to a low value so the agent cannot wait for long API responses.
AnswerC

This is the standard architectural pattern for handling external dependencies. By returning an error result to the agent, the application allows the model to respond to the failure gracefully. This keeps the agentic loop alive and informed, enabling it to retry, log the issue, or decide to terminate the process.

Why this answer

When dealing with external APIs in an agentic workflow, the architect must ensure that the agent does not block indefinitely. The best practice is to implement a client-side timeout in the code that executes the tool call. If the timeout occurs, the code should return a tool result containing an error message (is_error: true).

This allows the agent to acknowledge the failure, adjust its reasoning, and potentially try an alternative strategy or terminate the process, rather than the entire agentic loop hanging and consuming resources while waiting for a response.

Exam trap

Candidates often think the model's 'adaptive thinking' will handle network timeouts, but the model cannot see network-layer failures unless they are fed back as tool results.

71
MCQmedium

An architect is designing a system where Claude must handle complex multi-step customer inquiries. The current implementation uses a single prompt, but it often fails on high-reasoning tasks. Which agentic pattern should be implemented to allow a primary model to decompose the user's request into sub-tasks for specialized worker agents?

A.The Router Pattern
B.The Orchestrator-Workers Pattern
C.The Parallelism Pattern
D.The Evaluator-Optimizer Pattern
AnswerB

This pattern allows a primary agent to analyze a complex request and dynamically generate a plan consisting of multiple sub-tasks. Each worker agent handles a specific portion of the plan, and the orchestrator synthesizes their outputs into a final response, making it ideal for high-reasoning tasks requiring structural decomposition.

Why this answer

The Orchestrator-Workers pattern is essential for high-complexity tasks that require decomposition. By using a central orchestrator to plan and delegate sub-tasks to specialized workers, the system avoids context dilution and prevents the model from being overwhelmed by too many instructions at once. This pattern enhances reliability and allows for more granular error handling and parallel execution of independent sub-tasks in a production environment.

Exam trap

Candidates often try to force a single model to handle too many responsibilities, leading to context bloat and poor performance, rather than delegating tasks via the Orchestrator-Workers pattern.

72
MCQeasy

A user is complaining that Claude's responses are being cut off in the middle of a sentence. What is the most likely cause related to context and reliability settings?

A.The input context exceeds the 200,000 token limit.
B.The model's temperature is set to 0.0.
C.The 'Stop Sequences' parameter is not defined.
D.The 'max_tokens' parameter is set too low for the output.
AnswerD

The 'max_tokens' parameter defines the hard limit for the assistant's response. If the model needs 500 tokens to answer a question but max_tokens is set to 100, the response will be truncated at exactly 100 tokens. Increasing this limit allows the model to complete its thought and provide a reliable answer.

Why this answer

LLMs have a maximum limit on how many tokens they can generate in a single response, which is controlled by the 'max_tokens' parameter. If this value is set too low for the requested task, the model will be forced to stop generating tokens mid-sentence, resulting in a poor and unreliable user experience.

Exam trap

Candidates often misidentify the issue as a model hallucination or a context window overflow, forgetting that the 'max_tokens' parameter is a hard limit on the generated output length.

73
Multi-Selecthard

You are building a document-processing pipeline with the Anthropic Messages API. Claude must extract a fixed set of fields from each document and return them as JSON. In production, you observe two problems: (1) some responses include explanatory prose before the JSON, and (2) some responses omit required fields when the document is ambiguous. You need to make the pipeline more reliable. (Choose two.)

Select 2 answers
A.Add a stop sequence of '\n\n' so Claude stops as soon as it finishes the JSON object.
B.Prefill the assistant turn with `{` to force the response to begin as a JSON object.
C.Set `temperature` to 0 to make the output deterministic and therefore always complete.
D.Increase `max_tokens` to the model's maximum so the response has room for all fields.
E.Define the required fields and their types in the system prompt, and instruct Claude to use null for fields it cannot determine.
AnswersB, E

Prefilling the assistant turn with `{` makes Claude continue directly from that character, so the response cannot start with explanatory prose or a markdown fence. This directly addresses the first observed problem by structurally guaranteeing that the output begins as a JSON object. It is the recommended Anthropic technique for eliminating preamble and is a correct choice for improving reliability.

Why this answer

The two problems are a formatting issue and a completeness issue. Prefilling the assistant turn with `{` structurally prevents prose before the JSON, and specifying required fields with a null fallback ensures keys are always present even when the document is ambiguous. Raising max_tokens, lowering temperature, or adding a stop sequence do not enforce format or completeness and can even truncate valid output.

Exam trap

The trap here is assuming that sampling parameters like temperature or max_tokens can fix structured-output reliability, when only structural constraints and explicit schema instructions do.

74
MCQmedium

In an orchestrator-workers architecture, why is it critical that the orchestrator does not assume the workers are aware of each other's internal state?

A.Because workers are often hosted on different infrastructure where shared memory is technically impossible to implement.
B.To prevent tight coupling between components, ensuring that the orchestrator remains the sole authority for task flow and state management.
C.To reduce the number of tokens spent, as sharing context between workers would require duplicating the prompt for every step.
D.Because the Messages API does not allow more than one model instance to be active within a single conversation.
AnswerB

Treating workers as isolated black boxes ensures that the orchestrator maintains full control over the workflow, which makes the system significantly easier to monitor, debug, and scale, as there are no hidden side effects or dependencies between the different worker agents.

Why this answer

In a well-designed orchestrator-workers system, the orchestrator acts as the sole 'brain' or control layer. If workers attempt to share state or assume knowledge of one another, the architecture becomes tightly coupled and fragile. The orchestrator must be the source of truth, passing only the necessary context to each worker and receiving outputs to reconcile.

This decoupling allows each worker to be tested, updated, or replaced independently without impacting the entire system, adhering to the principle of least privilege and modular design.

Exam trap

Candidates often think that sharing context between workers makes them 'smarter,' but it actually creates hidden dependencies that are hard to debug.

75
MCQmedium

A developer working in a monorepo wants Claude Code to follow the team's TypeScript conventions only when editing files under the `packages/api` directory, while letting other directories use different conventions. What is the most appropriate way to configure this in Claude Code?

A.Create a `CLAUDE.md` file inside `packages/api` containing the TypeScript conventions so Claude Code applies those instructions when working in that directory.
B.Add the TypeScript conventions to the user-level `~/.claude/CLAUDE.md` file so they apply globally to every project the developer opens.
C.Set the `CLAUDE_CODE_MODEL` environment variable to a model fine-tuned on the API package's conventions before starting each session.
D.Add a `settings.json` entry with a `scope` field set to `packages/api` under the project's `.claude` directory to bind conventions to that path.
AnswerA

Claude Code automatically reads `CLAUDE.md` files found in the current working directory and its subdirectories, so placing one inside `packages/api` scopes those conventions to that package. When the session touches files under that path, the nested memory file is loaded, giving directory-specific guidance without affecting other packages in the monorepo.

Why this answer

Claude Code discovers `CLAUDE.md` memory files by walking from the current directory up the tree, so a file placed inside `packages/api` is loaded exactly when the session operates there. This gives the API package its own TypeScript conventions while leaving sibling packages and the repository root untouched, matching the requirement for directory-scoped guidance.

Exam trap

The trap here is assuming that conventions must live in a single global configuration file, when Claude Code actually supports directory-scoped memory files that load based on where the session is working.

Page 1 of 6

Page 2

All pages