Courseiva

CCNA Claude Model Fundamentals Questions

75 of 249 questions · Page 1/4 · Claude Model Fundamentals · Answers revealed

1
MCQeasy

Which term describes the fundamental unit of text that Claude processes, which can be a single character, a part of a word, or a whole word?

A.Bit
B.Token
C.Sentence
D.Prompt
AnswerB

Tokens are the basic units of text for Claude. A token can represent a common word, a part of a word, or even just punctuation. Anthropic's models use a tokenizer to convert raw text into these numerical tokens, which the model then uses for inference and generation.

Why this answer

Understanding tokens is essential for grasping how LLMs like Claude process information and how costs are calculated. Tokens are the 'atomic' units of the model's vocabulary, and the efficiency of the tokenizer directly impacts the model's context window usage and pricing.

Exam trap

Candidates often confuse tokens with words or characters, forgetting that a token is an arbitrary sub-word, character, or whole word chunk defined by the model's specific tokenizer.

2
MCQhard

A DevOps engineer wants to integrate Claude into a CI/CD pipeline to automatically review code changes and post comments on pull requests. Which implementation approach is most appropriate for this headless, automated environment?

A.The Claude web application with a Pro subscription
B.Claude Code in non-interactive mode or via GitHub Actions
C.The Messages API using a 'metadata' field to store the code
D.The Claude Agent SDK with manual browser automation
AnswerB

Claude Code is specifically designed for terminal-based and automated environments. Using the `-p` flag for prompts or the official GitHub Action allows the tool to run programmatically within a pipeline, read the codebase, and perform tasks without a human present in the loop.

Why this answer

For headless environments like CI/CD pipelines, the Claude Code CLI (specifically the official GitHub Action or the CLI in non-interactive mode) is the most appropriate tool. It is designed to run in terminals and automated workflows, providing a standardized way to interact with codebases. While the Messages API could be used, it would require writing a custom integration for file reading and git interaction, which Claude Code handles natively through its agentic capabilities and command-line interface.

Exam trap

Selecting the web application because it is 'easier' to use for reviews.

3
MCQmedium

Refer to the exhibit. In the context of Claude Model Fundamentals, what is the primary purpose of the 'system' field shown in this API configuration?

A.To provide the actual question the user wants to ask.
B.To specify the hardware resources allocated to the request.
C.To set the behavior, persona, and constraints for the model.
D.To bypass the safety filters for sensitive queries.
AnswerC

The 'system' prompt allows developers to define a specific persona or set of rules that Claude must follow. In the exhibit, it is used to constrain the model's output format to JSON and remove conversational filler, providing a consistent framework for the model's responses.

Why this answer

The system prompt is a powerful tool for defining the model's personality, constraints, and output format. It acts as a set of 'guardrails' or 'operating instructions' that the model follows throughout the entire session, ensuring consistent behavior across multiple user turns in a conversation.

Exam trap

Candidates often mistake the system field for a conversational history container or a memory cache, missing that its primary purpose is establishing permanent behavioral constraints and personas.

4
MCQmedium

An application uses Claude Sonnet 5.5 to process user-uploaded PDF invoices. You notice that the `usage.input_tokens` field is consistently high, while `cache_read_input_tokens` is zero. What is the most likely reason for this in the context of cost management?

A.The usage object only reports cache reads for system prompts, not for individual content blocks like images or documents within the messages.
B.The PDF files are too small to meet the minimum cacheable prefix length required by the Claude platform, so they are always processed as standard input.
C.The API is automatically deduplicating the document content, but the usage report incorrectly displays the data as standard input tokens.
D.The application is failing to use the cache_control parameter to mark the document blocks as ephemeral, preventing the system from creating a cache entry.
AnswerD

Prompt caching is an opt-in feature. To reduce costs, the developer must explicitly use the `cache_control` block to mark the document content as cacheable. Without this configuration, the API processes the document as standard, non-cached input tokens, which explains the high input token usage and zero cache read tokens.

Why this answer

The absence of `cache_read_input_tokens` confirms that the application is not leveraging prompt caching for the documents it processes. When a document is sent as a raw block without being explicitly defined as a cached prefix, the API treats all content as standard input tokens. Even if the document is processed repeatedly, without a cache control configuration, the API re-processes the entire document bytes every time, resulting in full input token billing.

Implementing prompt caching is necessary to move these costs to the lower-priced cache read tier.

Exam trap

Many users believe that simply using the Files API or sending the same document twice automatically triggers caching, which is incorrect.

5
MCQmedium

Your team is building a document processing system using the Claude API that requires verifiable evidence for every claim the model makes. You have enabled citations for the document blocks being processed. Which of the following statements accurately describes how these citations contribute to your API usage costs?

A.Citations must be pre-processed as separate input tokens, doubling the document ingestion cost.
B.Citations increase the output token count proportionally to the length of the quoted text.
C.The cited text does not count toward the model's output token usage.
D.Citations are billed based on the number of document blocks referenced in the final response.
AnswerC

Platform documentation clarifies that the text extracted and presented as citations is excluded from output token calculations. This allows developers to request comprehensive evidence from long documents without incurring additional token costs for the verbatim excerpts, making it a cost-effective way to implement grounding and ensure the model remains transparent about its sources.

Why this answer

Citations are a feature of document processing where Claude extracts information and provides evidence from the source material. According to the platform facts, the quoted text returned in these citations does not count toward the output token consumption of the API response. This is a critical design detail, as it means you do not need to worry about the length of the cited evidence inflating your costs or hitting the maximum output token limits.

The citation mechanism effectively provides transparency without direct token-based overhead for the cited blocks themselves.

Exam trap

Candidates often assume that because citations are returned in the content block, they must consume output tokens like standard generated text.

6
MCQeasy

Your team is building a document processing service that uses the Messages API. You want to ensure that your application correctly handles the final status of a request when streaming is enabled. Which of the following is the standard behavior for the API when a request completes successfully?

A.The client must poll the status endpoint until the state changes to 'finished'.
B.The API returns an HTTP 200 status code with a stop_reason of 'end_turn'.
C.The streaming event stream sends a special 'complete' event type.
D.The API automatically closes the connection and returns an empty JSON object.
AnswerB

Successful completion is formally indicated by the 'end_turn' stop_reason, which confirms the model has finished its task. This field is consistently present in the final message object provided by the API, allowing developers to programmatically verify that the generation was not cut off by constraints or safety mechanisms.

Why this answer

In the Messages API, a successful request concludes with a response where the stop_reason is set to 'end_turn'. When streaming is enabled, the server-sent events provide content updates until the final message_delta event signals that the turn has ended. Developers must monitor the stop_reason field in the final message object to verify that the model has finished its execution naturally rather than hitting a limit like max_tokens or encountering a refusal.

This pattern ensures the application can reliably distinguish between finished tasks and truncated or interrupted outputs.

Exam trap

Candidates often assume that the presence of content blocks alone indicates completion, ignoring the stop_reason field which is critical for distinguishing between finished turns and errors.

7
MCQmedium

A developer is building a RAG application and notices Claude 3.5 Sonnet occasionally hallucinates when provided with a large context window. Which architectural adjustment is most effective for improving factual fidelity?

A.Increase the temperature parameter to 1.0 to allow for more creative exploration.
B.Switch to Claude 3 Haiku to benefit from its faster token processing speeds.
C.Implement a semantic reranking step to filter out low-relevance chunks before prompt insertion.
D.Remove the system prompt to allow the model to operate without behavioral constraints.
AnswerC

Semantic reranking significantly improves RAG performance by ensuring that only the most contextually relevant chunks are fed into the prompt. This reduces the cognitive load on Claude, allowing it to focus on synthesized information rather than filtering through potentially irrelevant or misleading document snippets.

Why this answer

Improving factual fidelity in RAG applications relies on reducing the noise-to-signal ratio within the context window. By implementing a reranking step, the developer ensures that only the most relevant document chunks reach the model. Claude performs significantly better when the prompt is constrained to highly pertinent information, as this minimizes the risk of the model prioritizing distractor content or irrelevant retrieval artifacts during the generation phase.

Exam trap

Candidates often suggest increasing the model's temperature or adding more context, failing to realize that excessive, irrelevant information actually increases the likelihood of hallucinations in RAG systems.

8
MCQhard

A software team relies on Claude Opus 5.5 for complex root-cause analysis on massive system logs. While the analysis quality is high, long prompt processing times create operational bottlenecks during emergency incidents. The team is already using prompt caching for system guidelines. Which modification balances reasoning depth and time-to-first-token latency most effectively?

A.Remove system prompt caching breakpoints to force fresh context evaluation on every turn.
B.Replace the Messages API call with the Message Batches API endpoint for real-time response.
C.Set the output_config effort parameter to max on Claude Opus 5.5.
D.Use a subagent powered by Claude Haiku 5.5 to scan logs and return a condensed summary to Claude Opus 5.5.
AnswerD

Delegating high-volume log parsing to a faster subagent drastically reduces the token context size fed into Opus 5.5. Because processing large context windows is a primary contributor to time-to-first-token latency, providing Opus with pre-filtered summary data yields fast responses without sacrificing diagnostic reasoning depth.

Why this answer

For multi-step analysis workloads where a full model like Opus takes significant time to ingest and reason over massive log files, delegating log reading and preliminary extraction to a smaller, faster model (like Haiku 5.5) as a subagent or pre-processor reduces context size for the orchestrator. Opus then processes only condensed summaries, significantly reducing prompt processing time and total latency while keeping top-tier reasoning on the core diagnosis.

Exam trap

Assuming the only way to speed up Opus is disabling adaptive thinking entirely, which compromises diagnostic quality on complex incidents.

9
MCQeasy

A logistics company needs to process thousands of shipping labels per minute to extract destination zip codes and package weights into a structured database. Which model tier is most appropriate for this high-volume, low-complexity task?

A.Claude Opus
B.Claude Haiku
C.Claude Fable
D.Claude Sonnet
AnswerB

Haiku is the fastest and cheapest tier, optimized for high-volume tasks with lower reasoning requirements. It is the ideal choice for simple data extraction where minimizing latency and cost per thousand requests is the primary business driver.

Why this answer

Haiku is specifically designed for high-volume, simple tasks like data extraction and classification. It offers the lowest latency and cost among the tiers, making it the most efficient choice when the 'quality bar' for the task is relatively low and speed is a priority.

Exam trap

Choosing a more capable model like Sonnet out of a belief that 'better' models are always safer for data integrity.

10
MCQeasy

A developer is building a document processing service and notices that their citations are not appearing in the model's output. Which of the following is a requirement for the model to provide native citations in its response?

A.The API must be configured with a specific citation_enabled flag in the metadata object of the request body.
B.The text must be provided in the system prompt rather than the user message to allow for global grounding.
C.The source content must be supplied as a document block within the messages list for the model to generate citations.
D.The developer must manually define a citation schema in the tool definition to allow the model to format its references.
AnswerC

Citations are natively supported when the source data is passed as document blocks. This allows the model to identify the specific segments of the document that support its claims, ensuring the output is grounded and verifiable for the user, which is a core requirement for document-based retrieval and analysis tasks.

Why this answer

For Claude to provide native citations, the source material must be provided as a document block within the Messages API request. The model relies on these specific blocks to ground its answers. If the text is provided as a plain string inside a standard text block, the model lacks the structural association required to generate precise citations.

By using document blocks, the developer enables the model to map its output to specific locations in the source, which is essential for auditability.

Exam trap

Candidates may mistakenly believe that any text pasted into a system prompt or a standard user message can be cited by the model.

11
MCQhard

A team is using Claude Sonnet 5.5 for a document summarization task. They notice that when processing very long PDFs, the model occasionally produces a summary that stops abruptly in the middle of a sentence. Which action should the team take to ensure the summary is complete?

A.Implement a retry logic that automatically restarts the summary generation from the beginning.
B.Reduce the `effort` parameter to 'low' to make the generation faster and avoid the token limit.
C.Use the `stop_sequences` parameter to prevent the model from stopping mid-sentence.
D.Increase the `max_tokens` parameter to allow the model more space to finish the summary.
AnswerD

The abrupt stop in the middle of a sentence is the definitive sign that the model has reached the `max_tokens` limit. By increasing this value, the model is given the necessary headroom to complete its thought process and provide a fully formed summary, which prevents the output from being cut off prematurely.

Why this answer

A summary that stops mid-sentence with stop_reason max_tokens has run out of output budget. On current models thinking tokens also count toward max_tokens, so long documents can need more headroom than expected. Raising max_tokens, streaming when the value is large, and checking stop_reason before using the text are the reliable fixes; resending an unchanged request or tweaking effort does not address the cap.

Exam trap

Candidates may suggest switching to a different model or prompt, but the issue is fundamentally an output capacity limit being reached during a long generation task.

12
MCQmedium

In an agentic workflow, you are using tool use to fetch data from an internal database. The model occasionally hallucinates tool parameters that do not match the schema. How should you address this?

A.Use the `tool_choice` parameter to force the model to use a specific tool, thereby limiting its freedom to hallucinate parameters.
B.Increase the number of examples in the system prompt to show the model the correct tool usage patterns.
C.Set the `strict: true` property on your tool definition to ensure inputs validate against the provided schema.
D.Add a post-tool-use hook in your agent code to validate the tool results and retry if the data returned is incorrect.
AnswerC

With `strict: true` on the tool definition, Claude's tool inputs are guaranteed to validate against the JSON schema, so required fields are present and types match. This removes invented or malformed parameters at the source, before your code ever runs, instead of relying on prompts or after-the-fact checks.

Why this answer

Enforcing schema validation is the most robust way to handle tool use errors. By setting `strict: true` on your tool definition, you guarantee that the model's output will adhere to your JSON schema requirements, including validation of required fields and types. This prevents the model from attempting to use invalid parameters, which is a common form of hallucination in tool-calling workflows.

This approach is superior to prompt-based instructions alone because it provides a programmatic guarantee of input quality.

Exam trap

Candidates often try to solve this by adding long, descriptive instructions to the system prompt, which is less reliable than using built-in strict validation.

13
MCQhard

Which THREE factors are primary considerations when calculating the cost of using the Anthropic API in a production environment?

A.The total number of input tokens sent per request.
B.The number of concurrent API users active.
C.The total number of output tokens generated.
D.The specific model tier (e.g., Haiku vs. Sonnet vs. Opus).
E.The latency of the model response time.
AnswerA, C, D

Input tokens constitute a major portion of the cost per request. Every character and system instruction counts toward this limit, so optimizing prompt length, system instructions, and history management is vital for maintaining a predictable budget as the application scales to handle a larger number of user requests.

Why this answer

Cost management in production relies on understanding the input token count, output token count, and the specific model selected. Since pricing is transparently based on these variables, optimizing the prompt length and response size is the most direct way to control expenditure. Failing to account for these three variables can lead to significant cost spikes as traffic scales or if prompts become excessively verbose over time.

Exam trap

Candidates often overlook the 'output tokens' cost, focusing only on 'input tokens', or they forget that different model tiers (Haiku vs Opus) have vastly different price points.

14
MCQmedium

A researcher is studying the impact of adaptive thinking on model performance. They observe that even when they provide minimal instructions, Claude Sonnet 5.5 still uses a significant number of tokens. Why is this occurring?

A.The API is automatically injecting hidden chains of thought into the system prompt.
B.The model is utilizing 'between_tools' thinking because it was not given a specific task.
C.The model is ignoring the system prompt and using its own internal default logic.
D.Sonnet 5.5 defaults to high effort, which causes it to think deeply by default.
AnswerD

Different models have different default effort levels. Sonnet 5.5 defaults to high effort, meaning it will perform more intensive thinking and consume more tokens than models with lower default effort levels, even for simple tasks. This is intentional behavior designed to ensure high-quality responses.

Why this answer

Claude Sonnet 5.5 defaults to a 'high' effort level. Because adaptive thinking is enabled by default, the model automatically assesses the task and allocates resources accordingly. Even with minimal instructions, the model's default high effort configuration directs it to perform a thorough analysis of the input to ensure it provides a high-quality, helpful response.

This behavior is consistent with its intended use as a balanced, high-capability model, and it confirms that the effort level is the primary driver of token usage, regardless of the prompt's length.

Exam trap

Candidates often think the model only thinks when prompted to do so, forgetting that adaptive thinking is a default behavior influenced by the effort parameter.

15
MCQhard

An application requires Claude to analyze a 180,000-token legal document and find a specific clause. Why might Claude 3 Opus be a better choice for this task than a smaller model like Haiku, even though both have a 200,000-token window?

A.Haiku's context window is only 200,000 tokens for output, not input.
B.Opus has higher 'Needle In A Haystack' recall at large context sizes.
C.Opus can process 200,000 tokens in less than one second.
D.Smaller models automatically truncate inputs over 100,000 tokens.
AnswerB

As the context window fills up, smaller models can sometimes lose 'focus' on information buried in the middle of the text. Opus is engineered to maintain near-perfect recall across the full 200,000 tokens, making it more reliable for finding specific details in very large legal documents.

Why this answer

Context window size is only one factor in model performance. For very large inputs, the model's ability to maintain focus and accurately retrieve information from the middle of the text (recall) is critical. Higher-tier models like Opus are specifically optimized for better performance at these extreme context limits.

Exam trap

Candidates assume that sharing the same maximum token window means smaller models perform retrieval tasks identically to flagship models, ignoring retrieval accuracy disparities.

16
MCQmedium

A developer is building a customer support bot that must maintain its own database of user interactions and look up order status in real-time. Why is the Claude API preferred over the Claude web or desktop apps for this specific use case?

A.The API allows the developer to define custom tools and programmatically manage the conversation flow.
B.The API is the only way to access the Claude Haiku 5.5 model for low-latency responses.
C.The Claude app does not support vision or document processing, which the bot requires.
D.The API is stateful and automatically stores user order history in Anthropic's cloud.
AnswerA

The API provides the necessary primitives, like tool_use and tool_result blocks, to allow the model to interact with a developer's own backend systems, databases, and order management logic in a controlled, automated way.

Why this answer

The Claude API allows for stateless integration where the client manages the conversation history and integrates external logic, such as database lookups and tool definitions. While the Claude app has some capabilities, building a custom bot with specific backend integrations requires the programmatic control of the Messages API and Tool Use.

Exam trap

Assuming the 'Memory' feature in the Claude app is sufficient for external database integration.

17
MCQmedium

Which of the following is an effective technique for reducing hallucination in Claude when answering fact-based questions?

A.Instruct the model to always provide an answer, even if unsure.
B.Include a system instruction that explicitly allows the model to use external knowledge.
C.Provide the context and require the model to answer 'I don't know' if the answer is missing.
D.Run the same prompt three times and take the most frequent answer.
AnswerC

This technique forces the model to treat the context as the sole source of truth. By explicitly providing a fallback strategy for missing information, you prevent the model from attempting to invent an answer, which is the most effective way to ensure factual reliability and reduce potential hallucinations.

Why this answer

Grounding is the primary method to combat hallucination. By providing the model with a 'grounding document' and explicitly instructing it to state 'I don't know' if the answer isn't present in the provided text, you shift the model's behavior from generative to extractive. This pattern is essential for high-stakes enterprise applications, where accuracy and honesty about limitations are more valuable than a guess, protecting the application's integrity and user trust.

Exam trap

Candidates often mistakenly choose 'increasing the temperature' or 'adding more examples', which can actually increase hallucination risk instead of using grounding techniques to force honesty.

18
MCQmedium

A developer wants Claude to act as a specialized technical support assistant for a specific product. Which component of the API call is most appropriate for defining the assistant's persona and product boundaries?

A.The 'user' message role.
B.The 'system' prompt field.
C.The 'assistant' message role in the first turn.
D.The 'max_tokens' configuration parameter.
AnswerB

The 'system' prompt is the correct and intended place for defining the model's persona, constraints, and instructions. It separates the behavioral instructions from the dynamic user input, ensuring the model adheres to its assigned role and product scope throughout the entire session, regardless of the conversation's depth.

Why this answer

The system prompt is the designated field for defining the assistant's persona, expertise, and operational boundaries. By clearly articulating these in the system prompt, you ensure consistency throughout the conversation. This is vital for maintaining a professional, reliable brand presence in AI-powered customer support, as it keeps the model grounded in its designated role and prevents it from straying into off-topic or unauthorized assistance.

Exam trap

Test-takers sometimes try to define persistent personas within the user message, failing to use the dedicated top-level parameter.

19
MCQeasy

Your engineering team is building an application that integrates with the Claude API. A junior developer suggests using a short model identifier like `claude-sonnet` without version numbers in the production configuration files to automatically inherit the latest updates. Why is this practice discouraged for enterprise production deployments?

A.Using unpinned model IDs automatically disables prompt caching features for all subsequent requests in that session.
B.Unpinned identifiers prevent version tracking, breaking reproducible outputs and bypassing necessary pre-deployment evaluation gates.
C.Short names cause the API client library to throw a validation error during the initial handshake.
D.Abbreviated model names force the API to route traffic through slower regional proxy servers, increasing network latency.
AnswerB

Explicit model identifiers ensure that production systems maintain reproducible behaviors and allow teams to conduct proper evaluation cycles before adopting updates. Relying on floating aliases or short names exposes applications to unvetted behavioral changes.

Why this answer

Pinning an exact model ID, such as claude-sonnet-5-5, keeps production on the model version the team has evaluated. Unpinned or abbreviated identifiers can lead to behavior changes when a new model is adopted, without the team having re-run its evaluations. Pinning keeps behavior stable and lets the team decide, after testing, when to move to a new version.

Exam trap

Candidates often assume that model aliases or short names without version suffixes are best practices for staying up to date, forgetting the need for strict determinism and pre-release evaluation in production.

20
MCQhard

A researcher is analyzing the impact of thinking on token usage and cost. How are thinking tokens accounted for in the API?

A.Thinking tokens are part of the output tokens and count toward max_tokens.
B.Thinking tokens are counted as input tokens because they occur before the answer.
C.Thinking tokens are reported under cache_read_input_tokens because the reasoning is reused across turns.
D.Thinking tokens are free and do not count toward the output limit.
AnswerA

Thinking tokens are an integral part of the assistant's response, and therefore they count toward the total output token usage and the max_tokens limit. Because they are generated as part of the output, you must ensure your max_tokens budget is large enough to accommodate both the thinking process and the final answer.

Why this answer

On current models thinking is adaptive and on by default, and the thinking tokens the model generates are output. They count toward the max_tokens limit for the turn, so max_tokens must leave room for both the reasoning and the final answer. A very small max_tokens can therefore end the response before any answer text appears.

Exam trap

Candidates often assume that thinking tokens are a separate category of tokens that do not count against the output limit, which is incorrect.

21
MCQeasy

Which of the following statements correctly describes the purpose of the 'Sonnet' model tier in the Anthropic ecosystem?

A.It offers a balance of speed, capability, and cost, making it suitable for everyday coding and agentic work.
B.It is the most capable model tier, intended for the hardest reasoning tasks.
C.It is a legacy model tier that is no longer recommended for new projects.
D.It is the fastest and cheapest model, ideal for simple high-volume tasks.
AnswerA

Sonnet 5.5 is specifically engineered to provide this balance. It is versatile enough to handle coding and agentic tasks effectively while remaining cost-effective, which is why it is widely used for production workloads that require both intelligence and efficiency.

Why this answer

Claude Sonnet 5.5 is designed specifically as the balance point between speed, capability, and cost. It is engineered to be a versatile workhorse suitable for a wide range of everyday coding, agentic tasks, and data processing requirements where neither the raw power of Opus/Fable nor the extreme speed of Haiku is the sole priority. This makes it the default choice for many enterprise applications needing reliable performance at scale.

Exam trap

Candidates often confuse Sonnet with the most capable or the fastest model, failing to recognize it as the 'balanced' tier.

22
MCQeasy

A data scientist is comparing the performance of Claude Sonnet 5.5 and Claude Opus 5.5 for a complex summarization task. Why is it important to use different model IDs when running these comparative tests?

A.Each model ID ensures that the request is routed to the architecture designed for that specific tier.
B.You must request permission for each model ID before it can be used in your code.
C.The API automatically chooses the best model if you provide both IDs.
D.The API only accepts one model ID per workspace to prevent confusion.
AnswerA

Model IDs are direct references to specific model architectures. By using the correct ID for each test, you ensure that the request is processed by the intended model tier. This is critical for valid performance comparisons, as it ensures that the results are representative of the specific model being benchmarked.

Why this answer

Using the correct model IDs is essential for comparative analysis because each ID points to a fundamentally different model architecture with distinct reasoning capabilities and performance profiles. If you do not explicitly use the correct ID for each test, you will not be able to accurately attribute results to the specific model being evaluated. Comparative analysis relies on the premise that the underlying model is the only variable changing, and hardcoding the correct IDs ensures that you are measuring the true performance of each model tier.

Exam trap

Candidates might think that the API can infer the model based on the complexity of the prompt, but the model ID is the only determinant of which model is executed.

23
MCQhard

Your application uses a specific model ID, 'claude-sonnet-5-5'. A teammate suggests that to save costs, you should dynamically switch to 'claude-haiku-5-5' whenever the system load is high. What is the primary risk of this approach?

A.The API will reject requests if you switch model IDs within the same session.
B.Switching models will cause the prompt cache to be deleted automatically by the server.
C.The different models have different capabilities, and a task requiring Sonnet might fail when processed by Haiku.
D.The API requires a restart of the client-side SDK to switch to a different model.
AnswerC

Sonnet and Haiku have different reasoning capabilities. If your application logic depends on the specific level of reasoning provided by Sonnet, Haiku may not be able to produce the same quality of output. This can lead to incorrect data extraction, poor summarization, or logical errors in your pipeline.

Why this answer

Switching models based on system load without re-evaluating the task's requirements is dangerous. Different models have different capabilities; a task that requires the reasoning power of Sonnet may fail or produce poor results if handled by Haiku. Furthermore, such switching often requires changes to system prompts, effort settings, and expected output formats.

Without rigorous testing to ensure that both models perform the task correctly, you risk introducing silent failures or regressions into your production system, which is a major violation of responsible AI deployment practices.

Exam trap

Prioritizing cost-saving over model capability without considering that different models may not be drop-in replacements for complex logic.

24
MCQhard

Your engineering team is implementing a system that must support multiple Claude model families simultaneously to optimize for different cost and quality requirements. What is the primary architectural concern when managing these different model IDs in a shared request-handling service?

A.You must include the model family name in the metadata field for every request.
B.You must implement different API client libraries for each model family.
C.You must route requests to different regional API endpoints based on the model family.
D.You must ensure your service maps the chosen model ID to appropriate application configurations like effort levels.
AnswerD

Different models have different default effort levels and capability profiles. Mapping the model ID to the correct application-level parameters ensures that your system leverages the specific strengths of each model, such as using higher effort for Opus on complex tasks while keeping Haiku efficient for simple ones.

Why this answer

The primary concern is ensuring that the service handles the model-specific behavior, such as default effort settings, correctly for each ID. While the API structure is unified, models like `claude-sonnet-5-5` and `claude-opus-5-5` have different default adaptive thinking behaviors and capabilities. A robust service must map the model ID to appropriate application-level configurations—such as timeout handling, effort levels, and max_tokens—to ensure that the specific characteristics of each model are respected, preventing performance issues or suboptimal results when switching between tiers at runtime.

Exam trap

Candidates often assume all models behave identically, ignoring that default effort and thinking configurations vary by tier.

25
MCQmedium

A developer needs to ensure that Claude 3.5 Sonnet consistently follows a specific JSON schema for structured data extraction. Which implementation strategy provides the highest level of deterministic output format control?

A.Instructing the model to output valid JSON within a system prompt.
B.Utilizing Few-Shot prompting with XML tags.
C.Defining a structured schema using the tool_use parameter.
D.Appending a post-processing script to parse the output as JSON.
AnswerC

The tool use feature allows developers to specify an exact JSON schema that the model must satisfy. By leveraging this, the Anthropic API forces the model to generate content that conforms to the defined input schema, significantly reducing parsing failures and ensuring high-quality, structured data extraction for integration.

Why this answer

Using tool use (function calling) with a defined schema is the industry-standard approach for structured data extraction with Anthropic models. By defining specific JSON schemas in the tools parameter, the model is constrained to generate valid, parsable objects that match the expected structure. This method minimizes hallucinations compared to prompt-based formatting, ensuring downstream systems can reliably consume the output without manual parsing errors or type mismatches.

Exam trap

Candidates often suggest prompt engineering techniques like 'asking for JSON output', which is non-deterministic, instead of utilizing the 'tool_use' parameter for robust, schema-enforced output structure.

26
MCQeasy

What is the primary function of the 'stop_sequences' parameter in the Claude API?

A.To specify the maximum number of tokens the model is permitted to generate.
B.To define the delimiters that signal the end of a model response.
C.To filter out harmful or restricted content from the model output.
D.To reset the model state to its original pre-trained condition.
AnswerB

Stop sequences explicitly define strings that trigger an immediate cessation of the generation process. By setting these, developers ensure that the model stops at logical points, which is essential for structured data extraction or ensuring the model does not continue generating after finishing a specific task.

Why this answer

The stop_sequences parameter allows developers to define specific strings that, when encountered by the model, force it to cease generation immediately. This is crucial for controlling output length and structure, particularly when integrating Claude into automated workflows where the model needs to stop at specific boundaries, such as a closing delimiter or a specific marker, preventing unnecessary token usage and ensuring predictable program execution.

Exam trap

Candidates frequently mistake stop_sequences for a tool to manage model behavior or tone, rather than recognizing it as a strictly functional mechanism for terminating generation at specific character boundaries.

27
MCQhard

An engineer is debugging an application that processes large financial prospectuses using Claude. They notice that while citations are enabled on the document block, the model occasionally provides answers referencing specific figures without returning any citation blocks. What is the most likely reason for this behavior?

A.The model determined that the specific answer relied on general background knowledge rather than the cited document source.
B.Citations require a persistent citation ID stored across multiple turns, which was missing from the stateless request.
C.The max_tokens limit was set too high, causing the model to truncate the response before citations could be appended.
D.The document was uploaded via the Files API rather than included directly as a base64 or URL document block.
AnswerA

This is correct because models only generate citations when they directly draw quoted text from a citation-enabled document block. If the model answers using internal parametric knowledge or unreferenced general reasoning, citation blocks will naturally be omitted from the API response.

Why this answer

Citations are designed to help ground answers in provided documents, but models do not generate citations for every single factual statement or piece of general knowledge. If the model relies on information that was not explicitly anchored to a citation-enabled document block or if the prompt does not enforce strict grounding, citations may be omitted. Ensuring proper prompt design and ensuring the document is correctly formatted as a document block are essential for consistent citation returns.

Exam trap

Candidates often assume that enabling citations forces the model to cite every single sentence of its response.

28
MCQeasy

A legal research assistant powered by Claude Opus 5.5 answers questions about regulatory filings. The team notices that while Claude reliably extracts facts from supplied exhibits, it occasionally invents specific statute numbers and dates when answering queries relying purely on its pre-trained parametric memory. Which core platform characteristic accounts for this behavior?

A.The default context window truncates older historical knowledge to prioritize recent language modeling patterns.
B.Claude Opus 5.5 automatically searches internal Anthropic documentation when external legal citations are omitted from the user prompt.
C.Parametric memory relies on probabilistic associations acquired during pre-training rather than an infallible, retrievable database of factual records.
D.The model's internal safety classifier triggers a partial refusal fallback that replaces real statute numbers with randomized placeholders.
AnswerC

Pre-trained model weights store statistical associations rather than structured databases of ground truth. When prompted for niche legal statutes without external reference materials in context, the model predicts likely token sequences, which can produce grammatically fluent yet factually inaccurate citations.

Why this answer

Large language models like Claude Opus 5.5 operate over statistical patterns learned during training rather than querying a live, indexed relational database of facts. When relying exclusively on pre-trained parametric weights without external grounding documents or search tools, models may hallucinate specific arbitrary details such as statute section numbers or dates. To ensure factual accuracy on high-stakes tasks, relevant source documents must be passed directly into context or accessed via tools.

Exam trap

Believing larger frontier models like Claude Opus 5.5 have perfect factual recall and cannot hallucinate without buggy prompts.

29
MCQmedium

An enterprise developer is reviewing token usage metrics for a high-volume customer support application powered by Claude Sonnet 5.5. The application frequently sends a large, static system prompt and an extensive set of tool definitions alongside short incoming user messages. To optimize operations, the team implements prompt caching breakpoints. When analyzing subsequent API response usage fields, what specific behavior should the developer expect regarding cache billing and token accounting?

A.Tokens read from the cache incur a substantially lower cost than standard input tokens, while cache writes incur a slightly higher cost than standard input tokens.
B.Prompt caching prevents any input tokens from being counted in the usage object, shifting all operational costs entirely onto output generation metrics.
C.Cached input tokens reduce the output token count because the model processes the cached context without generating internal reasoning steps.
D.Tokens read from the cache are billed at the exact same rate as regular input tokens, but output tokens generated by the model are eliminated entirely from the billing calculation.
AnswerA

Cache reads cost roughly a tenth of standard input tokens, while cache writes carry an increased cost. This economic structure rewards applications that frequently reuse static prefixes like long system prompts and extensive tool definitions across multiple sequential requests within the expiration window.

Why this answer

Prompt caching optimizes costs by creating an ephemeral prefix match across system prompts, tools, and messages. When a cache hit occurs, the input tokens that match the cached prefix are billed at a significantly lower cache read rate compared to standard input tokens. However, the initial creation of the cache writes the tokens to memory at a higher cost.

Monitoring the usage object allows developers to verify cache performance by observing increases in cache_read_input_tokens and decreases in standard input token billing.

Exam trap

Candidates often assume that cached tokens are entirely free or that cache creation costs the same as standard input tokens, misinterpreting the financial trade-offs of prompt caching.

30
Multi-Selectmedium

A developer is concerned about the token usage of an agent that frequently searches a database of 500 different tools. Which TWO features or techniques would most effectively reduce the context window consumption related to these tool definitions?

Select 2 answers
A.Use the 'thinking: {type: "adaptive"}' setting to let Claude automatically compress tool descriptions.
B.Implement subagents that each have access to a small, relevant subset of the 500 tools.
C.Enable 'strict: true' on all 500 tool definitions to minimize the metadata overhead.
D.Move tool definitions into the 'system' prompt to take advantage of automatic tool compression.
E.Use 'tool search' with 'defer_loading' so the model only loads relevant tool definitions on demand.
AnswersB, E

Subagents create separate context windows. By delegating tasks to a subagent with only 10 tools, the orchestrator avoids the token cost of having all 500 tools in its own context window for every turn.

Why this answer

Tool search (using 'defer_loading') allows Claude to discover tools only when needed rather than loading all 500 definitions into the context window at once. Additionally, using subagents allows for 'context isolation,' where specialized agents only have access to the specific tools required for their subtask, keeping the main orchestrator's context window clean.

Exam trap

Suggesting 'strict: true' as a way to save tokens, when it actually just enforces schema validation.

31
MCQmedium

An engineering team is developing a real-time dashboard that displays Claude's reasoning process. They notice that when they stream the response, the thinking process seems to be summarized or missing in the output. Why is this occurring?

A.The team is using an outdated model ID that does not support the adaptive thinking feature.
B.The raw chain of thought is never exposed, and thinking blocks may be summarized or omitted.
C.Streaming only captures the final answer text, not the thinking blocks generated during the process.
D.The team forgot to set the `thinking` parameter to `enabled` in the request body.
AnswerB

The platform explicitly states that the raw internal chain of thought is never exposed. The model's thinking process is internal and adaptive, and the API may return summarized or omitted thinking information. Applications must be designed to handle the final output and not expect a granular view of the model's internal reasoning steps.

Why this answer

On current models, thinking is enabled by default and adaptive. However, the raw chain of thought is never exposed to the API user. The thinking process may be summarized or omitted entirely by the server, as the internal chain of thought is not a guaranteed, transparent output.

The application should rely on the final content and the `stop_reason` rather than attempting to log or parse internal reasoning traces, which are not part of the public API surface.

Exam trap

Candidates often assume that streaming will reveal the full, raw internal reasoning trace, which contradicts the platform's design for model safety and output consistency.

32
MCQeasy

Your organization is implementing an AI-powered document review system that processes sensitive financial reports. You need to ensure that the model's reasoning process is not exposed to end-users, while still allowing the system to use its advanced reasoning capabilities. How should you handle the model's thinking output?

A.Rely on the API's default behavior, which does not expose the raw chain of thought to the user.
B.Disable the thinking capability in the API request settings to ensure no reasoning traces are generated.
C.Use a secondary model to re-write the output and remove any potential reasoning artifacts.
D.Manually parse the raw API response to strip out the internal thinking chain before presenting it to the user.
AnswerA

The API is designed to handle thinking internally; it does not expose the raw chain of thought to the end-user, meaning your application can safely use the model's advanced reasoning capabilities without needing to build custom filters for the model's internal process.

Why this answer

The API's thinking capability is designed to allow the model to reason through complex tasks. By design, the raw chain of thought is not exposed in the output; only the summarized or final content is returned. You do not need to manually strip or hide the thinking blocks because they are handled internally by the API.

Your application simply processes the content blocks provided by the model in the standard response format, ensuring your users receive the final answer without seeing the internal reasoning traces.

Exam trap

Thinking that you need to implement a complex filtering or parsing layer to manually remove internal reasoning data from the model's output.

33
MCQeasy

A developer is choosing a Claude model for a high-volume classification task that must meet a strict monthly budget. The task is straightforward and does not require deep reasoning. Which selection principle best fits this scenario?

A.Choose a model based on its maximum context window size, since a larger window guarantees lower cost per request.
B.Choose a model randomly and rely on prompt engineering to compensate for any capability gaps.
C.Choose the largest, most capable Claude model available to maximize classification accuracy regardless of cost.
D.Choose the smallest, fastest Claude model that meets the accuracy bar, then validate with a sample of real inputs.
AnswerD

Matching model capability to task complexity keeps costs low while still satisfying accuracy needs. A small, fast model is typically cheapest per token and sufficient for straightforward classification. Validating against real inputs confirms the choice before committing, which is the disciplined way to balance budget against quality.

Why this answer

Cost-effective model selection starts by matching capability to task difficulty. A simple classification task rarely needs the most capable model, so the smallest model that clears the accuracy bar is the right default, validated against representative inputs. Choosing on context window or at random ignores the actual drivers of cost and quality.

Exam trap

The trap here is equating more capable models with better outcomes on every task, when simple workloads are usually served more economically by smaller models.

34
MCQmedium

A developer configures a request to Claude Sonnet 5.5 with `max_tokens: 10`, intending to receive a one-word output label such as "Positive" or "Negative". Instead, the response ends prematurely without returning any label text. Which factor accounts for this result?

A.Claude Sonnet 5.5 requires `stop_sequences` to be explicitly defined whenever `max_tokens` is configured below 100.
B.Low `max_tokens` values force the Messages API into synchronous batch mode, delaying text generation until context fills.
C.Setting `max_tokens` below 50 causes the Messages API to reject the request with a 400 validation error.
D.Thinking tokens count against `max_tokens`, and adaptive thinking consumes the allocated 10 tokens before output text generation begins.
AnswerD

Adaptive thinking is enabled by default on Claude Sonnet 5.5, and all generated thinking tokens count toward the configured `max_tokens` ceiling. When `max_tokens` is set to an extremely low number like 10, the token budget is exhausted entirely during the initial reasoning phase, leaving zero remaining tokens to write the text output block.

Why this answer

On current Claude models such as Claude Sonnet 5.5, adaptive thinking is enabled by default. All thinking tokens produced during internal reasoning count directly toward the `max_tokens` limit specified in the request. Setting `max_tokens` to an extremely small value like 10 causes the model to consume its entire token budget within internal thinking blocks before generating any output content.

To obtain concise outputs without truncation, developers should lower the effort level or use structured output constraints rather than restricting `max_tokens` to tiny values.

Exam trap

Candidates often mistakenly assume that `max_tokens` applies exclusively to final text output, forgetting that adaptive thinking tokens count toward the response limit.

35
MCQhard

Refer to the exhibit. A company is building a translation service for live subtitles where latency must be under 200ms per segment. Which Claude 3 model family member is the only viable candidate based on the provided performance and cost data?

A.Claude 3 Opus
B.Claude 3 Sonnet
C.Claude 3 Haiku
D.All Claude 3 models are equally viable.
AnswerC

Haiku is specifically designed for speed. The exhibit lists it as 'Ultra-Low' latency, making it the most capable of meeting the 200ms requirement for live subtitles. Additionally, its low cost makes it economically viable for the high token volume generated by continuous live translation.

Why this answer

In real-time applications like live subtitling, latency is the primary constraint. Even if a model is more intelligent, if it cannot meet the timing requirements, it is unusable. Claude 3 Haiku's ultra-low latency makes it the only choice for near-instantaneous feedback loops required for live media.

Exam trap

Candidates often choose the 'most intelligent' model (Opus) instead of the 'fastest' model, ignoring the specific constraint that latency must be under 200ms, which is the defining requirement for live services.

36
MCQmedium

When evaluating model output, what does the term 'latency' specifically refer to in the context of the Anthropic API?

A.The number of tokens the model can process per second.
B.The total delay from sending a request to receiving the response.
C.The frequency of API rate limit errors.
D.The cost per token based on request time.
AnswerB

Latency is the end-to-end measure of how long the user waits for the API response. This includes network transit time, server-side processing time, and the time taken for the model to generate the tokens. It is the primary metric for ensuring a responsive, high-quality user experience in applications.

Why this answer

Latency refers to the total time elapsed between sending the request to the API and receiving the response. In production systems, measuring this is critical for user experience, as high latency can make applications feel sluggish or unresponsive. Understanding that latency is influenced by factors like input/output token counts and system load helps developers design more performant features, such as streaming or pre-computing content for the user.

Exam trap

Candidates often confuse latency with throughput or time-to-first-token, failing to recognize that latency specifically measures the total end-to-end delay from request transmission to final response reception.

37
MCQmedium

You are developing an agentic application where the system prompt and a large set of tool definitions are sent with every API call. Which strategy is best to minimize input token costs while maintaining functionality?

A.Remove the system prompt to save on input tokens.
B.Dynamically reorder tool definitions based on the expected task.
C.Send only the tools required for the current step in the loop.
D.Use prompt caching for the system prompt and tool definitions.
AnswerD

Since the system prompt and tool definitions remain constant across agent turns, caching them allows the API to read this large data block at a fraction of the cost of standard input tokens. This is the most effective way to scale agentic applications that rely on complex, static tool sets and prompts.

Why this answer

In an agentic loop, the system prompt and tool definitions are typically static. By ensuring these elements appear at the beginning of the message list and using prompt caching, you ensure the model can read this prefix from the cache. Because any change in the prefix invalidates the cache, keeping these elements stable and at the top of the request is essential for maximizing cache hits and minimizing the cost of sending large tool definitions repeatedly.

Exam trap

Candidates often forget that tool definitions count toward input tokens and that their order matters for cache invalidation.

38
MCQeasy

An architect is designing an enterprise document extraction pipeline using Claude Sonnet 5.5. What are the context window capacity and maximum single-request output token limits for current Claude models like Sonnet 5.5?

A.A 1,000,000 (1M) token context window with an unrestricted, unlimited output capacity per turn.
B.A 1,000,000 (1M) token context window with up to a 128,000 (128K) token output limit.
C.A 200,000 token context window with up to a 4,096 token output limit.
D.A 128,000 (128K) token context window with up to a 1,000,000 (1M) token output limit.
AnswerB

Current model families (Claude Opus 5.5, Sonnet 5.5, and Haiku 5.5) feature a 1M-token context window capacity for processing input and context, along with support for up to 128K output tokens (large `max_tokens` values require streaming in SDKs).

Why this answer

Current Claude model tiers—Opus 5.5, Sonnet 5.5, and Haiku 5.5—support a 1,000,000 (1M) token context window. This expanded context allows applications to ingest massive codebases, multi-hundred-page documents, or extensive conversation histories in a single prompt context. For response generation, current models support up to 128,000 (128K) output tokens per single request turn.

To utilize large output token allocations safely without HTTP timeouts, Anthropic recommends using streaming in the SDKs when setting high `max_tokens` values.

Exam trap

Candidates often confuse context window capacity (input) with maximum response length (output), or recall legacy limits from older model generations.

39
Multi-Selectmedium

An analyst is using Claude to compare multiple policy documents. They want to use the native citations feature to ensure accuracy. Which TWO statements correctly describe how citations and document blocks interact in the Messages API?

Select 2 answers
A.Citations are automatically enabled for any PDF document over 50 pages.
B.Citations can be enabled on document blocks referenced via 'file_id'.
C.Citations are only available when using the 'claude-haiku-5-5' model.
D.Claude can provide citations for documents provided as base64 content blocks.
E.Enabling citations removes the need for the 'system' prompt context.
AnswersB, D

The Files API allows for efficient document reuse, but the citation feature is configured within the message content block that references the 'file_id'. This ensures that even when a file is stored on the server, the model knows to provide grounding metadata for that specific request.

Why this answer

Citations are a property of the document block, meaning they must be configured per document. When enabled, Claude uses these citations to ground its response, providing specific snippets from the provided documents. This prevents the model from relying solely on its internal training data.

Furthermore, citations work regardless of whether the document is provided via a direct base64 string, a URL, or a 'file_id' from the Files API, as long as the citation feature is enabled in the content block.

Exam trap

Believing citations only work with the Files API or that they are enabled globally for the entire message list.

40
MCQmedium

When using the Claude API, a developer receives a `stop_reason` of `tool_use`. What is the correct next step for the application logic to take?

A.Display the tool's output to the user and end the session
B.Retry the request with a higher `max_tokens` value to allow the tool to complete
C.Execute the tool locally and send a new message containing the `tool_result`
D.Wait for the Claude server to finish executing the tool and send a follow-up response
AnswerC

The developer must parse the tool_use block, run the actual function in their own environment, and send the results back to Claude in a new user message to continue the conversation loop.

Why this answer

When Claude returns a stop_reason of tool_use, it is signaling that it needs the result of a tool execution before it can continue. The developer must extract the tool call details, execute the corresponding code, and then send a new request to the API containing the tool_result blocks.

Exam trap

Thinking the API automatically executes the tool and the developer just needs to wait for the final answer.

41
MCQmedium

A developer is building a chat application and notices that when streaming long outputs, the total token count reported in the usage object sometimes differs from their client-side calculation. What is the most likely cause?

A.The usage object only reports tokens for the first 1000 characters of the response, causing a mismatch for long-form outputs.
B.Streaming events are lossy, and some tokens are dropped during the network transmission, leading to discrepancies in the reported usage metrics.
C.The usage object includes thinking tokens, whereas the developer's client-side calculation only counts the visible text tokens returned in the stream.
D.The API usage object reports tokens based on a predictive estimate rather than the actual number of tokens processed during the generation.
AnswerC

Current models think adaptively, and thinking tokens are counted as output tokens in usage. The thinking the API returns may be summarized or omitted, so a counter based on the visible text will report fewer tokens than the API's usage object.

Why this answer

The usage object reported at the end of the API response (delivered via the message_delta event) includes all tokens generated by the model, including thinking tokens if adaptive thinking is active. If the developer is only counting text tokens in their UI-side parser, they will inevitably underestimate the total token count. Because adaptive thinking is on by default and thinking tokens count toward the max_tokens limit and usage, the discrepancy arises from the developer ignoring the hidden thinking process that the model performs.

Exam trap

Forgetting that thinking tokens are a component of the total output tokens on current models.

42
MCQhard

A financial firm is building a multi-turn conversational chat system where users ask questions about lengthy annual reports. To enable source attribution, the team attaches large PDF files as document content blocks in the messages array with citations enabled. How are citations handled across multiple turns in the Messages API?

A.Citations require the Files API and cannot be generated directly on document content blocks provided in standard message payloads.
B.Citations are assigned persistent identifiers in the backend database that can be cross-referenced by ID in future turns.
C.Citations automatically populate the system prompt on subsequent turns to maintain evidence lineage without token overhead.
D.Citations have no persistent IDs across turns, requiring the client application to manage context and payload state per request.
AnswerD

Citations returned by the API do not feature persistent identifiers across turns. Every request to the Messages API must supply the necessary document context and message history, though prompt caching can be utilized to make re-sending documents highly cost-effective.

Why this answer

In the Anthropic Messages API, citations are generated dynamically within response objects and do not maintain persistent identifiers across conversational turns. Because the API is stateless, each turn evaluates the context provided in the payload. While document content blocks or uploaded file references can be reused across turns (and optimized via prompt caching), citation objects themselves do not carry turn-to-turn persistent IDs.

Exam trap

Believing that citation objects persist unique system-level IDs across conversation turns that can be directly referenced in subsequent turns.

43
MCQmedium

A data engineer is using Amazon Bedrock to invoke Claude 3 Haiku for classifying customer feedback into categories. They notice that the model sometimes returns categories that are not in the predefined list. Which change to the prompt is most likely to improve adherence to the allowed categories?

A.Increase the temperature to 1.0 so Claude explores more creative category assignments.
B.Add a stop sequence that matches the first invalid category so Claude stops generating when it deviates.
C.Reduce the max_tokens parameter so Claude has less room to generate invalid categories.
D.Provide a few-shot examples in the prompt showing correct classifications for similar feedback, including the exact category labels.
AnswerD

Few-shot examples demonstrate the desired input-output mapping and reinforce the exact category labels. Claude learns from the pattern and is more likely to output only the allowed categories. This is a prompt engineering technique that improves adherence without changing model parameters. Including examples that cover edge cases and explicitly show the format helps the model generalize correctly to new feedback.

Why this answer

Few-shot examples in the prompt show Claude the exact category labels and the expected format, which significantly improves adherence to a predefined set. By demonstrating correct classifications, the model learns the pattern and is less likely to invent new categories. Other parameters like temperature, stop sequences, and max_tokens affect randomness, truncation, and length, but do not teach the model which labels are valid.

Exam trap

The trap here is thinking that lowering max_tokens or adding stop sequences can enforce a category list, when only prompt-level guidance like few-shot examples reliably shapes label selection.

44
MCQhard

An engineering team wants Claude to classify thousands of support tickets into categories. They need the model to always return one of five exact category labels. Which approach most reliably constrains the output to those labels?

A.Use a high temperature so the model explores all categories evenly.
B.List the five allowed labels in the system prompt and instruct the model to output only one of them.
C.Post-process the model's free-text output with a keyword search for category names.
D.Ask the model to 'pick the best category' in the user message.
AnswerB

Enumerating the exact allowed labels and instructing the model to return only one of them gives a precise constraint. The system prompt applies to every request, so the model consistently sees the closed set. This directly satisfies the requirement that outputs match one of five fixed strings, making downstream parsing reliable.

Why this answer

To force output into a closed set of labels, the prompt must enumerate the allowed values and instruct the model to return exactly one. Placing this in the system prompt ensures the constraint applies to every classification request. Vague instructions, high temperature, or downstream keyword matching all allow invalid or ambiguous outputs that break automated pipelines.

Exam trap

The trap here is relying on post-hoc parsing or vague wording to fix classification output, when the robust solution is to define the exact allowed labels and constrain generation up front.

45
MCQmedium

A developer is building a technical support agent using the Claude API. The agent must answer questions about a proprietary software framework released in late 2025. During testing, Claude occasionally provides incorrect syntax for this framework. What is the most effective way to address these knowledge limits within the Messages API?

A.Include the framework's documentation in the system parameter or as user message content.
B.Use the Messages API MCP connector to automatically retrain the model on the new syntax.
C.Enable the memory tool to allow Claude to search its internal training database for the framework.
D.Set the model parameter to claude-fable-5-1 to ensure the widest possible knowledge base.
AnswerA

Providing the necessary documentation directly in the context window (via the system prompt or messages) allows Claude to use its reasoning capabilities on the provided text, overcoming the limitation of its static training data cutoff.

Why this answer

Since Claude's internal training data has a cutoff, it will not have inherent knowledge of proprietary or very recent software. The best way to handle this is to provide the relevant documentation as context within the Messages API call, effectively 'teaching' the model the new information for that specific turn.

Exam trap

Confusing the model's internal training cutoff with its ability to process new information provided in the context window.

46
MCQeasy

An insurance firm wants to use Claude to extract data from scanned PDF claim forms that contain both handwritten text and printed tables. Which fundamental capability of the Claude 3 model family makes this workflow possible without using external OCR software?

A.Large Context Window
B.Vision Capabilities
C.Constitutional AI
D.JSON Mode
AnswerB

Claude 3 models feature sophisticated vision capabilities that allow them to process images, charts, and technical drawings. This native multimodal support enables the model to 'see' the scanned insurance forms, interpret handwriting, and extract data from tables directly from the visual input provided in the prompt.

Why this answer

The Claude 3 family was built with native multimodal capabilities, allowing the models to process and understand visual information directly. This eliminates the need for separate Optical Character Recognition (OCR) tools, as the model can interpret pixels and text simultaneously to extract structured data from complex document layouts.

Exam trap

Candidates often assume that processing complex documents like scanned PDFs always requires an external OCR pre-processing pipeline, overlooking the native multimodal vision capabilities built into models like Claude 3.

47
MCQhard

A developer is building an agentic workflow where Claude interacts with various tools. The developer is concerned about the model's performance during these multi-turn interactions. How does adaptive thinking behave in this context?

A.Thinking tokens are discarded automatically by the API after a tool_use response.
B.Thinking blocks must be passed back unchanged in multi-turn tool loops.
C.The model can only think before it decides to call a tool.
D.The model's thinking is reset at the start of every new tool turn.
AnswerB

To maintain the model's internal context and reasoning consistency, all thinking blocks must be returned exactly as received in the multi-turn conversation. Modifying or deleting these blocks breaks the model's chain of thought, which is essential for successfully navigating complex tool-use workflows and agentic tasks.

Why this answer

In an agentic workflow involving tools, adaptive thinking continues to function across turns. When the model needs to use a tool, it will pause its thinking and return a tool_use block. It is critical that the developer passes back the thinking blocks and the tool results exactly as they were received in the previous turn.

If the thinking blocks are modified or omitted, the model will lose the context of its own internal reasoning, which will severely degrade its performance and ability to recover from errors in the tool loop.

Exam trap

Candidates often assume that they only need to return the tool results and can discard the thinking blocks to save space or simplify the conversation history.

48
MCQmedium

A financial analyst uses Claude 3.5 Sonnet to extract line items from quarterly PDFs. They want the model to output only a JSON array without any conversational filler. Which feature should they configure to enforce this output format most reliably?

A.Use the system prompt to instruct 'Output only a valid JSON array with no other text.'
B.Set the temperature to 0.
C.Enable streaming responses.
D.Increase the max_tokens parameter to 4096.
AnswerA

System prompts are the correct mechanism to set persistent behavioral constraints, including output format. Instructing the model to emit only a JSON array without conversational filler directly addresses the requirement and is honored across turns. While no prompt guarantees perfect syntax, this is the most reliable native control for the described scenario.

Why this answer

The system prompt is the primary control for persistent behavioral instructions, including strict output formatting. Telling Claude to return only a valid JSON array with no additional text directly shapes the response structure. Other parameters like max_tokens, temperature, and streaming influence length, randomness, and delivery, but not the format contract the analyst needs.

Exam trap

The trap here is assuming that lowering temperature to 0 or raising max_tokens will make Claude output clean JSON, when only explicit formatting instructions in the system prompt reliably constrain structure.

49
MCQeasy

A software engineer is evaluating user interfaces for an internal developer tool. They want to know whether they can use Claude's native web interface to execute automated API integration tests that run nightly from a CI/CD pipeline. Why is the Claude web application unsuitable for this automated CI/CD use case?

A.The web application cannot process prompts containing code snippets or technical documentation.
B.The web application automatically enforces strict rate limits that prevent more than one request per minute.
C.The web application lacks programmatic interfaces, stable endpoints, and automated control mechanisms needed for pipeline integration.
D.The web application does not support large enough context windows compared to the Messages API.
AnswerC

The Claude web application is built strictly as a consumer and enterprise user interface for human interaction, lacking the programmatic endpoints, SDK support, and automation controls required for reliable execution within automated CI/CD pipelines. Automated tasks and testing pipelines must interact directly with the programmatic Messages API instead.

Why this answer

The Claude web application is designed as an interactive user interface for human users, lacking programmatic endpoints, stable webhook integrations, and automated execution controls required for CI/CD pipelines. For automated integration testing, developers must use the programmatic Anthropic Messages API, which provides stable request-response lifecycles, structured error codes, programmatic control over parameters, and direct integration with software development pipelines and worker services.

Exam trap

Assuming that consumer-facing web interfaces can be scripted easily for headless automation and background pipeline tasks.

50
Multi-Selecthard

A software team is configuring Claude Opus 5.5 to write comprehensive, multi-file code refactoring specifications that require generating tens of thousands of tokens in a single response. Which TWO technical requirements apply when requesting large output volumes near the model's 128K token limit? (Select TWO.)

Select 2 answers
A.The request must set `max_tokens` up to the supported model output cap (up to 128,000 tokens).
B.The Messages API automatically defaults `max_tokens` to 128,000 if the parameter is omitted from the request body.
C.Large output requests require setting `stop_sequences` to `["128000"]` to signal maximum output capacity.
D.Streaming must be enabled in the request/SDK to avoid standard HTTP client timeouts during long generation runs.
E.Requests generating over 4,096 output tokens must be sent exclusively through the Message Batches API.
AnswersA, D

Current Claude models support up to 128,000 output tokens. To allow the model to generate very long outputs without premature truncation, developers must explicitly supply a sufficiently high `max_tokens` value in the request.

Why this answer

Current Claude model families support up to 128,000 output tokens. However, sending requests with very high `max_tokens` limits requires streaming (`stream: true`) in SDKs to prevent standard HTTP client socket timeouts while the model generates long outputs over extended timeframes. Developers must explicitly set `max_tokens` to an appropriate high ceiling and implement streaming to receive the complete generation safely.

Exam trap

Believing that output token caps are limited to standard 4K bounds or that streaming is strictly optional for extreme output lengths.

51
MCQeasy

Which of the following scenarios would be best suited for the Claude web application rather than the Claude API?

A.A data scientist needs to classify 10,000 customer reviews into five sentiment categories.
B.An IT team needs to automatically monitor server logs and trigger alerts when errors occur.
C.A developer needs to embed Claude's reasoning into a custom CRM to summarize lead activity.
D.A marketing manager needs to write and refine a single, high-quality promotional email.
AnswerD

The Claude web app is ideal for individual, creative tasks where a human wants to interactively refine the output. It provides a user-friendly interface for chatting, uploading reference files, and iterating on drafts without needing to write any code or manage API keys.

Why this answer

The Claude web application is optimized for human-in-the-loop, creative, and iterative tasks. Writing a one-off marketing email requires a user to provide feedback, iterate on drafts, and potentially use the UI's formatting and chat history features. These tasks benefit from the app's intuitive interface and don't require the automation, scalability, or structured integration that the API is designed to provide for software applications and data pipelines.

Exam trap

Overcomplicating a simple task by suggesting an API-based solution when a web interface is more efficient for individual users.

52
MCQmedium

A business analyst wants to process sensitive internal HR documents using Claude. They are deciding between uploading documents to the web-based Claude app interface versus building a custom pipeline using the Claude Messages API. Which distinction accurately describes the default data privacy handling between these two access methods?

A.The Messages API automatically redact all personally identifiable information (PII) before model processing, unlike the Claude web app.
B.The Claude web app offers zero data retention out of the box, while API calls store request payloads permanently on Anthropic servers.
C.The Messages API does not use submitted input data to train Anthropic models by default, whereas consumer Claude web app usage may be subject to model training depending on account settings.
D.The Claude web app encrypts prompt data in transit, whereas the Messages API transmits raw JSON text unencrypted over standard HTTP endpoints.
AnswerC

Anthropic does not train its models on data submitted via the Claude API by default. Conversely, usage on consumer web app surfaces is governed by standard user terms where data may be used for model training unless opted out or governed by specialized enterprise terms.

Why this answer

By default, data submitted through the Claude Messages API is not used for training Anthropic's models. In contrast, standard interaction data provided through the Claude consumer web applications (Claude apps) may be subject to different data retention and model training policies unless explicitly configured otherwise via enterprise agreements or account privacy settings. For organizations requiring strict guarantee that submitted payload data will not be used to train future model iterations out-of-the-box, the Messages API provides this programmatic assurance by default for API inputs.

Exam trap

Assuming both the consumer web app and the developer API share identical default data training policies.

53
MCQmedium

A development team is building a system to categorize incoming emails as 'Urgent' or 'General'. They observe that the model occasionally classifies irrelevant marketing emails as 'Urgent'. Which approach best aligns with Anthropic's guidance on reducing model hallucinations or errors in classification tasks?

A.Include a set of varied examples wrapped in XML tags in the system prompt to define the difference between 'Urgent' and 'General' emails.
B.Set the temperature parameter to 0 to ensure the model produces the most predictable and deterministic output for the classification.
C.Switch to a larger model like Claude Fable 5.1 and set the effort level to the maximum to force the model to perform deeper reasoning.
D.Implement a custom post-processing script that checks if the word 'Urgent' appears in the input and forces a rejection if it is missing.
AnswerA

Providing relevant and varied examples (multishot) within XML tags is a core Anthropic best practice. This technique grounds the model's reasoning, significantly reducing hallucinations and errors by showing exactly how the classification should be applied to different types of inputs, thereby increasing the reliability of the system's output.

Why this answer

To improve reliability, the team should ground the model's decision-making process by providing a clear definition of what constitutes an 'Urgent' email, accompanied by varied examples (multishot) within the system prompt. Relying on the model's internal judgment without specific criteria increases the risk of misclassification. By using XML tags to isolate the definitions and examples, the team provides a clear structure that helps the model adhere to the desired logic, effectively reducing the likelihood of erroneous categorizations while maintaining consistency.

Exam trap

Candidates often suggest lowering the temperature or using a different model, but current Claude models do not accept temperature and prompt-based grounding is the primary mechanism for behavioral control.

54
MCQmedium

An engineering team is building a real-time web application that streams responses from the Claude API using server-sent events. They notice that when users close their browser tabs prematurely, the server keeps processing and generating the entire response, wasting compute resources and tokens. How should the backend handle this connection lifecycle?

A.Send a cancellation signal to the Anthropic API endpoint to immediately halt model generation on the server side.
B.Rely on the stateless nature of the Messages API to automatically garbage-collect abandoned streams without any intervention.
C.Monitor the client connection state in the backend and abort the HTTP request stream reader when the client disconnects.
D.Configure a lower timeout parameter in the request payload so the API automatically cancels streaming after a few seconds.
AnswerC

Detecting a dropped client connection and actively aborting the HTTP request reader prevents the application server from continuing to consume and process incoming event streams from the Anthropic API. This preserves network bandwidth and prevents unnecessary resource allocation for abandoned sessions.

Why this answer

When streaming responses from the Anthropic API via server-sent events, the application backend should monitor the client connection state and explicitly cancel or abort the underlying HTTP request or stream consumer when the client disconnects. While the API is stateless from the model's perspective, keeping the HTTP connection open forces the server to continue receiving chunks from Anthropic and transmitting them into a void. Implementing proper stream cancellation ensures that resource consumption stops immediately upon client termination, optimizing overall operational efficiency and API cost management.

Exam trap

Candidates often assume that streaming automatically terminates server-side token generation when a client disconnects, forgetting that HTTP connections and streaming readers must be explicitly aborted in application code.

55
MCQmedium

An application processes customer image uploads using the Claude Messages API. When users upload images as base64 strings, several requests fail with validation errors. Upon inspection, the base64 string includes standard data URI prefix metadata (`data:image/jpeg;base64,`). What adjustment must be made to the image content block payload to ensure successful API requests?

A.Convert the image block to a document block, as base64 encoding is reserved exclusively for PDF inputs.
B.Strip the `data:image/...;base64,` prefix from the string and pass only the raw base64 data in the data parameter.
C.Move the complete data URI prefix string into the `media_type` field while leaving the encoded data unchanged.
D.Wrap the base64 string inside standard XML tags within a text block instead of using image source blocks.
AnswerB

The API requires the raw base64 string without any data URL headers or metadata prefixes. The MIME type is specified in the distinct `media_type` field inside the source object, so including the header inside the string parameter causes validation and decoding errors.

Why this answer

When supplying base64-encoded image data in a content block to the Claude Messages API, the raw base64 payload must not include the standard data URI prefix (such as `data:image/jpeg;base64,`). The media type (e.g., `image/jpeg`) is specified separately in the `media_type` property within the image source block. Including the prefix in the base64 data parameter causes API parsing failures because the encoder expects pure base64-encoded bytes.

Exam trap

Assuming that Claude API expects standard browser-style data URL strings when passing base64 image data.

56
MCQeasy

When designing a user interface that consumes streamed responses from the Claude API, why is it recommended to check the 'stop_reason' before considering the response to be finished?

A.The 'stop_reason' confirms whether the response was successfully cached for future use by the organization.
B.The 'stop_reason' is the only way to determine if the model used any tools during the generation process.
C.The 'stop_reason' provides the final status of the generation, ensuring the application handles truncated or incomplete outputs correctly.
D.The 'stop_reason' is used by the SDK to automatically retry requests that were interrupted by network issues.
AnswerC

Checking the 'stop_reason' allows the application to distinguish between a successful completion ('end_turn') and other outcomes like 'max_tokens' truncation. This is vital for maintaining a robust UI that can inform users if a report was cut short or if the model requires further instructions.

Why this answer

Checking the 'stop_reason' is essential because it tells the application why the generation ended. A stop_reason of 'end_turn' indicates the model completed its task successfully. Other reasons, such as 'max_tokens', 'stop_sequence', or 'tool_use', provide critical information about the state of the interaction.

Ignoring these reasons can lead to a broken user experience, as the application might treat a truncated response as a complete answer, or fail to handle a request from the model to use a tool.

Exam trap

Candidates often assume that the end of a stream always means the model has successfully answered the prompt, ignoring edge cases like truncation.

57
MCQmedium

A developer is building a document processing service that uses prompt caching. They notice that adding a small, frequently changing timestamp to the top of the system prompt causes the cache_read_input_tokens metric to drop to zero for the entire request. Why does this happen?

A.The timestamp causes a prefix mismatch, invalidating the entire cache for the request.
B.System prompts cannot be cached if they contain dynamic variables.
C.The API automatically disables caching when it detects high-frequency updates.
D.The API requires the exact same total number of tokens for every cached request.
AnswerA

Caching relies on a prefix match; placing dynamic data like a timestamp at the beginning of the prompt breaks the match for all subsequent content. Consequently, the API cannot utilize the previously stored cache, forcing a full input re-processing and increasing the cost to standard input rates.

Why this answer

Prompt caching works by matching a prefix of the request. Because the API processes the message sequence linearly, any change at the beginning of the prompt—such as a timestamp—invalidates the cached state for the entire subsequent sequence. Since the prefix no longer matches the previously cached version, the model must re-process the entire prompt as new input.

To resolve this, the developer should move volatile information like timestamps to the end of the prompt or outside the cache-sensitive prefix area to ensure the stable content remains eligible for caching.

Exam trap

Candidates often assume that only the changed part of the prompt is invalidated, failing to realize that the entire downstream cache is rendered useless by an early prefix mismatch.

58
MCQeasy

A marketing team is using Claude Haiku 5.5 to categorize thousands of customer feedback snippets. They notice that for very short, ambiguous comments like 'It works,' the model sometimes invents specific features the customer might be praising. Which prompt engineering technique from the official guidance is most effective at reducing these hallucinations?

A.Explicitly instruct Claude that it is allowed to say 'I don't know' if the feedback is too vague.
B.Increase the 'effort' setting to 'max' to ensure the model looks closer at the text.
C.Use assistant-message prefill to start the response with the most likely category.
D.Switch the task to Claude Fable 5.1 to leverage its higher reasoning capabilities.
AnswerA

Giving Claude an out is a primary strategy for grounding. It prevents the model from being forced into a hallucinated choice when the provided context (the short snippet) does not contain enough information to satisfy the prompt's requirements.

Why this answer

To reduce hallucinations, Anthropic recommends allowing the model to acknowledge uncertainty. By explicitly giving Claude permission to say 'I don't know' or 'Unspecified' when the input is too vague to categorize accurately, the model is less likely to 'fill in the blanks' with invented details or incorrect classifications.

Exam trap

Thinking that a more powerful model like Opus is the only way to solve hallucinations.

59
MCQmedium

Refer to the exhibit. What is the specific purpose of the 'stop_sequences' parameter in this JSON payload?

A.It forces the model to ignore user inputs after that sequence.
B.It instructs the model to stop generating text when it encounters that sequence.
C.It increases the probability of the model using that sequence.
D.It reduces the model's temperature to 0.
AnswerB

The 'stop_sequences' parameter tells the model to halt generation as soon as it produces any of the provided strings. This is a common technique to prevent the model from entering a conversation loop or generating content beyond the intended response, ensuring the output is clean and ready for integration.

Why this answer

Stop sequences allow developers to force the model to cease generation when it hits a specific string. This is essential for controlling output length and preventing the model from hallucinating a continuing conversation (e.g., trying to generate the next 'Human:' turn). Mastering this parameter is key to integrating Claude into existing chat UI architectures where the developer needs precise control over when the model hands control back to the user.

Exam trap

Candidates often confuse 'stop_sequences' with 'max_tokens', assuming the former is for limiting response length rather than defining specific exit points to prevent the model from continuing into unwanted conversational turns.

60
MCQeasy

A support team wants Claude to answer customer questions using only the company's internal help articles. They plan to paste the relevant article text into the prompt before the user's question. Which prompting technique does this describe?

A.Zero-shot prompting
B.Retrieval-augmented generation (RAG)
C.Chain-of-thought prompting
D.Few-shot prompting
AnswerB

RAG combines a retrieval step that fetches relevant documents with generation, where the model answers using that fetched context. Pasting internal help articles before the user question is exactly this pattern: external knowledge is injected into the prompt to ground the response. It reduces hallucination by anchoring answers in provided source material.

Why this answer

Inserting relevant source documents into the prompt so the model answers from them is retrieval-augmented generation. The retrieval step supplies factual context, and the generation step produces an answer grounded in that context. This differs from zero-shot, few-shot, and chain-of-thought, which address examples, demonstrations, and reasoning traces respectively.

Exam trap

The trap here is conflating any prompt that includes extra text with few-shot prompting, when the key distinction is whether the added text is reference material (RAG) or solved examples (few-shot).

61
MCQmedium

A developer is migrating a legacy workflow to the Claude API and wants to force the model to provide a summary of exactly 50 words. They try to use 'max_tokens' to enforce this length. Why is this an ineffective strategy?

A.The API will automatically adjust the 'max_tokens' limit to match the requested 50-word summary.
B.The model will automatically add filler words to reach the token limit if it is set too high.
C.The model will ignore the 'max_tokens' limit if the instruction in the system prompt asks for 50 words.
D.The 'max_tokens' limit only applies to the total tokens, not the word count, leading to unpredictable truncation.
AnswerD

Tokens and words are not equivalent, and the model does not attempt to calculate word count to satisfy a token limit; it will simply cut off the response whenever the token limit is reached, resulting in incomplete output.

Why this answer

The max_tokens parameter is a hard ceiling on generated tokens, not a control for the precise length of the answer. Tokens and words do not map one to one, and on current models thinking tokens also count toward max_tokens, so a limit set near 50 words gives no reliable word count. If the model is still generating when it reaches the limit, the output is simply cut off and the response ends with a max_tokens stop reason.

To control length, the developer should state the required length clearly in the prompt and leave max_tokens with comfortable headroom.

Exam trap

Candidates often confuse 'max_tokens' (a safety limit) with 'word count' (a stylistic instruction), leading to broken or truncated outputs in their applications.

62
MCQhard

An engineer is building a tool-using agent with the Claude API. They want the model to be able to search their local company database. How does the implementation of tools differ between the Claude API and the built-in capabilities of the Claude Agent SDK?

A.The Agent SDK requires tools to be defined in CLAUDE.md files, while the API uses the `tools` parameter
B.The API requires the developer to manually run the tool and send results back, whereas the Agent SDK has built-in tools and handles the loop
C.The API supports server-side tools that run on Anthropic's infrastructure, while the Agent SDK only supports local tools
D.The API uses the Model Context Protocol (MCP) for all tools, while the Agent SDK uses standard JSON schemas
AnswerB

The API is a low-level interface where the developer manages the tool_use/tool_result cycle. The Agent SDK is a higher-level library that includes ready-to-use tools and manages the orchestration loop automatically.

Why this answer

The Messages API requires the developer to define the tool schema and manually implement the logic to execute the tool and return results. In contrast, the Claude Agent SDK comes with pre-built tools (like Read, Write, and Bash) and a framework that handles the execution loop and environment interaction automatically.

Exam trap

Believing the standard API has built-in tools like 'search' or 'bash' that can be toggled on without code.

63
Multi-Selectmedium

A product team is evaluating Claude for a customer-facing assistant that must refuse to give medical diagnoses. Which TWO techniques should they use to make the refusal behavior consistent across many different user phrasings? (Choose two.)

Select 2 answers
A.Set temperature to 1.0 to encourage diverse safe responses.
B.Increase max_tokens so the model has room to explain refusals.
C.Include a few-shot example showing the assistant declining a diagnosis request.
D.Place a clear refusal policy in the system prompt.
E.Disable the system prompt and rely only on user instructions.
AnswersC, D

Few-shot examples demonstrate the exact desired behavior, including tone and wording for refusals. By showing a sample user request and the assistant's decline, the model learns the pattern and can generalize to new phrasings. This complements a system-prompt policy by giving a concrete template, improving consistency when users vary their wording.

Why this answer

Consistent refusal behavior comes from persistent instructions plus concrete demonstrations. A system-prompt policy establishes the rule for every turn, while a few-shot example shows exactly how a refusal should look, helping the model generalize across varied user phrasings. Temperature, max_tokens, and removing the system prompt do not reinforce policy adherence and can weaken it.

Exam trap

The trap here is thinking that raising temperature or output length makes the assistant more flexible or thorough, when refusal consistency actually depends on persistent instructions and demonstrated examples.

64
MCQhard

A developer is migrating a workflow that previously used manual reasoning chains to a modern Claude model. They want to leverage the model's native adaptive thinking. What should they do with their existing chain-of-thought prompt instructions?

A.Increase the 'max_tokens' limit to accommodate the existing chains.
B.Hardcode the existing manual reasoning chain into the system prompt.
C.Remove the manual chain-of-thought and rely on adaptive thinking.
D.Set the effort level to 'max' to force the model to follow the chain.
AnswerC

Transitioning to rely on the model's native adaptive thinking allows the developer to simplify prompts and reduce complexity, as the model is now capable of autonomously determining the appropriate reasoning depth and logic for each request it receives.

Why this answer

Modern Claude models use native adaptive thinking, meaning they automatically determine how much reasoning is needed for a given task. While providing step-by-step guidance is still helpful, the developer should transition away from complex, rigid manual reasoning chains that might conflict with or unnecessarily complicate the model's own adaptive strategy. The best approach is to simplify the prompt, focusing on clear goals and expected outcomes, and letting the model's adaptive thinking handle the internal reasoning depth.

Exam trap

Candidates often believe that manual chains of thought are always required, failing to realize that modern models have internalized this capability.

65
MCQmedium

When evaluating the cost of a complex agentic workflow, why is it recommended to prioritize 'effort' levels over simply switching to a cheaper model?

A.Adjusting effort allows for dynamic control of reasoning depth versus cost.
B.Lowering effort reduces the input token cost per request.
C.Haiku 5.5 is not capable of handling agentic workflows.
D.Switching models is not supported in agentic workflows.
AnswerA

The effort parameter is designed to let you trade off reasoning depth and cost. By lowering the effort, you reduce the number of thinking tokens generated, which lowers the overall cost. This is often more effective than switching models, which might compromise the quality of the final result.

Why this answer

The effort parameter (e.g., low, medium, high) provides a granular lever to balance reasoning quality against token consumption within a single model. Often, a highly capable model like Sonnet 5.5 can perform a complex task effectively at a lower effort setting, which uses fewer output tokens. Switching to a weaker model might result in lower quality and failed tasks, requiring expensive retries or manual intervention, which ultimately ends up being more costly than adjusting the effort on a more capable model.

Exam trap

Assuming that cheaper models are always more cost-effective, ignoring the cost of model failure or the need for more complex prompt engineering to compensate for lower capability.

66
MCQhard

During a high-stakes deployment, a team notices that their agentic workflow is hitting latency limits. The workflow uses Claude Opus 5.5 for all operations. Given that the reasoning quality must remain at the highest level, what is the most appropriate architectural adjustment?

A.Disable all tool use and perform all actions in a single prompt.
B.Decompose the workflow into subtasks, using Opus only for critical reasoning steps.
C.Change the model to Claude Haiku 5.5 to drastically lower latency.
D.Increase the cache_control breakpoints to store the entire workflow state.
AnswerB

Decomposing the workflow allows the team to isolate the parts that truly require Opus's reasoning capability. By using more efficient models for simpler, non-reasoning-heavy tasks within the pipeline, they effectively reduce the overall latency without sacrificing the necessary quality for the most critical, high-stakes components of the workflow.

Why this answer

To maintain the highest reasoning quality while managing latency, the team should decompose the workflow into a chain of subtasks. By identifying which steps require Opus-level reasoning and which can be handled by a more efficient model or a different approach, they can optimize the overall pipeline. They might use a smaller model for simple extraction and only invoke Opus for final synthesis, or use subagents to handle specific, isolated reasoning tasks, thereby reducing the total overhead on the primary agent loop.

Exam trap

Believing that the only way to reduce latency is to downgrade the model, ignoring architectural patterns like task decomposition.

67
MCQmedium

Refer to the exhibit. What will happen if the user adds a new message to the 'messages' array?

A.The model will see only the latest message and forget the previous ones.
B.The model will correctly interpret the new input based on the full conversation history.
C.The system prompt will be overwritten by the new user message.
D.The API will return an error because messages cannot be appended.
AnswerB

The Claude API is designed to consume the entire sequence of messages as a single context. As long as the user correctly appends the new message to the existing history array, the model will maintain continuity, allowing for natural, multi-turn dialogue where previous context informs the current response.

Why this answer

The API requires that the 'messages' array represents the full turn-by-turn history. To continue the conversation, the application should append the new user message to the existing list while maintaining the original messages in the sequence. This ensures the model has access to the full context, allowing it to maintain conversational coherence and remember previous turns, which is crucial for building natural, fluid user experiences in AI applications.

Exam trap

Candidates often think appending a message replaces the history or requires resetting the API state from scratch each turn.

68
MCQhard

A software company uses Claude Code to maintain their repository. They have a strict policy that Claude should never modify the 'auth/' directory, but it should be allowed to read those files to understand the login flow. How should they implement this using Claude Code's native configuration?

A.Add a instruction in the root CLAUDE.md file saying 'Do not edit any files in the auth directory.'
B.Configure a PreToolUse hook that checks the file path and exits with code 2 if the tool is 'Edit' and the path is in 'auth/'.
C.Set a deny rule for 'Edit(./auth/**)' and 'Write(./auth/**)' in the project's .claude/settings.json file.
D.Use the /permissions slash command in every session to manually revoke access to the 'auth/' folder.
AnswerC

This is the correct use of Claude Code's permission system. By explicitly denying the Edit and Write tools for the specified path pattern, the developer ensures that even if Claude attempts to modify those files, the tool execution will be blocked by the underlying system's permission layer.

Why this answer

Claude Code provides a granular permission system via settings.json. To allow reading but prevent writing/editing, the user should define permissions in the 'permissions.allow' and 'permissions.deny' sections. Specifically, adding 'Read(./auth/**)' to allowed permissions and 'Edit(./auth/**)' or 'Write(./auth/**)' to denied permissions ensures the model can access the context for reasoning without being able to commit changes.

Deny rules take precedence in Claude Code, providing a secure way to gate sensitive parts of a codebase while maintaining the model's utility for analysis.

Exam trap

Trying to use prompt engineering in a CLAUDE.md file to enforce security boundaries that are better handled by the tool's permission settings.

69
MCQmedium

An architecture team is upgrading an image-processing pipeline that feeds blueprints to Claude Sonnet 5.5. The existing workflow converts multi-page architectural PDFs into low-resolution JPEG images before calling the API. What is the main operational benefit of replacing image conversion with direct PDF `document` content blocks?

A.It preserves structural text quality and enables features like native citations without requiring manual image conversion pipelines.
B.It automatically disables adaptive thinking to accelerate response speeds on complex architectural diagrams.
C.It bypasses context window limits by processing document text in an uncounted background sandbox.
D.It forces Claude to return raw CAD software commands instead of natural language explanations.
AnswerA

Submitting native PDF document blocks allows Claude to access visual elements alongside embedded text streams. This eliminates the maintenance overhead of image conversion code, prevents quality loss on small text, and allows activation of native citations.

Why this answer

Passing native PDF files as `document` content blocks allows Claude to analyze both the high-fidelity visual layout and the embedded vector text elements directly. Direct PDF ingestion avoids resolution degradation caused by image rendering, preserves text selectable quality, reduces pre-processing code complexity, and enables structural features like native citations that are not supported on pure image blocks.

Exam trap

Assuming low-resolution image conversion is superior because it compresses file sizes, ignoring loss of textual detail and loss of citation support.

70
MCQmedium

An application uses Claude Opus 5.5 to help users draft sensitive legal correspondence. Occasionally, the model returns a response with a `stop_reason` of `refusal` instead of the expected legal text. The development team wants to understand how to handle this and whether they can access the model's internal reasoning to debug why the refusal occurred. Which statement is true?

A.A `refusal` stop reason indicates an HTTP 403 error that must be caught by the SDK.
B.The `refusal` reason only triggers if the user prompt contains specific forbidden keywords.
C.The raw reasoning trace is hidden and cannot be retrieved even when a refusal occurs.
D.Setting the `thinking` type to `enabled` will force the API to include the refusal logic.
AnswerC

Anthropic does not expose the raw internal chain of thought for any model. While thinking blocks may be returned in successful responses, they are often summarized or omitted, and the underlying reasoning trace for a safety refusal is strictly protected and not accessible via the API.

Why this answer

Refusals are generated by Anthropic's safety classifiers when a request is determined to violate safety guidelines or usage policies. While the model may use adaptive thinking to process the request, the raw chain of thought or internal reasoning trace is never exposed to the end user or developer via the API. Developers must rely on the `stop_details` provided with the refusal to understand the category of the safety trigger, but they cannot see the model's 'private' thoughts leading to that decision.

Exam trap

Believing that 'thinking' blocks provide a transparent window into the model's safety logic or refusal decisions.

71
MCQeasy

When using the Claude API, a developer receives a response where the 'usage' object shows 'cache_read_input_tokens' is equal to the total number of input tokens. What does this indicate about the request?

A.The request was processed using the Message Batches API, which caches all inputs by default.
B.The entire input prompt was successfully served from the existing prompt cache.
C.The model's output tokens were cached for use in the next turn of the conversation.
D.The model had to read the entire input because the cache was empty or invalidated.
AnswerB

When 'cache_read_input_tokens' matches the input size, it confirms a full cache hit for the prefix. This is the ideal scenario for repeating large contexts, as cache reads are significantly cheaper than standard input tokens.

Why this answer

The 'usage' object in the Claude API response provides a breakdown of token consumption. 'cache_read_input_tokens' represents the number of tokens that were successfully retrieved from the prompt cache. If this value matches the total input, it means the entire prefix of the prompt was already cached from a previous request, resulting in lower costs and faster processing.

Exam trap

Assuming 'cache_read_input_tokens' refers to the model reading from a local file or database.

72
MCQeasy

A developer is writing a Python script to call Claude Haiku 5.5 for a simple sentiment analysis task. They are deciding whether to use the `stream=True` parameter in their request. In which of the following situations is streaming LEAST likely to provide a significant benefit?

A.When the model is expected to generate a 1,000-word blog post.
B.When the application requires a one-word classification label from a fast model.
C.When the developer needs to monitor the model's reasoning steps in real-time.
D.When the network connection is unstable and prone to dropping idle requests.
AnswerB

In high-speed, short-output tasks like classification, the model (especially Haiku 5.5) responds almost instantly. The time saved by streaming a single word is imperceptible to the user, and the added complexity of handling server-sent events is not justified. A standard synchronous request is the most efficient approach here.

Why this answer

Streaming is most beneficial when responses are long or when low perceived latency is critical for user experience. For a task like sentiment analysis using a fast model like Claude Haiku 5.5, the output is typically very short (e.g., a single word or a short sentence). Because the total generation time for such a small number of tokens is extremely low, the overhead of managing a stream might outweigh the negligible improvement in perceived latency, making a standard synchronous call more efficient.

Exam trap

Assuming streaming should be used for every single API call regardless of the task complexity or output length.

73
MCQmedium

A developer is writing a Python script to count tokens for a set of prompts before sending them to the Claude API. They want to ensure they do not exceed the model's input token limits. Which approach should they use?

A.Call the POST /v1/messages/count_tokens endpoint to get an accurate estimate from the API.
B.Check the usage.input_tokens field in the response of a previous, similar request.
C.Divide the character count of the prompt by 4 to estimate the number of tokens.
D.Use a standard open-source tokenizer library to estimate the token count locally.
AnswerA

The /v1/messages/count_tokens endpoint is the official and accurate way to determine the token count of a request. By using this endpoint, the developer receives a precise measurement of how the API will interpret the input, ensuring effective management of the context window and avoiding errors related to input size.

Why this answer

The Anthropic API provides a dedicated endpoint, POST /v1/messages/count_tokens, specifically for estimating the number of tokens in a prompt before the request is sent. This is the most accurate way to ensure the input fits within the model's context window. Relying on external, non-official tokenizers or manual calculations is prone to errors, as tokenization can vary between models.

Using the official API endpoint guarantees that the count is consistent with how the API will process the input.

Exam trap

Candidates often suggest using standard open-source tokenizers (like tiktoken) which are not designed for Claude's specific tokenization, leading to inaccurate estimations.

74
MCQeasy

A developer is building a chat application and wants to ensure the model responds to the user's latest query while keeping the conversation context intact. How should the developer structure the API request?

A.Include the full conversation history in the `messages` array and the system instructions in the top-level `system` parameter.
B.Send only the latest user message and store the previous turns in a local database to be retrieved by the API later.
C.Use the `system` parameter to store the entire conversation history to save on message tokens.
D.Send the conversation history as a single block of text within the first user message.
AnswerA

The Messages API requires the full conversation history to maintain context. Placing system instructions in the dedicated `system` parameter is the correct practice, as it keeps operator instructions separate from the user-assistant message flow.

Why this answer

The Messages API is stateless, meaning the client must send the entire conversation history in every request. To maintain context, the developer must include the full list of messages in the request payload. The system instructions should be placed in the top-level `system` parameter, which is specifically designed for operator instructions that apply to the entire interaction.

This approach ensures that the model has access to the complete history and the relevant system instructions without needing to parse them as part of the message list.

Exam trap

Assuming that the API remembers previous turns automatically, which leads to developers sending only the latest message and losing the context of the conversation.

75
Multi-Selectmedium

A developer is integrating Claude into a legal document review system. The system must process lengthy contracts and answer questions about specific clauses. Which TWO of the following techniques help mitigate the risk of Claude hallucinating details not present in the document? (Choose two.)

Select 2 answers
A.Use a higher temperature setting to encourage more creative responses.
B.Instruct Claude to answer only based on the provided document and to say 'I don't know' if the information is not present.
C.Set max_tokens to a very low value to limit the response length.
D.Provide the full contract text in the prompt and ask Claude to cite the specific section for each answer.
E.Fine-tune the model on a dataset of legal contracts.
AnswersB, D

Explicitly instructing Claude to ground its answers in the provided document and to admit uncertainty when information is missing reduces hallucinations. This prompt engineering technique encourages the model to rely on the context rather than its internal knowledge, which is crucial for legal documents where accuracy is paramount. It sets clear boundaries for the model's responses.

Why this answer

To reduce hallucinations when reviewing legal documents, the most effective methods are to instruct Claude to rely solely on the provided text and to require citations for its answers. These techniques ground the model's responses in the source material, making it less likely to invent details and easier to verify accuracy.

Exam trap

The trap here is thinking that adjusting generation parameters like temperature or max_tokens can prevent hallucinations, when grounding instructions and citations are the key.

Page 1 of 4 · 249 questions totalNext →

Ready to test yourself?

Try a timed practice session using only Claude Model Fundamentals questions.