Agent Frameworks and MCP Basics interview questions

27 questions from the Agent Frameworks and MCP Basics course, each with the correct answer and an explanation. Try to answer before you open the answer.

The Agent Loop

1. Who actually executes a tool call?

  1. The language model itself
  2. Your application code
  3. The user's browser
  4. The GPU
Show answer

Answer: Your application code

The model only requests a call; your program runs the function and returns the result.

Lesson: What an Agent Is

2. What does the tool_use id let you do?

  1. Match each result to the request that caused it
  2. Encrypt the message
  3. Choose the model size
  4. Skip validation
Show answer

Answer: Match each result to the request that caused it

Results are paired with requests by id, which is essential with parallel tool calls.

Lesson: Tool Calling Step by Step

3. When does the loop in the example stop on success?

  1. When stop_reason is not "tool_use"
  2. After exactly one call
  3. Never
  4. When the user closes the tab
Show answer

Answer: When stop_reason is not "tool_use"

A reply that is not a tool request is the model's final answer.

Lesson: Build the Loop from Scratch

4. Why does a conversation seem to have memory?

  1. The model stores it permanently in its weights
  2. The app resends earlier messages each turn
  3. The server never restarts
  4. Browsers cache the model
Show answer

Answer: The app resends earlier messages each turn

The history is part of every request, so the model sees it again each time.

Lesson: State and Memory

The Framework Landscape

5. Which is a typical cost of adopting a framework?

  1. It makes tool calling impossible
  2. Extra abstraction and faster-changing APIs to keep up with
  3. It forbids Python
  4. It removes the need for tests
Show answer

Answer: Extra abstraction and faster-changing APIs to keep up with

Abstractions help but must be learned, and fast-moving libraries need upkeep.

Lesson: What Frameworks Give You

6. What is the main appeal of a graph-based agent framework?

  1. Explicit, controllable steps and state
  2. It needs no model
  3. It is always faster
  4. It avoids all bugs
Show answer

Answer: Explicit, controllable steps and state

Nodes, edges and state make the flow visible and easy to pause, test and resume.

Lesson: Kinds of Frameworks

7. Which project most clearly justifies starting with the raw API?

  1. A system needing pause, resume and human approvals across hours
  2. A small script that calls one or two tools
  3. A team of ten cooperating agents
  4. A product needing full tracing dashboards
Show answer

Answer: A small script that calls one or two tools

A small task does not need framework machinery, and the raw loop is easy to understand.

Lesson: Choosing: Raw API or Framework

MCP Fundamentals

8. What problem does MCP mainly reduce?

  1. Slow GPUs
  2. Writing a custom connector for every app-and-tool pair
  3. Hindi translation
  4. Database indexing
Show answer

Answer: Writing a custom connector for every app-and-tool pair

A shared protocol turns N times M integrations into N plus M.

Lesson: Why MCP Exists

9. Which role runs the tools and data access in MCP?

  1. The host
  2. The user
  3. The server
  4. The model provider's billing system
Show answer

Answer: The server

Servers expose and execute capabilities; hosts and clients connect to them.

Lesson: Host, Client and Server

10. Which MCP primitive is chosen by the user, like a slash command?

  1. Tool
  2. Resource
  3. Prompt
  4. Transport
Show answer

Answer: Prompt

Prompts are user-invoked templates; tools are model-invoked and resources are app-attached.

Lesson: Tools, Resources and Prompts

Building an MCP Server

11. Where does FastMCP get a tool's input schema from?

  1. From the function's type hints
  2. From a random guess
  3. From the filename
  4. From the operating system
Show answer

Answer: From the function's type hints

Type hints define parameter types and the docstring becomes the description.

Lesson: Your First Server and Tool

12. What does `notes://{name}` define?

  1. A tool with no inputs
  2. A resource template with a name parameter
  3. A network port
  4. A Python package
Show answer

Answer: A resource template with a name parameter

The braces make part of the URI a parameter that is passed to the function.

Lesson: Adding Resources and Prompts

13. Which transport suits a personal tool launched by your desktop app?

  1. stdio
  2. Public HTTP without authentication
  3. FTP
  4. Email
Show answer

Answer: stdio

stdio is simple and keeps the server local to the host.

Lesson: Transports: stdio and HTTP

14. Why test a server in the Inspector first?

  1. To train the model
  2. To separate server bugs from model behaviour
  3. It is required by Python
  4. To avoid writing tools
Show answer

Answer: To separate server bugs from model behaviour

If a tool works when called directly, model-related problems are easier to isolate.

Lesson: Testing with the MCP Inspector

Connecting Clients and Hosts

15. Why use absolute paths in a host config?

  1. Relative paths are illegal JSON
  2. The host may launch the process from a different working directory
  3. Absolute paths are faster
  4. The model requires it
Show answer

Answer: The host may launch the process from a different working directory

A relative path may not resolve from where the host starts the server.

Lesson: Registering a Server in a Host

16. Which MCP method returns the available tool definitions?

  1. tools/call
  2. tools/list
  3. prompts/run
  4. server/delete
Show answer

Answer: tools/list

`tools/list` discovers tools; `tools/call` executes one.

Lesson: Using MCP Tools in Your Own Agent

17. How should a host authenticate to a remote MCP server?

  1. With an OAuth-based flow and short-lived tokens
  2. By sending the user's email password
  3. By skipping authentication
  4. By hard-coding an admin key in the config
Show answer

Answer: With an OAuth-based flow and short-lived tokens

Token-based authorization lets users grant limited access that can be revoked.

Lesson: Remote Servers and Authorization

Security and Trust

18. What is the safest attitude toward a third-party MCP server?

  1. Install anything with many stars blindly
  2. Treat it like any code dependency: review, pin and limit it
  3. Run it as administrator for compatibility
  4. Disable all logging
Show answer

Answer: Treat it like any code dependency: review, pin and limit it

A server executes code with your permissions, so the usual supply-chain care applies.

Lesson: Trusting Servers

19. Which design best limits the damage from prompt injection?

  1. Telling the model "never obey web pages" and nothing else
  2. Least-privilege tools plus approval for risky actions
  3. Giving the agent every permission
  4. Hiding tool results from logs
Show answer

Answer: Least-privilege tools plus approval for risky actions

Hard limits work even if the model is fooled; wording alone does not.

Lesson: Prompt Injection Through Tool Results

20. Why split read and write into separate tools?

  1. So reads can run freely while writes need approval
  2. Two tools are always faster
  3. MCP forbids combined tools
  4. It removes the need for authentication
Show answer

Answer: So reads can run freely while writes need approval

Separate tools allow different permissions and approval rules for different risk levels.

Lesson: Least Privilege and Approvals

Quality and Operations

21. Which error message best helps the model recover?

  1. "Error"
  2. A 200-line stack trace
  3. "Unknown project key; call list_projects first"
  4. "Something went wrong"
Show answer

Answer: "Unknown project key; call list_projects first"

It names the problem and the next action, which the model can follow.

Lesson: Descriptions and Errors That Help the Model

22. Why re-run evals after editing a tool description?

  1. Descriptions affect how the model chooses and uses the tool
  2. Python requires it
  3. Descriptions are compiled
  4. It resets the server
Show answer

Answer: Descriptions affect how the model chooses and uses the tool

The description is part of the prompt the model sees, so changing it can change behaviour.

Lesson: Testing Servers and Agents

23. What must you do to arguments before logging them?

  1. Nothing, log everything
  2. Redact secrets and personal data
  3. Translate them to Hindi
  4. Encrypt the server
Show answer

Answer: Redact secrets and personal data

Logs are widely readable and long-lived, so sensitive values must not be written to them.

Lesson: Logging and Observability

Putting It Together

24. Why is `cancel_order` gated by human approval?

  1. It is a state-changing action that is hard to undo
  2. Reads are never safe
  3. MCP demands it for all tools
  4. Approval makes the model faster
Show answer

Answer: It is a state-changing action that is hard to undo

Risky, hard-to-reverse actions deserve a human checkpoint even when the model is usually right.

Lesson: Case Study: A Support Assistant

25. A stdio MCP server randomly breaks. You find a `print("debug")` in a tool. What is the likely cause?

  1. print is slow
  2. Stdout carries protocol messages, so prints corrupt the stream
  3. Python forbids print in functions
  4. The host does not support English
Show answer

Answer: Stdout carries protocol messages, so prints corrupt the stream

Use standard error or a log file for diagnostics on stdio servers.

Lesson: Revision: Cheat Sheet and Self-Check

26. Which primitive should expose a read-only company policy document?

  1. Tool
  2. Resource
  3. Transport
  4. Sampling loop
Show answer

Answer: Resource

Static reference data fits a resource that the application can attach as context.

Lesson: Revision: Cheat Sheet and Self-Check

27. Your agent can read private files and also send HTTP requests. What is the main risk?

  1. Slower responses
  2. Injected text could make it leak private data outward
  3. Higher disk usage
  4. No risk exists
Show answer

Answer: Injected text could make it leak private data outward

Combining private-data access with an exfiltration path is dangerous; separate or gate them.

Lesson: Revision: Cheat Sheet and Self-Check

← Back to the course