Home / Anthropic Claude Certified Developer - Foundations / Mock exam
Anthropic Claude Certified Developer - Foundations Exam-style mock test

Anthropic Claude Certified Developer - Foundations Practice Exams|Practice test

Full explanations Exam format Pass line 70%
33 USD One-time · lifetime access
Enroll →

Sample questions

Example1 · Claude API & Messages Fundamentals
A developer at a B2B SaaS invoicing platform is wiring up the first call to the Claude Messages API. The request body currently contains only a 'messages' array with one user turn. The call keeps failing validation before any text is generated. Which additional top-level field must the developer include so the Messages API request is accepted?
・The 'system' field holding the assistant's persona and formatting rules for the conversation
Incorrect. A 'system' prompt is optional and shapes behavior, but omitting it does not cause the request to be rejected by validation.
・The 'metadata' object carrying an end-user identifier for the platform's billing reports
Incorrect. The 'metadata' object is optional and useful for tracking, yet its absence never blocks a request from being accepted.
✓The 'model' identifier along with a 'max_tokens' value capping the response length
Correct. The Messages API requires both 'model' and 'max_tokens' in addition to 'messages'; without them the request is rejected before generation.
・The 'stop_sequences' list defining the strings that will end generation early
Incorrect. The 'stop_sequences' list is optional and only trims output; leaving it out does not trigger a validation failure.
Explanation
A minimal valid Messages request needs 'model', 'max_tokens', and 'messages'. The other fields are optional conveniences.
Example2 · Prompt Engineering & Structured Output
At a B2B SaaS analytics company, a developer builds a prompt that includes a long customer support transcript plus a separate list of tagging rules. Claude sometimes confuses which text is the transcript and which text is the instructions. Which change should the developer make to most reliably separate these components?
✓Wrap the transcript in <transcript> tags and the rules in <rules> tags so each component is clearly delimited for Claude.
Correct. XML tags like <transcript> and <rules> give Claude explicit structural boundaries, which is Anthropic's recommended approach for separating distinct prompt components.
・Put the tagging rules first and add the phrase 'the following is the transcript' before pasting the raw customer support conversation.
Incorrect. A plain-language label helps slightly but is far less reliable than structural delimiters, since prose boundaries are easy for the model to blur.
・Lower the temperature value and increase max_tokens so Claude has more room to reason about which section is which.
Incorrect. Temperature and max_tokens control randomness and output length, not how the model distinguishes one input section from another.
・Move the entire transcript into the system prompt and keep only the tagging rules inside the user message for clarity.
Incorrect. Splitting content across system and user messages does not create clear boundaries within the content and can make maintenance harder.
・Convert the transcript to uppercase so it visually stands apart from the lowercase tagging rules in the prompt.
Incorrect. Changing letter case is a weak visual cue that does not provide the structural delimitation Claude relies on.
Explanation
XML tags are Anthropic's recommended mechanism for delimiting distinct components of a prompt so the model does not confuse data with instructions.
Example3 · Tool Use & Function Calling
A developer at a B2B SaaS invoicing platform is adding a tool that lets Claude look up a customer's outstanding balance. They define the tool with a name, a description, and an input_schema. Why does Claude rely on the tool's description field when deciding whether to call it?
・The description is parsed as executable code that Claude runs locally to validate each candidate tool call before emitting it.
Incorrect. The description is natural-language guidance for the model, not code that Claude executes or runs locally against candidate calls.
✓The description tells Claude what the tool does and when it is appropriate to use, guiding its decision to request the tool.
Correct. A clear description of the tool's purpose and appropriate usage is what Claude uses to decide when a given tool should be invoked.
・The description is only shown to end users in the product UI and has no effect on how Claude selects among the available tools.
Incorrect. The description directly influences Claude's tool-selection behavior rather than being a user-facing label with no model impact.
・The description overrides the input_schema so Claude can skip supplying the required parameters whenever the text is sufficiently clear.
Incorrect. The input_schema still governs required parameters; the description does not let Claude omit required inputs based on prose alone.
Explanation
Tool descriptions are the primary signal Claude uses to decide whether and when to call a tool, so they should clearly state purpose and appropriate usage.
Example4 · RAG, Context & Embeddings Integration
A healthcare services firm builds a RAG assistant over its clinical policy library using Claude. A new developer asks why the team calls a dedicated embedding model to index documents instead of asking Claude to embed the text. Which explanation is correct?
・Claude can only embed text that is shorter than a single paragraph, so a separate embedding model is required whenever policy documents exceed that length limit at index time.
Incorrect. Claude does not have a one-paragraph input limit, and the real reason for a separate embedder is the different task, not document length.
✓Embedding models convert text into fixed-length vectors for similarity search, a distinct task from the text generation Claude performs when answering the user's question.
Correct. Embedding models produce fixed-length vectors optimized for semantic similarity search, which is a separate concern from Claude's generative answering.
・The embedding model is needed to encrypt the clinical documents before storage, whereas Claude is used only to decrypt and summarize the retrieved content for the user.
Incorrect. Embedding models produce semantic vectors for retrieval; they do not encrypt documents, and Claude does not function as a decryption step.
・Claude refuses to process clinical documents for compliance reasons, so the embedding model acts as a privacy filter that strips protected health information before any retrieval occurs.
Incorrect. Claude can process clinical text, and embedding models produce vectors rather than acting as a PHI-stripping privacy filter.
Explanation
Embeddings and generation are two different tasks: a dedicated model turns text into vectors for similarity search, while Claude generates the grounded answer from retrieved chunks.
Example5 · MCP, Agents & Production Best Practices
A healthcare services firm wants Claude to read patient scheduling data from its internal booking database without hard-coding a custom integration for every model or client it uses. An engineer proposes adopting the Model Context Protocol (MCP). Which statement best describes what MCP provides in this situation?
✓An open standard that lets Claude connect to external tools and data sources through reusable servers exposing a consistent interface
Correct. MCP is an open standard that standardizes how applications expose tools and data to models via reusable servers with a consistent interface, avoiding bespoke per-client integrations.
・A managed vector database service that stores and indexes the firm's patient records for semantic retrieval at query time
Incorrect. A vector database handles embeddings and semantic retrieval; MCP is a connection protocol, not a storage or indexing service for records.
・A fine-tuning pipeline that retrains the underlying model on the firm's proprietary scheduling data for better accuracy
Incorrect. MCP does not retrain or fine-tune the model on proprietary data; it standardizes runtime connections between models and external systems.
・A prompt-caching layer that reduces token costs by storing previously generated responses for repeated scheduling questions
Incorrect. Prompt caching lowers cost by reusing repeated context, which is unrelated to MCP's role of standardizing tool and data connections.
Explanation
MCP is an open protocol that standardizes how Claude and other clients connect to external tools and data through reusable servers, so integrations do not have to be rebuilt for each model or application.
Example6 · Claude API & Messages Fundamentals
A developer at a healthcare services firm is writing the first call to the Claude Messages API to summarize patient intake notes. Which combination of fields must be present in the request body for the call to succeed?
・The fields session_id, prompt, and temperature, where prompt contains the full conversation history as one text block
Incorrect. There is no session_id or prompt field in the Messages API; conversation turns are passed as structured message objects, not one concatenated prompt string.
✓The fields model, max_tokens, and messages, where messages is a list of role and content objects
Correct. The Messages API requires model, max_tokens, and messages; messages is an array of objects each carrying a role and content.
・The fields model, system, and history, with history holding prior turns and system holding the latest user text
Incorrect. system is optional and holds instructions, not the latest user text, and there is no separate history field; turns live inside messages.
・The fields api_version, model, and input, where input is a single string containing the user's request
Incorrect. There is no api_version or single input string field; the request uses model plus a structured messages array.
Explanation
A minimal valid Messages request supplies model, max_tokens, and a messages array of role/content objects. system is optional.
Example7 · Claude API & Messages Fundamentals
A developer at the retail brand NorthPeak Outfitters is building a product-description generator that calls the Claude Messages API. For the request to be accepted, which set of fields must the developer include in the JSON request body?
✓The developer must supply model, max_tokens, and a messages array, where every message object carries a role and content.
Correct. The Messages API requires model, max_tokens, and a messages array of role/content objects as the minimal valid body.
・The developer must supply model, a prompt string, and a stop_sequences list, since the newer Messages API still consumes a single prompt field.
Incorrect. The single prompt field with Human/Assistant turns belongs to the legacy Text Completions API, not the Messages API.
・The developer must supply model, temperature, and a conversation array, while max_tokens is optional and defaults to the model's full context window.
Incorrect. temperature is optional and max_tokens is required, not optional; it does not default to the full context window.
・The developer must supply api_version, messages, and a system role entry inside the messages array for every request.
Incorrect. There is no api_version body field, and system is passed as a top-level parameter rather than a role inside messages.
Explanation
A minimal Messages API call needs model, max_tokens, and a messages array whose entries each have role and content. Prompt-string formatting and in-array system roles come from older or incorrect patterns.
Example8 · Claude API & Messages Fundamentals
NorthPeak Outfitters wants Claude to always answer customer questions as a friendly brand assistant that never discloses supplier pricing. Where should the developer place these persistent behavioral instructions in a Messages API call?
・They should prepend the instructions as an assistant-role message at the start of the messages array so Claude treats them as prior output.
Incorrect. Assistant-role messages represent Claude's prior responses, not durable system-level guidance, so this misuses the role.
✓They should pass the instructions in the top-level system parameter of the request, separate from the user and assistant turns.
Correct. The top-level system parameter is the intended place for persistent role, tone, and policy instructions distinct from conversation turns.
・They should embed the instructions inside each user message's content, repeating the full policy text on every single turn of the conversation.
Incorrect. Repeating the full policy in every user message is wasteful and is not the designed mechanism for system guidance.
・They should set the instructions through a persona field on the model object, which stores them server-side for the API key.
Incorrect. There is no persona field on the model object that persists instructions server-side for an API key.
Explanation
Durable behavioral guidance belongs in the top-level system parameter, which is kept separate from the user/assistant turns in the messages array.
Example9 · Claude API & Messages Fundamentals
A developer on NorthPeak Outfitters' team notices that Claude's generated return-policy summaries are being cut off mid-sentence. The request set max_tokens to 150. What does this parameter control?
✓It sets the maximum number of tokens Claude may generate in its response, independent of the length of the input prompt.
Correct. max_tokens bounds only the generated output length and is unrelated to how long the input prompt is.
・It defines the combined token budget shared across the input messages and the generated output for the entire request.
Incorrect. It does not represent a combined input-plus-output budget; the context window governs the total, not max_tokens.
・It limits only the number of tokens counted from the system prompt before Claude begins producing its answer text.
Incorrect. It does not meter system-prompt tokens; it limits the response Claude writes.
・It caps how many tokens Claude reads from the user's input, truncating the prompt before generation starts.
Incorrect. It does not truncate the input; it constrains the output tokens Claude generates.
Explanation
max_tokens caps the length of the generated response. A value of 150 was too small, cutting the summary off; raising it allows a complete answer.
Example10 · Claude API & Messages Fundamentals
A developer at Meridian Capital is writing the first call to the Claude Messages API for a loan-summary microservice. Which combination of top-level fields must be present for the request to be accepted by the endpoint?
✓The model identifier, the max_tokens limit, and the messages array containing the conversation turns
Correct. model, max_tokens, and messages are the three required top-level parameters the Messages endpoint validates before generating a response.
・The model identifier plus a system string, with the user turn supplied inside a separate prompt field
Incorrect. There is no standalone prompt field in the Messages API; user content lives inside the messages array, and system is optional, not a substitute for max_tokens.
・Only the messages array, since the model and token ceiling are inferred automatically by the service
Incorrect. The model and max_tokens are not inferred; omitting either causes the request to be rejected with a validation error.
・The model identifier, the temperature value, and a stop_sequences list defining where generation ends
Incorrect. temperature and stop_sequences are optional tuning fields, while max_tokens and messages remain mandatory and are missing here.
Explanation
A minimal valid Messages request requires model, max_tokens, and messages; optional fields like temperature or system refine behavior but cannot replace the required ones.
Example11 · Claude API & Messages Fundamentals
A fraud-analytics team wants every response from their Claude-powered assistant to adopt a cautious, compliance-first persona for all customer inquiries. Where should this persistent instruction be supplied in the Messages API request?
・As the first element of the messages array using a dedicated system role entry inside the turns
Incorrect. The Messages API does not use a system role within the messages array; system is a separate top-level field.
✓In the top-level system parameter, which sets context and behavior separately from the conversation turns
Correct. The top-level system parameter is the designated place for persistent instructions, kept distinct from the user/assistant conversation turns.
・Appended to every single user message so the model re-reads the persona on each individual turn
Incorrect. Repeating the persona in each user message is redundant and error-prone; the system parameter handles this cleanly.
・Inside the metadata object, where request-level configuration such as persona and tone is interpreted
Incorrect. The metadata object carries request tracking identifiers, not behavioral instructions, so the persona would be ignored.
Explanation
Persistent behavioral guidance belongs in the dedicated top-level system parameter, which the model treats as higher-priority context separate from conversational turns.
Example12 · Claude API & Messages Fundamentals
A developer at a manufacturing distributor is building a service that summarizes inbound purchase-order emails using the Claude Messages API. Their first request to the /v1/messages endpoint is rejected before any generation occurs. Which combination of top-level fields must be present in the request body for it to be accepted?
✓A model identifier, a max_tokens value, and a messages array holding the conversation turns
Correct. The Messages API requires model, max_tokens, and a messages array as the mandatory top-level fields for a request to be accepted.
・A conversation messages array plus a system string, with the model inferred automatically
Incorrect. The model cannot be inferred; it is required, and system is optional rather than mandatory.
・A model identifier and a prompt string that concatenates the full email thread text
Incorrect. The Messages API uses a structured messages array, not a single flat prompt string as the legacy Text Completions API did.
・A model identifier, a temperature setting, and an input array describing each email attachment
Incorrect. There is no input field of email attachments, and temperature is optional, not required for acceptance.
Explanation
A minimally valid Messages API call needs model, max_tokens, and messages; other fields such as system and temperature are optional.
Example13 · Claude API & Messages Fundamentals
The distributor's support tool sends a conversation where it wants to steer Claude's persona and behavior without consuming a conversational turn. Where should the persistent instruction 'You are a logistics assistant for a parts warehouse' be placed?
✓In the top-level system parameter, which sets context separately from the user and assistant turns
Correct. The top-level system parameter provides persistent context and persona guidance outside the user/assistant conversation turns.
・As the first entry in the messages array using the assistant role so Claude treats it as prior output
Incorrect. The assistant role represents Claude's prior responses, not standing instructions, so persona guidance there is misplaced.
・In a dedicated instruction role appended after the final user message in the messages array
Incorrect. There is no separate instruction role; the valid message roles are user and assistant only.
・In the system parameter and also duplicated as a user message so the model cannot overlook it
Incorrect. Duplicating the instruction as a user message is unnecessary and the user role is for human input, not persona setup.
Explanation
Persistent behavioral and persona guidance belongs in the system parameter, which is distinct from the user and assistant message roles.
Example14 · Claude API & Messages Fundamentals
A developer at a telecom operator is building a billing-support assistant and sends its first call to the Messages API. The request includes a model identifier and a messages array, but the call is rejected before any response is generated. Which required parameter is the developer most likely missing from the request body?
・The temperature parameter, which the API requires in every call to control the randomness of the billing assistant's generated replies
Incorrect. temperature is an optional sampling parameter with a default value; omitting it does not cause the request to be rejected.
✓The max_tokens parameter, which sets the upper bound on the number of tokens Claude may generate in its response
Correct. The Messages API requires model, messages, and max_tokens; leaving out max_tokens produces a validation error before generation.
・The system parameter, which supplies the persona and must accompany every request made to the Messages endpoint
Incorrect. The system prompt is optional; many valid requests omit it entirely without any error.
・The stop_sequences parameter, which tells the model where to end so the billing response is never truncated improperly
Incorrect. stop_sequences is optional and simply unused when absent; it is not a required field.
Explanation
A minimal valid Messages request must include model, messages, and max_tokens. The missing required field here is max_tokens.
Example15 · Claude API & Messages Fundamentals
A telecom operator's support tool keeps a running conversation so Claude can remember earlier context about a customer's outage ticket. When sending the next request, how should the developer represent the previous reply Claude generated so the model recognizes it as its own prior turn?
✓Add it as an entry with the role set to assistant inside the messages array, preserving it alongside the earlier user turns in order
Correct. Claude's prior replies are replayed as role: assistant entries in the messages array to maintain conversational context.
・Place it in the system parameter so the model treats its own earlier outage explanation as fixed background guidance for the session
Incorrect. The system parameter is for instructions and persona, not for replaying the model's own conversational turns.
・Include it as a new user message, because every item appended to the ongoing messages array is interpreted by Claude as user input
Incorrect. Labeling a prior Claude reply as user misrepresents the turn and breaks the alternating conversation structure.
・Omit it from the request, since Claude automatically retrieves and reattaches every reply it produced earlier in the same conversation
Incorrect. The API is stateless; the developer must resend prior turns because Claude does not store conversation history server-side.
Explanation
Because the Messages API is stateless, prior Claude replies must be resent with the assistant role to preserve multi-turn context.
▶ Try 10 free questions (graded)
Measure your readiness with a full mock exam
All questions · full explanations · lifetime access
Enroll(33 USD)