#1
When a tool execution fails, what does the official best practice for structured error responses include, and why is it important?
A Throw a Python/JavaScript exception from the tool function; the agent SDK will automatically convert it to a recoverable tool result. B Return a structured error result containing isError: true, an errorCategory (e.g., "transient", "validation", "permission"), and isRetryable flag, so the coordinator can make intelligent recovery decisions. C Return an empty string or null; the coordinator will detect missing output and trigger its default retry policy. D Return a plausible-looking fabricated result to maintain workflow continuity and report the error in a separate log file. उत्तर दिखाएँ
#2
Which Claude API feature is most appropriate for this use case and what is its primary benefit?
A Real-time Messages API with streaming enabled, to get faster individual responses. B Message Batches API, which offers approximately 50% cost savings and processes requests asynchronously with results available within 24 hours. C Real-time Messages API without streaming, to simplify result handling. D The standard Messages API with a caching header to avoid redundant processing of similar tickets. उत्तर दिखाएँ
#3
What is the most architecturally sound approach to enforce this compliance requirement?
A Include a note in the agent's system prompt: "Always call the log_compliance tool after every transaction." B Implement a PostToolUse hook on the transaction tool that automatically calls the compliance logging API after every successful transaction execution. C Create a new combined tool process_and_log_transaction that wraps both the transaction and logging operations. D Add a validation step at the end of the agent's response generation that checks whether the compliance tool was called. उत्तर दिखाएँ
#4
According to best practices, which condition should trigger the escalate_to_human tool?
A Any time the customer uses negative sentiment or profanity in their message, as detected by keyword matching. B When the customer explicitly requests human assistance, when the issue falls outside the agent's defined resolution capabilities, or when a high-value exception requires human judgment. C After every third unsuccessful resolution attempt, regardless of the nature of the failure. D When the agent's self-reported confidence score for its proposed solution falls below 70%. उत्तर दिखाएँ
#5
Which reliability pattern best handles this scenario?
A Terminate the entire agent session with an error message and require users to restart manually when the database returns. B Implement a fallback chain: try the primary database → if unavailable, try a read-replica or cached data source → if all sources fail, clearly communicate the limitation and continue with partial functionality. C Have the agent fabricate plausible-looking data to substitute for the missing database results. D Increase the agent's retry timeout to 60 minutes and keep retrying until the database returns. उत्तर दिखाएँ
#6
In MCP (Model Context Protocol), what is the key difference between stdio and SSE (Server-Sent Events) transports, and when should each be used?
A stdio is faster for all use cases; SSE is only used for backwards compatibility with older systems. B stdio communicates via standard input/output and is ideal for local processes (same machine, no network); SSE communicates over HTTP and is ideal for remote/networked MCP servers accessible to multiple clients. C stdio is for read-only MCP tools; SSE is for tools that write data. Using the wrong transport causes data corruption. D stdio supports streaming responses; SSE does not. Choose stdio when tools return large datasets. उत्तर दिखाएँ
#7
What is the most maintainable CLAUDE.md structure for this monorepo?
A A single root CLAUDE.md with all package-specific information concatenated in sections labeled by package name. B Root CLAUDE.md for repo-wide context (monorepo structure, shared conventions, CI system), plus individual CLAUDE.md in each packages/X/ directory for package-specific context. C No CLAUDE.md files at all; provide all context in the initial message of each Claude Code session. D One CLAUDE.md per developer, stored in their home directory, describing their personal understanding of the monorepo. उत्तर दिखाएँ
#8
Which execution ordering is most efficient while maintaining correctness?
A Execute steps 1, 2, and 3 sequentially to ensure each step builds on the previous one. B Execute steps 1 and 2 in parallel (both are independent data retrieval tasks), then execute step 3 after both complete. C Execute step 3 first with a placeholder, then fill in content from steps 1 and 2. D Execute step 2 first (faster retrieval), then step 1, then step 3 to optimize latency. उत्तर दिखाएँ
#9
When is it most effective to specify a persona or role for Claude using the system prompt rather than the first user message?
A System prompt persona specification is only necessary when using Claude via API; the Claude.ai web interface handles personas automatically. B System prompt persona specification is most effective when the role should apply consistently across all turns of a conversation, ensuring every response reflects that expertise without requiring repetition in each user turn. C System prompt personas are weaker than user-turn personas because the model treats system prompts as lower priority. D Personas should never be in system prompts; they belong in the first user message so the model can acknowledge the role before adopting it. उत्तर दिखाएँ
#10
What is the difference between syntax validation and semantic validation in structured output pipelines, and why do both matter?
A Syntax validation checks grammar correctness; semantic validation checks spelling. Both are needed for polished output. B Syntax validation verifies the output is valid JSON (parseable, correct types); semantic validation verifies the values make business sense (amounts are positive, dates are in range, required relationships hold). Both catch different failure modes. C They are equivalent terms for the same process; using one automatically performs the other. D Syntax validation is performed by the model; semantic validation is performed by the developer. Only one is needed at a time. उत्तर दिखाएँ
#11
Which file location and frontmatter format correctly defines this custom slash command?
A Create .claude/commands/deploy.md with frontmatter: name: deploy, description: Run deployment checklist, arguments: [{name: env, required: true}] B Create commands/deploy.sh and register it in CLAUDE.md under the [commands] section with the --env flag documented. C Add the command definition to the Claude Code settings JSON file under customCommands with a handler pointing to the script path. D Create .claude/slash_commands.json with an array of command definitions including name, description, and argument schema. उत्तर दिखाएँ
#12
A monorepo needs TypeScript-specific linting rules applied to all .ts files scattered across multiple directories, and Python-specific rules applied to all .py files. Which Claude Code mechanism correctly handles path-specific rules scoped by file type across the entire repo?
A Create a single .claude/CLAUDE.md with all rules, and ask Claude to infer which rules apply based on the file extension it is editing. B Create frontend/CLAUDE.md and backend/CLAUDE.md; Claude Code will infer file-type rules from the directory context. C Create rule files in .claude/rules/ (e.g., typescript.md, python.md) with YAML frontmatter specifying glob patterns (e.g., globs: ["/.ts"]); Claude Code applies each rule file only to matching paths. D Path-specific rules by file type are not supported; you must add file-type rules to every directory-level CLAUDE.md manually. उत्तर दिखाएँ
#13
Where should the team MCP server be configured, and where should personal MCP servers be configured?
A Both team and personal MCP servers should be in the user-level ~/.claude.json to ensure they are always available. B Team MCP server: project-level .mcp.json in the repository root (committed to version control, shared with the team). Personal MCP servers: user-level ~/.claude.json (private, per-developer). C Both should be in the project-level .mcp.json to ensure consistency. Personal servers are identified by adding a personal: true flag. D MCP servers cannot be scoped; all configured servers are always available to all users on the machine. उत्तर दिखाएँ
#14
Which built-in Claude Code tool is most appropriate for this task?
A Read — to open each TypeScript file and check its imports manually. B Glob — to find all .ts files using a pattern like /.ts. C Grep — to search file contents for the pattern @company/auth across .ts files. D Bash with find — to locate TypeScript files by extension. उत्तर दिखाएँ
#15
What is the primary trade-off when requesting chain-of-thought reasoning from Claude?
A Chain-of-thought always reduces accuracy because reasoning steps introduce more opportunities for errors. B Chain-of-thought increases accuracy on complex reasoning tasks but also increases response latency and token consumption, making it unsuitable for latency-sensitive applications. C Chain-of-thought only works with Claude 3 Opus and degrades performance on other model tiers. D Chain-of-thought eliminates the need for few-shot examples, so using both simultaneously reduces performance. उत्तर दिखाएँ
#16
In a coordinator-subagent architecture, which agent should hold the retry logic when a subagent fails, and why?
A The subagent should contain its own retry logic, since it has the most context about why the failure occurred. B The coordinator should hold retry logic, since it manages the overall workflow and can decide whether to retry, use a fallback, or escalate based on the broader task context. C Retry logic should be split evenly between the coordinator and subagent, with the subagent handling transient failures and the coordinator handling structural failures. D Neither should contain retry logic; a separate retry orchestrator agent should be introduced for this purpose. उत्तर दिखाएँ
#17
Which tool_choice configuration correctly matches each agent's requirement?
A All three agents should use tool_choice: "auto" and rely on system prompt instructions to control tool usage patterns. B Extraction agent: tool_choice: { type: "tool", name: "extract_invoice" } (forced specific tool); General agent: tool_choice: "auto" (model decides); Data-gathering agent: tool_choice: "any" (must use at least one tool). C Extraction agent: tool_choice: "any"; General agent: tool_choice: "none"; Data-gathering agent: tool_choice: "auto". D tool_choice can only be set globally for all agents in a session; per-agent configuration is not supported. उत्तर दिखाएँ
#18
What is the most appropriate context management strategy?
A Truncate the oldest messages to free up space, discarding the earliest parts of the research. B Evaluate the conversation history and use a combination of strategies: summarize completed subtask results into a compact structured format, persist important raw findings to external storage, and keep only the most recent and relevant turns in the active context. C Switch to a model with a larger context window, which will allow the agent to continue without any data loss. D Stop the agent and ask the user to manually review and delete messages they consider unimportant. उत्तर दिखाएँ
#19
A product team wants to use the Message Batches API to power their real-time customer chat interface to reduce API costs by 50%. Why is this a problematic design choice?
A The Batches API does not support the Claude 3 model family and would require a model downgrade. B The Batches API provides no guaranteed response latency — results can take up to 24 hours. Real-time chat requires sub-second responses, making Batches completely unsuitable. C The Batches API has a minimum request size of 1,000 messages, making individual chat turns too expensive. D The Batches API does not support system prompts, which are required for consistent chat persona. उत्तर दिखाएँ
#20
In an agentic system, why is using the model's self-reported confidence score as the primary trigger for human escalation considered an anti-pattern?
A Confidence scores slow down the agent because generating them requires additional API calls. B LLM confidence scores are poorly calibrated — models can be highly confident when wrong and uncertain when correct. Explicit, programmatic escalation triggers are more reliable. C Confidence scores are a premium feature not available on all Claude API tiers. D The model's confidence score applies only to the previous response and cannot predict future uncertainty. उत्तर दिखाएँ