Free Claude certification practice questions

40 original, exam-style questions for the Claude Certified Architect (CCA-F) exam, spread across all five official domains. Reveal each answer for a full explanation. No signup required.

Agentic Architecture & Orchestration

Domain guide →
Q1Agentic Architecturefoundation

Which type of task benefits MOST from being split across parallel subagents?

  • AA tightly sequential task where each step depends on the output of the previous step
  • BA task where every agent must continuously see the other agents' evolving intermediate state
  • CA quick, targeted edit to a single known file where response latency matters most
  • DRead-heavy research where independent sources can be explored simultaneously and each subagent returns a condensed summary
Show answer & explanation

Answer: D. Read-heavy research where independent sources can be explored simultaneously and each subagent returns a condensed summary

Parallel subagents shine on parallelizable, self-contained, read-heavy work: each worker explores independently in its own context and returns compressed findings. Sequential dependencies eliminate the parallelism benefit, tasks requiring continuously shared state incur heavy coordination overhead, and quick targeted edits are better done in the main conversation because subagents start fresh and add latency.

Read the docs →
Q2Agentic Architecturefoundation

What happens when a PreToolUse hook script in Claude Code exits with code 2?

  • AThe tool call is blocked, and the hook's stderr output is fed back to Claude as an error message
  • BThe tool call proceeds, but a warning banner is shown to the user in the transcript
  • CThe tool call is blocked, and the hook's stdout JSON is parsed for a permissionDecision value
  • DThe hook is retried once before Claude Code falls back to the normal permission prompt
Show answer & explanation

Answer: A. The tool call is blocked, and the hook's stderr output is fed back to Claude as an error message

Exit code 2 from a PreToolUse hook is a blocking error: the tool call is prevented and the stderr text is returned to Claude so it understands why the action was rejected. Stdout, including any JSON, is ignored on exit code 2; JSON decisions like permissionDecision are only processed when the hook exits with code 0. There is no automatic retry behavior for hooks.

Read the docs →
Q3Agentic Architecturefoundation

Which sequence correctly describes the core loop Anthropic uses to describe how agents operate?

  • AClassify the input, route it to a specialized prompt, then aggregate the responses.
  • BPlan the full task upfront, execute every step, then summarize and terminate.
  • CGenerate a draft, have a second model evaluate it, then return the first draft unchanged.
  • DGather context, take action, verify work, then repeat.
Show answer & explanation

Answer: D. Gather context, take action, verify work, then repeat.

Anthropic describes the agent loop as gathering context, taking action, verifying work, and repeating until the task is done. Classify-and-route describes the routing workflow, not the agent loop, and generate-then-evaluate describes evaluator-optimizer. Planning everything upfront and terminating contradicts the iterative, feedback-driven nature of agents.

Read the docs →
Q4Agentic Architecturefoundation

Which two variations of the parallelization workflow does Anthropic describe in 'Building effective agents'?

  • ARouting, which classifies inputs, and gating, which validates intermediate outputs between steps.
  • BSharding, which splits large documents across context windows, and batching, which groups API requests to reduce cost.
  • CMapping, which transforms each input item independently, and reducing, which merges partial results into one summary.
  • DSectioning, which breaks a task into independent subtasks run in parallel, and voting, which runs the same task multiple times to get diverse outputs.
Show answer & explanation

Answer: D. Sectioning, which breaks a task into independent subtasks run in parallel, and voting, which runs the same task multiple times to get diverse outputs.

Anthropic names exactly two parallelization variants: sectioning (independent subtasks in parallel) and voting (the same task run multiple times for diverse outputs). Routing is a separate workflow pattern and gates belong to prompt chaining, not parallelization. Sharding, batching, and map-reduce are general distributed computing terms that Anthropic does not use for this pattern.

Read the docs →
Q5Agentic Architecturefoundation

Which statement accurately describes how the Anthropic memory tool (memory_20250818) executes its file operations?

  • AIt is a client-side tool: Claude requests operations such as view and create, and the developer's application executes them against storage the developer controls.
  • BIt is a server-side tool: Anthropic hosts the /memories directory and persists the files between conversations automatically.
  • CIt stores memory entries in an Anthropic-managed vector database and retrieves them by semantic search at the start of each session.
  • DIt requires the code execution tool, because memory files are written inside Anthropic's sandboxed container.
Show answer & explanation

Answer: A. It is a client-side tool: Claude requests operations such as view and create, and the developer's application executes them against storage the developer controls.

The memory tool operates client-side: Claude only emits tool_use requests, and your application executes each command against its own storage, returning results in tool_result blocks. The /memories path is just a prefix your handler maps onto real storage such as a per-user directory or database keys. Anthropic does not host the files, there is no managed vector database behind it, and it has no dependency on the code execution tool.

Read the docs →
Q6Agentic Architecturefoundation

Which of the following is a genuine advantage of a single-agent architecture over a multi-agent architecture in production?

  • AIt reliably produces better results on breadth-first research tasks whose information exceeds a single context window.
  • BIt eliminates non-determinism, since a single agent produces identical outputs across identical runs.
  • CIt removes the need for observability tooling, because errors cannot compound within one agent.
  • DFailures are easier to trace and debug because there is one context and one decision-making loop instead of coordination across multiple agents.
Show answer & explanation

Answer: D. Failures are easier to trace and debug because there is one context and one decision-making loop instead of coordination across multiple agents.

With one agent there is a single trajectory to inspect, so debugging and tracing are simpler and cheaper than reconstructing interactions among an orchestrator and multiple subagents. Breadth-first research exceeding one context window is exactly where multi-agent systems excel, single agents remain non-deterministic across runs, and long-running single agents are still stateful systems where errors compound, so observability is still required.

Read the docs →
Q7Agentic Architecturefoundation

According to Anthropic's documentation, in which environment is it appropriate to run Claude Code in bypassPermissions mode?

  • AOn any developer workstation, as long as CLAUDE.md instructs the agent to avoid destructive commands
  • BOn production servers, provided an on-call engineer is monitoring the session
  • CIn any git repository, because uncommitted changes can always be recovered from the working tree
  • DIn an isolated environment such as a container or VM where the agent cannot damage systems that matter
Show answer & explanation

Answer: D. In an isolated environment such as a container or VM where the agent cannot damage systems that matter

The docs warn that bypassPermissions skips permission prompts and should only be used in isolated environments like containers or VMs where Claude Code cannot cause damage. CLAUDE.md instructions shape model behavior but are not an enforced boundary, so they do not make the mode safe on a workstation. Monitoring a production session does not contain the blast radius of a mistaken action, and git does not protect files outside the repository or actions like network calls.

Read the docs →
Q8Agentic Architecturefoundation

Which statement best describes the fundamental tradeoff Anthropic identifies for agentic systems compared with a single LLM call?

  • AAgentic systems reduce both latency and cost because work is split across smaller, cheaper model calls.
  • BAgentic systems often trade higher latency and cost for better performance on complex tasks, so teams must evaluate when that tradeoff makes sense.
  • CAgentic systems trade accuracy for speed, so they should be reserved for tasks where correctness is not critical.
  • DAgentic systems remove the need for evaluation because the agent verifies its own work at every step.
Show answer & explanation

Answer: B. Agentic systems often trade higher latency and cost for better performance on complex tasks, so teams must evaluate when that tradeoff makes sense.

Anthropic states that agentic systems often trade latency and cost for better task performance, and developers should consider when this tradeoff makes sense. Splitting work across calls increases rather than decreases total tokens and wall-clock time, agents are used precisely because complex tasks demand correctness, and autonomous behavior increases (not removes) the need for evaluation and guardrails.

Read the docs →

Claude Code Configuration & Workflows

Domain guide →
Q1Claude Codefoundation

Which of the following belongs in a settings file rather than in CLAUDE.md?

  • AThe command sequence for building and testing the project
  • BThe team's naming conventions for API handler files
  • CA permission rule that denies Claude the ability to run a specific shell command
  • DA summary of the repository's architecture and directory layout
Show answer & explanation

Answer: C. A permission rule that denies Claude the ability to run a specific shell command

Permission rules like permissions.deny are technical enforcement applied by the Claude Code client regardless of what the model decides, so they belong in settings files. CLAUDE.md content is context that guides behavior but is not guaranteed to be obeyed. Build commands, naming conventions, and architecture overviews are exactly the kind of natural-language guidance CLAUDE.md is designed to carry.

Read the docs →
Q2Claude Codefoundation

What does the /memory slash command do in an interactive Claude Code session?

  • ALists all CLAUDE.md, CLAUDE.local.md, and rules files loaded in the session and lets you open them in your editor, plus toggle auto memory
  • BClears the current context window while preserving the conversation transcript
  • CPrints a token-by-token breakdown of how much context each tool call consumed
  • DSaves the current conversation into the project CLAUDE.md automatically
Show answer & explanation

Answer: A. Lists all CLAUDE.md, CLAUDE.local.md, and rules files loaded in the session and lets you open them in your editor, plus toggle auto memory

The /memory command is the inspection and editing entry point for memory: it shows every memory file loaded in the current session, opens any of them in your editor, and includes the auto memory toggle. Clearing context is handled by /clear or /compact, not /memory. It does not produce token usage reports, and it never writes the conversation itself into CLAUDE.md.

Read the docs →
Q3Claude Codefoundation

What is the intended purpose of a CLAUDE.local.md file at the root of a project?

  • AOverriding and disabling the committed project CLAUDE.md for the current machine
  • BProviding instructions that only load when Claude Code is started with a --local flag
  • CHolding personal, project-specific instructions (like sandbox URLs or preferred test data) that are added to .gitignore rather than committed
  • DDistributing organization-wide policies that individual developers cannot exclude
Show answer & explanation

Answer: C. Holding personal, project-specific instructions (like sandbox URLs or preferred test data) that are added to .gitignore rather than committed

CLAUDE.local.md is for individual, per-project preferences: it loads alongside the project CLAUDE.md and should be gitignored so it stays private to you. It does not override or disable the shared CLAUDE.md; both files are combined into context. There is no --local launch flag gating it, and organization-wide policy belongs in the managed policy CLAUDE.md location, not in a per-developer local file.

Read the docs →
Q4Claude Codefoundation

Which YAML frontmatter fields must be present in a Claude Code subagent definition file?

  • Aname, description, and tools
  • Bname and description
  • Cname, description, tools, and model
  • Dname only; all other fields including description are optional
Show answer & explanation

Answer: B. name and description

Only name and description are required in subagent frontmatter; the Markdown body then becomes the subagent's system prompt. Fields like tools, model, and permissionMode are optional: omitting tools inherits all tools from the main conversation, and omitting model falls back to the session's model. The description is required because Claude uses it to decide when to delegate.

Read the docs →
Q5Claude Codefoundation

A developer joins a project that has no CLAUDE.md and runs the /init command in Claude Code. What does /init do?

  • AAnalyzes the codebase and generates a starting CLAUDE.md with discovered build commands, test instructions, and conventions; if one already exists it suggests improvements instead of overwriting it
  • BCreates a default .claude/settings.json with recommended permission rules but no memory files
  • CDeletes any existing CLAUDE.md and regenerates it from scratch on every run
  • DRegisters the project with the Anthropic Console so usage can be tracked per repository
Show answer & explanation

Answer: A. Analyzes the codebase and generates a starting CLAUDE.md with discovered build commands, test instructions, and conventions; if one already exists it suggests improvements instead of overwriting it

/init bootstraps project memory by exploring the codebase and writing a CLAUDE.md that captures build commands, test instructions, and project conventions, and when a CLAUDE.md already exists it proposes improvements rather than overwriting. It is a memory-generation command, not a settings or permissions generator. It never destroys an existing file, and it has nothing to do with Console registration.

Read the docs →
Q6Claude Codefoundation

Which syntax does a CLAUDE.md file use to import the contents of another file into Claude Code's context at launch?

  • AA templating directive, for example {{import: docs/git-instructions.md}}
  • BA C-style include, for example #include "docs/git-instructions.md"
  • CA markdown link with an import label, for example [import](docs/git-instructions.md)
  • DAn @ prefix followed by the path, for example @docs/git-instructions.md
Show answer & explanation

Answer: D. An @ prefix followed by the path, for example @docs/git-instructions.md

CLAUDE.md supports @path/to/import syntax, so writing @docs/git-instructions.md anywhere in the file expands that file into context at launch. Both relative and absolute paths are allowed. The templating, #include, and markdown-link forms are plausible-looking inventions that Claude Code does not recognize as imports.

Read the docs →
Q7Claude Codefoundation

In Claude Code's default permission mode, which category of tool actions runs without ever triggering an approval prompt?

  • ABash commands that were already run earlier in the session
  • BRead-only operations such as file reads and Grep searches
  • CFile edits inside the current working directory
  • DWeb fetches to domains that were fetched before in the session
Show answer & explanation

Answer: B. Read-only operations such as file reads and Grep searches

Claude Code uses a tiered permission system in which read-only tools like file reads and Grep never require approval. Bash commands and file modifications both require approval in default mode: Bash approvals persist per project directory and command only when you choose the don't-ask-again option, and file edit approvals last until the session ends. There is no automatic session-wide trust for previously used commands or domains.

Read the docs →
Q8Claude Codefoundation

According to Anthropic's guidance, which situation is the strongest signal that an instruction should be added to a project's CLAUDE.md?

  • AThe instruction is a long multi-step procedure that only matters for one subdirectory of the codebase
  • BThe instruction is a secret API key that Claude needs for integration tests
  • CThe developer notices they are typing the same correction into chat that they typed in a previous session
  • DThe instruction must be technically enforced no matter what the model decides to do
Show answer & explanation

Answer: C. The developer notices they are typing the same correction into chat that they typed in a previous session

The docs frame CLAUDE.md as the place to write down what you would otherwise re-explain: repeated corrections, repeated mistakes, and context a new teammate would need. Long multi-step procedures or narrowly scoped guidance belong in skills or path-scoped rules instead, keeping CLAUDE.md concise. Secrets should never go in a memory file, and anything requiring guaranteed enforcement belongs in settings (permissions or hooks), not in context.

Read the docs →

Prompt Engineering & Structured Output

Domain guide →
Q1Prompt Engineeringfoundation

How long does the Message Batches API take to process a submitted batch?

  • AEvery batch is held until a fixed nightly processing window, so results always arrive the next day.
  • BProcessing is guaranteed to finish within 1 hour for any batch under the 100,000-request limit.
  • CMost batches complete in less than 1 hour, but processing can take up to 24 hours, after which the batch expires.
  • DBatches process indefinitely until every request completes, with no upper time bound.
Show answer & explanation

Answer: C. Most batches complete in less than 1 hour, but processing can take up to 24 hours, after which the batch expires.

The system processes each batch as fast as possible: most batches finish in under 1 hour, and results become available when all requests complete or after 24 hours, whichever comes first. Batches that do not finish within 24 hours expire. There is no scheduled nightly window, no 1-hour guarantee, and no unbounded processing.

Read the docs →
Q2Prompt Engineeringfoundation

Which statement best describes the stop_sequences parameter on the Messages API?

  • AIt lists custom text strings that cause generation to stop as soon as the model produces one of them
  • BIt lists banned phrases the model must avoid while continuing to generate the rest of the response
  • CIt defines delimiters the API uses to split the response into multiple content blocks
  • DIt specifies strings the API appends to the response to mark where generation ended
Show answer & explanation

Answer: A. It lists custom text strings that cause generation to stop as soon as the model produces one of them

stop_sequences defines custom strings that end generation the moment the model produces one; the matched string is excluded from the returned text and reported in the response's stop_sequence field. The parameter does not filter phrases while generation continues, does not split content blocks, and nothing is appended to the output.

Read the docs →
Q3Prompt Engineeringfoundation

Which statement correctly describes the temperature parameter in the Messages API?

  • AIt ranges from 0.0 to 2.0 and defaults to 0.7, with higher values producing more repetitive, deterministic text.
  • BIt ranges from 0.0 to 1.0 and defaults to 1.0; values closer to 0.0 suit analytical or multiple choice tasks, while values closer to 1.0 suit creative and generative tasks.
  • CIt ranges from 0.0 to 1.0 and defaults to 0.0, so outputs are fully deterministic unless it is explicitly raised.
  • DIt is an integer from 1 to 100 that controls how many candidate tokens are considered at each decoding step.
Show answer & explanation

Answer: B. It ranges from 0.0 to 1.0 and defaults to 1.0; values closer to 0.0 suit analytical or multiple choice tasks, while values closer to 1.0 suit creative and generative tasks.

The Messages API documents temperature as defaulting to 1.0 with a 0.0 to 1.0 range, recommending lower values for analytical tasks and higher values for creative ones. The 0.0 to 2.0 range with a 0.7 default describes other providers' APIs, not Claude's, and higher temperature increases rather than reduces randomness. The default is not 0.0, and the integer candidate-count description matches top_k, not temperature.

Read the docs →
Q4Prompt Engineeringfoundation

Which of the following correctly states the size limits for a single Message Batch?

  • AUp to 10,000 Messages requests or 32 MB in total size, whichever is reached first.
  • BUp to 1,000,000 Messages requests with no byte-size limit, since requests are streamed to storage.
  • CUp to 100,000 Messages requests, but only if every request uses the same model and max_tokens value.
  • DUp to 100,000 Messages requests or 256 MB in total size, whichever is reached first.
Show answer & explanation

Answer: D. Up to 100,000 Messages requests or 256 MB in total size, whichever is reached first.

The documented limit is 100,000 Messages requests or 256 MB per batch, whichever comes first. There is no requirement that requests share a model or parameters: each request in a batch carries its own independent params object, and there is no unlimited-size tier.

Read the docs →
Q5Prompt Engineeringfoundation

What does "multishot prompting" refer to in Anthropic's prompt engineering documentation?

  • ARunning the same prompt several times and majority-voting across the answers
  • BSplitting one task across several sequential API calls that share conversation history
  • CIncluding a few well-crafted example inputs and outputs directly in the prompt to steer Claude's format, tone, and structure
  • DRequesting several candidate completions in one API call via an n parameter
Show answer & explanation

Answer: C. Including a few well-crafted example inputs and outputs directly in the prompt to steer Claude's format, tone, and structure

Multishot (few-shot) prompting means placing a few well-crafted examples in the prompt itself, which the docs call one of the most reliable ways to steer output format, tone, and structure. Re-running a prompt and comparing outputs is best-of-N verification, splitting work across calls is prompt chaining, and the Messages API has no parameter that returns multiple candidate completions.

Read the docs →
Q6Prompt Engineeringfoundation

Which of the following correctly pairs a Messages API stop_reason value with its meaning?

  • Amax_tokens: the model declined to continue generating for safety policy reasons.
  • Btool_use: the model finished executing a tool on the server and the agentic loop is complete.
  • Cend_turn: the model reached a natural stopping point and finished its response on its own.
  • Dstop_sequence: the request hit a rate limit and generation was halted by the server.
Show answer & explanation

Answer: C. end_turn: the model reached a natural stopping point and finished its response on its own.

end_turn means the model completed its turn naturally and the response can be used as-is. max_tokens signals the output hit the requested token cap (safety declines surface as the refusal stop reason), and tool_use means the model is requesting that your application execute a tool, not that execution already finished. stop_sequence indicates one of your custom stop_sequences was generated; rate limiting is reported as an HTTP 429 error, never as a stop_reason.

Read the docs →
Q7Prompt Engineeringfoundation

Which statement best captures a core rule of manual chain of thought prompting from Anthropic's documentation?

  • AClaude performs the step-by-step reasoning internally even when the prompt requires it to reply with only a single word
  • BClaude must actually output its reasoning in the response; without outputting its thought process, no thinking occurs
  • CChain of thought prompting only takes effect when the extended thinking parameter is also enabled on the request
  • DChain of thought instructions are ignored unless they are placed in the system prompt rather than the user message
Show answer & explanation

Answer: B. Claude must actually output its reasoning in the response; without outputting its thought process, no thinking occurs

Anthropic's chain of thought guidance stresses always having Claude output its thinking, because without the thought process appearing in the output, no thinking occurs. That rules out silent internal reasoning while emitting a one-word reply. Manual CoT is a prompting technique that works without the extended thinking API feature, and CoT instructions work in user messages as well as system prompts.

Read the docs →
Q8Prompt Engineeringfoundation

When deciding how to grade prompt evaluations, which comparison of grading methods matches Anthropic's guidance?

  • AHuman grading is the fastest option because it requires no infrastructure, while code-based grading demands costly rule maintenance.
  • BLLM-based grading should be reserved for exact string matching and avoided for complex judgments.
  • CCode-based grading is the most nuanced method because rules can encode any judgment a human grader could make.
  • DCode-based grading is fastest and most reliable but lacks nuance; human grading is flexible and high quality but slow and expensive; LLM-based grading is fast and scalable but should be tested for reliability before scaling.
Show answer & explanation

Answer: D. Code-based grading is fastest and most reliable but lacks nuance; human grading is flexible and high quality but slow and expensive; LLM-based grading is fast and scalable but should be tested for reliability before scaling.

The docs rank code-based grading (exact match, string match) as fastest, most reliable, and extremely scalable but lacking nuance; human grading as most flexible and high quality but slow and expensive, to be avoided when possible; and LLM-based grading as fast, flexible, and suitable for complex judgment once reliability is validated. The other options invert these tradeoffs: humans are the slow path, LLM grading exists precisely for nuanced judgments, and code rules cannot capture every subjective assessment.

Read the docs →

Tool Design & MCP Integration

Domain guide →
Q1Tools & MCPfoundation

Which of the following tool names is valid for the Claude Messages API?

  • Asearch customer records
  • Bvector_db-search_v2
  • Cget.stock.price
  • Dchercher_météo
Show answer & explanation

Answer: B. vector_db-search_v2

Tool names must match the regex ^[a-zA-Z0-9_-]{1,64}$: only ASCII letters, digits, underscores, and hyphens, with a length of 1 to 64 characters. Spaces, periods, and accented or other non-ASCII characters are all rejected, which rules out the other three options. Underscores and hyphens are both permitted, so mixing them as in the correct option is fine.

Read the docs →
Q2Tools & MCPfoundation

What guidance does Anthropic give about the length of a tool description?

  • AAim for at least 3 to 4 sentences per tool, and more for complex tools
  • BKeep it to a single sentence so tool definitions consume as few tokens as possible
  • CKeep it under 10 words because the API truncates longer descriptions
  • DLength does not matter because Claude relies only on the input_schema when choosing tools
Show answer & explanation

Answer: A. Aim for at least 3 to 4 sentences per tool, and more for complex tools

The documentation says to aim for at least 3 to 4 sentences per tool description, and more for complex tools. Ultra-short descriptions appear as the poor example in the docs, the API does not truncate description text at any short word count, and Claude weighs the description heavily rather than relying on input_schema alone.

Read the docs →
Q3Tools & MCPfoundation

Which three core primitives can an MCP server expose to connected clients?

  • ASampling, roots, and elicitation
  • BFunctions, embeddings, and completions
  • CTools, hooks, and skills
  • DTools, resources, and prompts
Show answer & explanation

Answer: D. Tools, resources, and prompts

MCP servers expose tools (executable functions), resources (data sources for context), and prompts (reusable templates). Sampling, roots, and elicitation are the primitives exposed by clients, not servers, while hooks and skills are Claude Code concepts rather than MCP protocol primitives.

Read the docs →
Q4Tools & MCPfoundation

What guidance do Anthropic's docs give about the length of a tool description?

  • AAim for at least 3-4 sentences per tool description, and more when the tool is complex
  • BKeep each description to a single sentence, because longer text dilutes the model's attention across tools
  • CLength is irrelevant because descriptions are metadata that never enter the model's prompt
  • DStay under 100 characters so every description fits within the constructed system prompt
Show answer & explanation

Answer: A. Aim for at least 3-4 sentences per tool description, and more when the tool is complex

The documentation recommends at least 3-4 sentences per description, with more detail for complex tools. Descriptions are injected into the tool use system prompt and strongly influence behavior, so they are not inert metadata. The docs' "poor description" example is exactly the terse one-liner style, which leaves Claude with open questions about usage.

Read the docs →
Q5Tools & MCPfoundation

What information does a tool_use content block in a Messages API response contain?

  • AAn id, the tool name, and an output field populated once the API finishes executing the tool
  • BAn id to match results to the call, the name of the tool, and an input object conforming to the tool's input_schema
  • CA tool_use_id, a content field, and an optional is_error flag
  • DThe tool name, an arguments field containing a JSON-encoded string, and a call_index
Show answer & explanation

Answer: B. An id to match results to the call, the name of the tool, and an input object conforming to the tool's input_schema

A tool_use block carries an id used to match the eventual result, the name of the tool, and an input object that conforms to the tool's input_schema. tool_use_id, content, and is_error are fields of the tool_result block you send back, not of tool_use. There is no output field because the API does not execute client tools, and input arrives as a parsed JSON object rather than an encoded arguments string.

Read the docs →
Q6Tools & MCPfoundation

How does an MCP client communicate with a local MCP server over the stdio transport?

  • AThe client opens a WebSocket connection to a port number the server prints when it starts up.
  • BThe client and server exchange messages through a shared memory-mapped file on the local disk.
  • CThe client polls a Unix domain socket that the server creates in the current working directory.
  • DThe client launches the server as a subprocess and exchanges newline-delimited JSON-RPC messages through the server's standard input and standard output.
Show answer & explanation

Answer: D. The client launches the server as a subprocess and exchanges newline-delimited JSON-RPC messages through the server's standard input and standard output.

In the stdio transport the client launches the server as a subprocess, writes JSON-RPC messages to the server's stdin, and reads responses from its stdout, with messages delimited by newlines. WebSockets, shared memory, and Unix domain sockets are not part of the two standard MCP transports, which are stdio and Streamable HTTP.

Read the docs →
Q7Tools & MCPfoundation

Which wire format do all MCP messages use, regardless of which transport carries them?

  • AProtocol Buffers over gRPC, with JSON permitted only for local debugging.
  • BJSON-RPC 2.0, with requests, responses, and notifications encoded as UTF-8 JSON.
  • CREST-style resource URLs where the HTTP verb encodes the operation being performed.
  • DGraphQL queries and mutations validated against a schema the server publishes.
Show answer & explanation

Answer: B. JSON-RPC 2.0, with requests, responses, and notifications encoded as UTF-8 JSON.

MCP's data layer is built on JSON-RPC 2.0, and every transport (stdio, Streamable HTTP, or a custom transport) must preserve that message format, encoded as UTF-8. MCP is not defined in terms of Protocol Buffers, REST resource semantics, or GraphQL, even though Streamable HTTP happens to use HTTP as a carrier.

Read the docs →
Q8Tools & MCPfoundation

Which set of fields defines each custom tool passed in the tools parameter of a Messages API request?

  • Aname, endpoint_url, and http_method, so the API can invoke the tool on your server
  • Bfunction_name, arguments, and return_type, matching the standard function-calling format
  • Cname, input_schema, and handler (a callback function the API executes when the tool is selected)
  • Dname, description, and input_schema (a JSON Schema object describing the tool's expected parameters)
Show answer & explanation

Answer: D. name, description, and input_schema (a JSON Schema object describing the tool's expected parameters)

Each custom tool in the tools parameter is defined by a name, a description, and an input_schema expressed as JSON Schema; an optional input_examples array can also be added. The API never invokes your code directly, so there is no endpoint, HTTP method, or handler to register: your application executes the tool when Claude emits a tool_use block. The function_name/arguments/return_type shape belongs to other providers' APIs, not the Claude Messages API.

Read the docs →

Context Management & Reliability

Domain guide →
Q1Context & Reliabilityfoundation

Which statement best describes what the context window represents for a Claude model?

  • AThe total amount of text the model can reference when generating a response, including the response it generates, functioning as its working memory
  • BThe full corpus of data the model was trained on, which it can recall verbatim at inference time
  • CA server-side cache of previous conversations that Claude automatically searches on each request
  • DThe maximum number of output tokens a single response can contain, controlled by the max_tokens parameter
Show answer & explanation

Answer: A. The total amount of text the model can reference when generating a response, including the response it generates, functioning as its working memory

The docs define the context window as all the text a model can look back on and reference when generating a response, plus the new text it generates, acting as working memory. It is explicitly distinct from the training corpus. The Messages API is stateless and does not maintain a server-side conversation cache, and max_tokens caps output length rather than defining the window.

Read the docs →
Q2Context & Reliabilityfoundation

When the Claude API processes a Messages request, which of the following counts toward the model's context window?

  • AThe system prompt, tool definitions, every message in the conversation (including tool results and documents), and the output Claude generates for the turn, including its extended thinking
  • BOnly the messages array; the system prompt and tool definitions are handled as request metadata outside the context window
  • COnly input tokens; generated output is constrained by max_tokens but does not occupy the context window
  • DOnly tokens that miss the prompt cache; tokens served from the cache are excluded from the context window calculation
Show answer & explanation

Answer: A. The system prompt, tool definitions, every message in the conversation (including tool results and documents), and the output Claude generates for the turn, including its extended thinking

Everything in the request counts toward the window: the system prompt, tool definitions, and all messages including tool results and documents, plus the output generated for the turn, including current-turn thinking. Output shares the same window as input, so max_tokens must fit in the remaining space. Cached tokens still occupy the window; prompt caching changes what you pay for those tokens, not whether they count.

Read the docs →
Q3Context & Reliabilityfoundation

During a long Claude Code session refactoring a large module, a developer runs /compact. What does this command do?

  • AIt summarizes the conversation history and replaces the older transcript with that summary, freeing context so the session can continue
  • BIt deletes the entire conversation history and starts a brand new session with empty context
  • CIt compresses the transcript with a lossless algorithm before sending it, reducing token counts without losing any detail
  • DIt permanently shrinks the model's context window so subsequent requests cost less
Show answer & explanation

Answer: A. It summarizes the conversation history and replaces the older transcript with that summary, freeing context so the session can continue

/compact performs compaction: Claude Code summarizes the conversation and continues from the condensed summary, and you can even steer it with custom instructions such as /compact Focus on code samples and API usage. Wiping the whole history is what /clear does. Summarization is lossy by design, not lossless compression, and the model's context window size is a fixed model property that commands cannot shrink.

Read the docs →
Q4Context & Reliabilityfoundation

What is the standard context window size for Claude Sonnet 4.5 on the Claude API when no long-context beta is enabled?

  • A200,000 tokens
  • B100,000 tokens
  • C500,000 tokens
  • D1,000,000 tokens by default, with no opt-in required
Show answer & explanation

Answer: A. 200,000 tokens

Claude Sonnet 4.5 and most Claude models ship with a 200K token context window as the standard size. A 1M token window exists only for specific models and, for Sonnet 4.5, required opting in through a long-context beta header, so it is not the default. 100K was the ceiling of much older Claude generations, and 500K is not an offered context size.

Read the docs →
Q5Context & Reliabilityfoundation

Which API capability lets a developer measure how many tokens a prompt will consume before actually creating a message?

  • AGET /v1/usage, which returns a token forecast for any prompt passed as a query parameter
  • BAdding dry_run: true to a standard /v1/messages request so the API validates and counts tokens without generating
  • CPOST /v1/tokenize, which returns the raw token IDs the prompt will be encoded into
  • DPOST /v1/messages/count_tokens, which accepts the same request shape as message creation (model, system, tools, messages) and returns an input_tokens count
Show answer & explanation

Answer: D. POST /v1/messages/count_tokens, which accepts the same request shape as message creation (model, system, tools, messages) and returns an input_tokens count

The token counting endpoint mirrors the Messages request structure, including system prompts, tools, images, and PDFs, and returns the total input token count. It is free to use, subject to its own requests-per-minute limits separate from the Messages API, and the count is an estimate that may differ slightly from actual usage. The other two endpoints and the dry_run parameter do not exist in the Claude API.

Read the docs →
Q6Context & Reliabilityfoundation

According to Anthropic's guidance on effective context engineering for agents, what is the guiding principle for deciding what belongs in an agent's context window?

  • AFill the context window as completely as possible, since more context reliably improves accuracy
  • BFind the smallest possible set of high-signal tokens that maximizes the likelihood of the desired outcome
  • CInclude every available tool definition and reference document so the model never lacks information
  • DKeep usage below half the window at all times, because models cannot attend past 50 percent of capacity
Show answer & explanation

Answer: B. Find the smallest possible set of high-signal tokens that maximizes the likelihood of the desired outcome

Anthropic's context engineering guidance states that context must be treated as a finite resource with diminishing marginal returns, and that good context engineering means finding the smallest possible set of high-signal tokens that maximize the likelihood of the desired outcome. Packing the window with everything available degrades recall rather than improving it. There is no documented rule that attention stops at 50 percent of capacity.

Read the docs →
Q7Context & Reliabilityfoundation

Anthropic's context engineering guidance treats context as a finite resource with diminishing marginal returns. Which practice best reflects this principle when building an agent?

  • AFill the context window as completely as possible on every request so the model never lacks information
  • BLoad every potentially relevant document up front, since retrieving context during the task wastes turns
  • CCurate the smallest possible set of high-signal tokens that maximizes the likelihood of the desired outcome
  • DTreat context curation as unnecessary once a model with a larger context window is available
Show answer & explanation

Answer: C. Curate the smallest possible set of high-signal tokens that maximizes the likelihood of the desired outcome

Because model attention degrades as token count grows (a phenomenon the docs call context rot), the guidance is to find the smallest set of high-signal tokens that supports the task. Packing the window, front-loading every document instead of retrieving just in time, and assuming a larger window removes the need for curation all ignore the diminishing returns of added context.

Read the docs →
Q8Context & Reliabilityfoundation

A team is building a structured data extraction pipeline on Claude Sonnet 4.5 and needs to size its document batches. What is the model's standard context window on the Claude API?

  • A1,000,000 tokens by default, with no beta enrollment or usage tier requirements
  • B200,000 tokens, shared between the input prompt and the generated output
  • C128,000 tokens for input plus a separate 128,000-token budget for output
  • D100,000 tokens, which can be doubled by setting a larger max_tokens value
Show answer & explanation

Answer: B. 200,000 tokens, shared between the input prompt and the generated output

Claude Sonnet 4.5 has a standard 200k-token context window that holds both the input and the output the model generates. The 1M token window is a separate beta capability limited to eligible models and higher usage tiers, not a default. The window is a single shared budget rather than separate input and output pools, and max_tokens caps output length without enlarging the window.

Read the docs →

Want hundreds more?

These 40 are a small free sample. Claude Prep ships with a full bank of exam-style questions and unlimited 120-minute mock exams scored on the real 1000-point scale, for one simple subscription.