Design an agent that handles refund requests for an online store.
Agents and tools · Intermediate 3
Short answer
The agent reads the request, looks up the order through read-only tools, checks it against the refund policy, and drafts a decision. Small refunds that clearly meet policy go through automatically; anything above a threshold or unclear goes to a person with the evidence. Tools are narrow, every step is logged, and I measure accuracy against past decisions before launch.
Deeper answer
Start with the policy, not the model: which refunds are automatic, which need approval, which are refused. The agent's tools should be narrow and least-privilege, for example get_order, get_delivery_status and propose_refund, with the payment action behind an approval step or a hard amount limit.
Customer messages are untrusted input, so instructions inside them must not change what the agent may do. Evaluate on a set of real past requests with known correct outcomes, track the refund amount and error rate after launch, and keep an easy route to a human for angry or complex cases.
What a strong answer covers
- Starts from the refund policy and clear rules
- Uses narrow, least-privilege tools
- Sends large or unclear cases to a human
- Treats customer text as untrusted
- Evaluates on past requests and logs every step
Answer it out loud in the mock interview about 1.5 min
Follow-ups to expect
- What threshold would you set for automatic refunds, and why?
- How would you stop a customer from talking the agent into a refund?
Common mistakes
- Giving the agent direct access to issue any refund
- Testing only on made-up requests
Learn it
- What are common failure modes of agents, and how do you guard against them?
- What kinds of memory can an agent have, and how do you implement them?
- Your agent ran overnight and ran up a large API bill. What probably happened, and what do you change?
- How would you design a harness for an agent that has to work on one task for several hours?
- What is the difference between an agent and a workflow?
- What are computer-use or browser agents good for, and what are their risks?
- What is context engineering, and why does it matter for agents?
- An agent completes a task correctly most of the time but sometimes goes badly wrong. How do you debug it?
- What makes a good tool for an agent?
- You changed your agent's harness. How do you prove the change made it better?
- What are verification gates in an agent harness, and how would you add them to a coding agent?
- How does tool calling work?
- When should an AI agent ask a human for approval before acting?
- Explain state, nodes, edges and checkpoints in LangGraph.
- What are planning and reflection in agents, and when do they help?
- Two coding agents use the same model, but one solves far more of your tasks. Why could that be, and how would you find out?
- What is an agent harness, and what is harness engineering?
- What is the Model Context Protocol, and why does it matter?
- When is a multi-agent system worth it, and what are the risks?