#41
When using few-shot examples to guide Claude's output format, what is the recommended number of examples, and why?
A 10 or more examples, because more examples always lead to better generalization and format adherence. B 2 to 4 targeted, high-quality examples, because this is sufficient to establish the pattern without consuming excessive context tokens. C Exactly 1 example, because a single clear example avoids pattern confusion. D As many examples as possible up to the context limit, because Claude's pattern matching improves linearly with example count. Tampilkan jawaban
#42
Which Claude Code invocation pattern is required for this CI/CD use case?
A Run claude normally and use the --headless flag to suppress the UI, leaving all other behavior unchanged. B Use the -p (print/non-interactive) flag when invoking Claude Code, which runs the task without requiring user interaction and exits with the output. C Set the CI=true environment variable before running Claude Code; it automatically switches to non-interactive mode when this variable is detected. D Use the --batch flag to run multiple review tasks simultaneously without user prompts. Tampilkan jawaban
#43
What constitutes a well-formed, production-safe termination condition for an agentic loop?
A The loop terminates when the model's response contains the phrase "Task complete" or similar confirmation text. B The loop terminates after a fixed maximum of 20 iterations to prevent runaway agents. C The loop terminates when stop_reason is "end_turn" (programmatic signal), with a wall-clock timeout as a safety backstop. D The loop terminates when the total token count across all messages exceeds 100,000 tokens. Tampilkan jawaban
#44
Claude Code loads CLAUDE.md files from multiple locations. In what order are these files loaded, and which takes precedence when rules conflict?
A Project-level CLAUDE.md loads first, then user-level (~/.claude/CLAUDE.md) overrides it, then directory-level files override both. B User-level (~/.claude/CLAUDE.md) loads first as a global baseline, then project-level (.claude/CLAUDE.md) adds project-specific context, then directory-level CLAUDE.md files in subdirectories take highest precedence for their scope. C All CLAUDE.md files are merged alphabetically by filename, with conflicts resolved by taking the last rule encountered. D Only one CLAUDE.md file is active at a time; Claude Code uses whichever file is closest to the current working directory. Tampilkan jawaban
#45
In the Claude Agent SDK agentic loop, what does a stop_reason value of "tool_use" indicate, and what should the agent do in response?
A The agent has completed its task successfully and should terminate the loop. B The model wants to invoke one or more tools; the agent should execute the requested tools and return results to continue the loop. C An error occurred during tool execution and the agent should restart the entire conversation. D The context window is full and the agent should summarize previous messages before continuing. Tampilkan jawaban
#46
In a hub-and-spoke multi-agent architecture, what is the primary role of the coordinator (hub) agent?
A The coordinator directly executes all tools and returns aggregated results to the user, bypassing subagents for efficiency. B The coordinator decomposes the task, delegates subtasks to specialized subagents via the Task tool, collects their outputs, and synthesizes a final response. C The coordinator monitors subagent token usage and terminates any subagent that exceeds a predefined token budget. D The coordinator acts as a load balancer, randomly distributing requests across identical subagent instances. Tampilkan jawaban
#47
Where should the critical constraints and key findings be placed in the synthesis subagent's prompt to maximize recall?
A At the very end of the prompt, after all 40,000 tokens of research output, so the model reads them last and they are freshest in attention. B At the beginning (system prompt or start of the user message) as a clearly labeled summary, followed by the full research content. This exploits primacy — beginning placement has highest recall. C Randomly distributed throughout the research content to maximize the chances that the model encounters them. D In a separate API call before the main synthesis call, since information from previous calls is automatically carried over. Tampilkan jawaban
#48
What is the correct structure of a validation retry loop for structured output generation?
A Generate output → if invalid, restart the entire conversation from the beginning with a new system prompt. B Generate output → validate → if invalid, send specific error feedback (what failed and why) back to Claude in the same conversation → regenerate → repeat up to N times. C Generate output → if invalid, increase the model's temperature setting and try again without explaining the error. D Generate output → if invalid, use a smaller model to fix the JSON syntax, then return the fixed output. Tampilkan jawaban
#49
What is the recommended authentication approach for this remote MCP server?
A Hardcode API keys in the .mcp.json configuration file since it is only accessible to team members who have cloned the repository. B Use OAuth 2.0 or API key authentication with credentials supplied via environment variables that the MCP server reads at startup, never in the MCP configuration file itself. C Remote MCP servers cannot be authenticated; only local stdio-based servers support access control. D Authenticate using the developer's Claude account credentials, which are automatically forwarded from the Claude Code session to the MCP server. Tampilkan jawaban
#50
What is the most effective prompt engineering approach to improve scoring consistency?
A Ask Claude to use a random seed for each evaluation to normalize the distribution. B Design explicit, concrete evaluation rubrics: define what a score of 1, 2, 3, 4, and 5 looks like with specific behavioral indicators, then include these in the system prompt. C Use a higher temperature setting to explore more scoring possibilities and average the results. D Set temperature to 0 only; this will make Claude deterministic and produce identical scores every time. Tampilkan jawaban
#51
When Claude decides which tool to call from a set of available tools, what is the primary factor it uses for tool selection?
A The order in which tools are listed in the API request — Claude prefers tools listed first. B The tool's function/variable name — Claude looks for names that semantically match the task. C The tool's description field — Claude uses the description to understand the tool's purpose, appropriate use cases, and input requirements. D The tool's parameter count — Claude prefers tools with fewer parameters to minimize complexity. Tampilkan jawaban
#52
Which JSON Schema tool input definition correctly captures these requirements?
A { "type": "object", "properties": { "title": { "type": "string" }, "priority": { "type": "string" }, "due_date": { "type": "string" } } } B { "type": "object", "properties": { "title": { "type": "string" }, "priority": { "type": "string", "enum": ["low", "medium", "high"] }, "due_date": { "type": "string", "format": "date" } }, "required": ["title", "priority"] } C { "type": "object", "properties": { "title": { "type": "string", "required": true }, "priority": { "enum": ["low", "medium", "high"], "required": true }, "due_date": { "type": "string", "optional": true } } } D { "fields": ["title", "priority", "due_date"], "required": ["title", "priority"], "priority_values": ["low", "medium", "high"] } Tampilkan jawaban
#53
What is the correct mechanism for the coordinator to spawn and communicate with the search subagent in the Claude Agent SDK?
A The coordinator sends a natural language message in the conversation saying "Please search for X" and waits for the subagent to respond. B The coordinator directly calls the subagent's tools by name using the same tool-calling mechanism it uses for its own tools. C The coordinator invokes the Task tool, passing the subagent's definition and a fully specified prompt containing all necessary context for the search task. D The coordinator sends an HTTP request to the subagent's MCP endpoint with the task specification as the request body. Tampilkan jawaban
#54
A coordinator agent has conducted extensive research and built up a rich conversation history. It now needs to delegate a synthesis task to a subagent. Which statement about the subagent's access to that conversation history is correct?
A The subagent automatically inherits the coordinator's full conversation history, so no special context passing is required. B The subagent receives a read-only snapshot of the coordinator's last 10 messages by default. C Subagents do not inherit any conversation history from their parent; all necessary context must be explicitly included in the Task tool prompt. D The coordinator must first summarize its conversation into a special "context handoff" format before the subagent can access any information. Tampilkan jawaban
#55
What is the correct approach for connecting this agent to all three tool sets?
A Agents can only connect to one MCP server at a time; the teams must merge their tools into a single combined MCP server. B Configure the agent to connect to all three MCP servers simultaneously; MCP supports multiple server connections and the agent sees all tools from all connected servers as a unified tool set. C Create an API gateway that proxies requests to all three servers and present it as a single MCP server to the agent. D Connect to each server sequentially within a single session: connect to file server, complete file tasks, disconnect, connect to database server, etc. Tampilkan jawaban
#56
Which execution pattern is most appropriate for this pipeline, and why?
A Run all four subagents in parallel simultaneously, since they are independent and this minimizes total latency. B Run WebSearchAgent and DocumentAnalysisAgent in parallel (no dependencies), wait for both to complete, then run SynthesisAgent (depends on both), then ReportAgent (depends on synthesis). C Run all subagents sequentially (one at a time in order) to ensure each has access to the previous subagent's outputs. D Run SynthesisAgent first with an empty context, then fill in search and document results retroactively. Tampilkan jawaban
#57
Which Agent SDK feature is the most appropriate solution for this compliance requirement?
A Add a few-shot example to the agent's system prompt showing the agent calling the audit tool after every refund. B Use a PostToolUse hook that fires automatically after process_refund executes, calling the audit system programmatically. C Use a PreToolUse hook to intercept the refund call and perform the audit before the refund is processed. D Wrap process_refund in a new tool called process_refund_with_audit and instruct the agent to always use this tool instead. Tampilkan jawaban
#58
In a multi-agent research pipeline that processes documents and generates citations, what is "provenance preservation" and why is it critical?
A Provenance preservation means keeping copies of all original documents in the agent's context window throughout the entire pipeline. B Provenance preservation means maintaining a traceable chain linking each claim in the final output back to the specific source document and passage that supports it, through every stage of the pipeline. C Provenance preservation means using version control for all documents processed by the agent system. D Provenance preservation means ensuring the model only generates content it is confident about, discarding uncertain claims. Tampilkan jawaban
#59
Which API approach should be used for each use case?
A Real-time Messages API for both: consistency is important and the nightly job can be run with more concurrent requests to compensate for cost. B Real-time Messages API with streaming for the chatbot (for sub-second time-to-first-token); Message Batches API for the catalog job (50% cost savings with acceptable 24h SLA). C Message Batches API for both: the cost savings benefit both use cases and the 24-hour SLA is acceptable for most business applications. D Real-time Messages API for the chatbot; no API needed for the catalog job since it can be done with keyword matching rules. Tampilkan jawaban
#60
Which reliability pattern should prevent this infinite retry behavior, and how should it work?
A Add more detailed instructions to the system prompt telling the agent not to retry failed tools more than 3 times. B Implement a circuit breaker pattern in the orchestration layer: after N consecutive failures for a specific tool, open the circuit (stop calling that tool), alert operators, and route the workflow to a fallback or graceful failure path. C Implement exponential backoff: double the wait time between each retry, which will eventually space retries far enough apart that the service recovers. D Remove the send_email tool from the agent's tool set whenever it fails, preventing future calls. Tampilkan jawaban
Ingin melacak skor, mengikuti ujian simulasi berwaktu, dan mendapat penjelasan AI? Buat akun gratis