#21
Which of the following agentic loop termination strategies is considered an anti-pattern and why?
A Terminating the loop when stop_reason equals "end_turn", because this misses tool call results. B Using natural language conditions in the system prompt (e.g., "stop when you have found 3 sources") to control termination, because model compliance is not guaranteed. C Terminating the loop when no tool calls are present in the model's response, because this can cause premature termination. D Checking stop_reason on every iteration because it introduces unnecessary latency. Tampilkan jawaban
#22
What is the semantic difference between Claude Code's Write and Edit built-in tools, and when should each be used?
A Write creates files larger than 1MB; Edit handles smaller files. The choice is automatic based on file size. B Write completely overwrites a file's content (or creates a new file); Edit makes targeted modifications to specific sections of an existing file. C Write is for text files; Edit is for binary files. They cannot be used interchangeably. D Write and Edit are identical in function; the naming is a stylistic choice with no behavioral difference. Tampilkan jawaban
#23
What information is most appropriate and valuable to include in a project-level CLAUDE.md file?
A User-specific API keys, database passwords, and authentication tokens for Claude to use during code generation. B Build commands, test commands, architecture overview, coding conventions, key file locations, and team-specific patterns Claude should follow. C A complete copy of the codebase so Claude has offline access to all files without needing to use the Read or Grep tools. D A log of all previous Claude sessions and the decisions made in each session. Tampilkan jawaban
#24
What is the recommended workflow to safely execute this task with Claude Code?
A Ask Claude to make all changes immediately in direct execution mode, then review the git diff afterward. B Use plan mode first: review Claude's proposed refactoring approach and affected files, approve or modify the plan, then proceed with execution. C Break the request into 500 individual line-by-line changes and ask Claude to execute each one separately. D Run the tests first to establish a baseline, then ask Claude to make changes without using plan mode since tests will catch regressions. Tampilkan jawaban
#25
Which output format is most appropriate for downstream programmatic parsing?
A Plain narrative text (e.g., "The vendor is Acme Corp and the total is $1,500"), because it is most human-readable. B Markdown tables, because they are both human-readable and machine-parseable. C JSON, because it provides deterministic field access, type information, and native parsing support in virtually all programming languages. D XML with custom tags, because it is the most verbose and therefore most complete format. Tampilkan jawaban
#26
Claude model invocations are stateless — each API call is independent. In a multi-turn agentic workflow, how should persistent state (e.g., a running list of items found so far) be managed?
A State is automatically stored in Claude's server-side memory between API calls and retrieved using a session ID. B State must be maintained by the orchestration layer (your application code) and explicitly included in every subsequent message to the model. C State can be stored in the model's system prompt, which persists across all turns of a conversation automatically. D The model maintains internal memory for the duration of a session using a special session_state parameter in the API request. Tampilkan jawaban
#27
What is the key difference between PreToolUse and PostToolUse hooks in the Claude Agent SDK, and what is each best suited for?
A PreToolUse fires after tool execution to log results; PostToolUse fires before to validate inputs. They can both modify the tool's return value. B PreToolUse fires before tool execution and can inspect/block the call; PostToolUse fires after and can inspect/transform the result. Neither can modify the original tool call parameters. C PreToolUse is for read-only tools; PostToolUse is for tools that modify state. Using them on the wrong tool type causes runtime errors. D PreToolUse fires before tool execution and can modify parameters or block the call; PostToolUse fires after and can inspect results but cannot modify them. Tampilkan jawaban
#28
What is the most likely cause of this failure and the recommended architectural fix?
A The agent's system prompt is too short; adding more detailed instructions will prevent early termination. B The arbitrary iteration cap is cutting off the agent before task completion; replace it with stop_reason-based termination plus a timeout based on wall-clock time for safety. C The model is choosing the wrong tools; switching to a more capable model will resolve the termination issue. D The iteration count should be increased to 100, which will give the agent enough room to complete all tasks. Tampilkan jawaban
#29
What is the most likely cause of this degradation and the recommended architectural fix?
A The tools have bugs in their implementations; the fix is to test each tool independently. B Too many tools overwhelm the model's tool selection capability; reduce to 4-5 highly relevant tools per agent, and create specialized sub-agents for different tool subsets. C The tools are not being described in the correct format; reformatting them as XML instead of JSON will improve selection accuracy. D Claude requires at least 30 tools to demonstrate accurate tool selection; add more tools to cross the performance threshold. Tampilkan jawaban
#30
In a long Claude Code session with extensive conversation history, performance degrades and context limits approach. What is the recommended approach to manage this situation?
A Start a completely new Claude Code session from scratch and re-explain the entire project context. B Use /compact to intelligently summarize the conversation history while preserving key context, reducing token usage without losing important information. C Delete the CLAUDE.md file to free up context tokens, then recreate it after the session. D Switch to a model with a larger context window, which will automatically resolve the token limit issue. Tampilkan jawaban
#31
When should you use Claude Code's Plan Mode instead of direct execution mode, and what is the primary benefit?
A Plan mode should always be used for all tasks because it is safer; direct execution is only for simple tasks that cannot fail. B Plan mode is used for read-heavy research tasks; direct execution is used for all write operations. C Plan mode is used for complex or potentially destructive operations (refactoring, schema migrations, multi-file changes) so you can review and approve Claude's proposed approach before any changes are made. D Plan mode is used when Claude Code cannot access the internet; direct execution is used when online documentation access is available. Tampilkan jawaban
#32
What is the "Lost in the Middle" effect in large language models, and how does it affect content placement strategy?
A Models lose accuracy when processing content longer than 10,000 tokens; the fix is to truncate all inputs to 10,000 tokens. B Models reliably process content at the beginning and end of their context window, but tend to miss or underweight content placed in the middle. Important instructions and key data should be placed at the start or end, not buried in the middle. C Models treat all positions in the context window equally; "Lost in the Middle" is a debunked myth from earlier model generations. D The effect occurs only for numeric data; text-based content is processed uniformly regardless of position. Tampilkan jawaban
#33
What distinguishes a Claude Code Agent Skill from a simple custom slash command, and when should you use each?
A Agent Skills are defined in JSON; slash commands are defined in Markdown. Use JSON for complex workflows and Markdown for simple prompts. B Agent Skills are reusable, multi-step workflows with their own system prompts, tool access, and context that can be invoked and composed; slash commands are simple prompt shortcuts. Use Skills for complex recurring workflows, slash commands for quick single-step tasks. C There is no functional difference; Agent Skills and slash commands are two names for the same feature. D Agent Skills run in a separate subprocess with isolated file system access; slash commands run in the main session. Skills are for security-sensitive operations. Tampilkan jawaban
#34
What is the most reliable approach to guarantee Claude returns valid, schema-compliant JSON?
A Add "IMPORTANT: Always return valid JSON" to the system prompt and include a JSON example. B Define a tool named extract_invoice with a JSON Schema that specifies all required fields and their types, then force Claude to respond by calling this tool. C Use a JSON validator after Claude's response and ask Claude to fix any errors found. D Switch to a larger Claude model, which will naturally produce more reliable JSON. Tampilkan jawaban
#35
What is the correct error handling pattern for the coordinator in this situation?
A The coordinator should immediately terminate the entire pipeline and return the raw error message to the user. B The coordinator should silently ignore the error and continue with the remaining subagents, omitting the failed document from the output. C The coordinator should assess the error, attempt a recovery strategy (e.g., retry with a different tool, skip and note the gap, or escalate), and include error context in the final output. D The coordinator should restart its own conversation from the beginning with additional instructions to avoid the corrupted file. Tampilkan jawaban
#36
When designing tool results returned to Claude, when should you return plain text versus structured JSON?
A Always return plain text; Claude cannot parse JSON in tool results. B Always return structured JSON; plain text is never appropriate in tool results. C Return structured JSON when the result has multiple distinct fields the model needs to reason about individually; return plain text when the result is a simple message or status that the model only needs to read as prose. D Return plain text for all tools under 100 tokens; return JSON for results over 100 tokens. Tampilkan jawaban
#37
What is the difference between MCP Tools and MCP Resources, and when should each be used?
A MCP Tools are for read operations; MCP Resources are for write operations. The distinction enforces access control. B MCP Tools are callable functions that perform actions and can have side effects; MCP Resources are contextual data (files, documents, database records) that can be loaded into the model's context for reference. C MCP Tools are available to all clients; MCP Resources are restricted to authenticated clients only. D They are equivalent concepts; "Resource" is just the older terminology for "Tool" in the MCP specification. Tampilkan jawaban
#38
What type of attack is this and what is the primary architectural defense?
A This is a denial-of-service (DoS) attack. Defense: rate limit the number of requests from each email address. B This is a prompt injection attack via untrusted content. Defense: clearly delimit and label untrusted user content (e.g., with XML tags), instruct Claude to treat content within those tags as data not instructions, and validate outputs before sending. C This is a data extraction attack. Defense: remove all customer data from Claude's context before processing emails. D This is a model poisoning attack. Defense: fine-tune Claude on examples of legitimate customer emails to make it resistant to adversarial inputs. Tampilkan jawaban
#39
Which architectural improvement would most effectively reduce errors in the final output?
A Increase the token limit for the summary to allow Claude more space to capture all details. B Add a second Claude call that reviews the initial summary against the original document, checking for accuracy and completeness, and produces a corrected version. C Run the extraction 10 times in parallel and take the most common answer by majority vote. D Use a smaller, faster model for initial extraction and only invoke the larger model for final output. Tampilkan jawaban
#40
What is the risk of progressive summarization in long-running agentic workflows?
A Progressive summarization increases context window usage because summaries are longer than original content. B Repeated summarization introduces semantic drift — each summarization loses information, and after multiple rounds, the accumulated summaries may omit or distort key details from the original sources. C Progressive summarization is incompatible with multi-agent architectures because summaries cannot be passed between agents. D Progressive summarization only works with documents under 10,000 tokens; larger documents cannot be summarized accurately. Tampilkan jawaban
Ingin melacak skor, mengikuti ujian simulasi berwaktu, dan mendapat penjelasan AI? Buat akun gratis