Our Agent Takes 40 Seconds and Costs Too Much. Redesign It.
The interviewer asksAn agent that answers order-status questions takes 40 seconds and 12 model calls on average. Users are leaving. How would you redesign it?
Forward Deployed EngineerAI Product EngineerCoreSystem design roundRepresentative10–15 min
On this page
The 30-second version
- Look at the traces: what do users ask, and where do the 12 calls go?
- Order status is a known, fixed sequence: identify order → look it up → answer. That's a workflow, not an agent.
- Route: a cheap classifier sends the common cases down the workflow; rare, complex ones go to the agent.
- Make the workflow fast: one lookup, a small model to phrase the answer, stream it.
- Check with evals that answers are as good, and track latency and cost per answer.
What it's really testing
- Diagnosing from traces
- Workflow vs agent judgment
- Routing and fallbacks
- Keeping quality while cutting cost and latency
How to structure your answer
- Look at traces: questions and where the calls go.
- Choose the structure: workflow for the common case.
- Route, with the agent as a fallback.
- Speed up the main path.
- Verify quality, latency and cost.
The interview, played out
- InterviewerAn agent that answers order-status questions takes 40 seconds and 12 model calls on average. Users are leaving. How would you redesign it?
- CandidateI'd start with the traces. What are people asking, and where do the 12 calls go?
- Revealed when askedAbout 85% are "where's my order?" or "when will it arrive?". The agent spends most calls deciding which tool to use, re-reading results and summarising.
- Strong moveUses traces to find that most traffic is a fixed task.
- CandidateThen most of this doesn't need an agent. "Where's my order?" is always the same steps: identify the order, look it up, explain the status. That's a fixed workflow, written in code.
- CandidateSo: a fast router first, a small model or even rules, classifying the question. Order-status questions go down the workflow: extract the order number (or look up the customer's recent orders), one database call, then a small model writes a friendly answer from the result. That's one or two model calls, a second or two.
- InterviewerAnd the other 15%?
- CandidateThey go to the existing agent, with a step limit and a hand-off to a human if it runs out. Unusual questions are where the agent's flexibility helps.
- InterviewerHow do you know the new version is as good?
- CandidateCompare it on past questions.
- Missed signalShould specify how: a labelled set and what's measured.
- CandidateConcretely: take a few hundred past conversations with known correct answers, run both versions, and compare correctness, latency and cost per answer. Plus check the router: how often it sends a question down the wrong path.
The strong answer, distilled
- Diagnose: 85% of traffic is a fixed task; most agent calls are deliberation overhead.
- Structure: a routed design. A cheap router; a code workflow for order status (identify → one lookup → small model phrases the answer); the agent only for the rest.
- Fallbacks: the agent has a step limit and hands off to a person.
- Speed: one or two calls, a small model, streaming. Seconds instead of 40.
- Verify: a labelled set of past conversations; compare correctness, latency and cost; evaluate the router's misroutes.
This is one strong answer, not the only one.
How it's scored
| Dimension | Weak (2) | Passable (3) | Strong (5) |
|---|---|---|---|
| Diagnosis | "Use a faster model" | Some trace reading | Traffic mix and where the calls go |
| Structure | Tune the agent | Fewer steps | Workflow for the common case, agent for the rest |
| Routing | None | Mentioned | Router plus fallback, with the router evaluated |
| Verification | None | "Test it" | Labelled set; correctness, latency, cost per answer |
Round scorecard: FDE: AI system design round, filled in for the mock candidate
| Dimension | Weak | Passable | Strong | The mock candidate |
|---|---|---|---|---|
| Requirements | Assumes them. | Asks about scale. | Users, data, scale, latency, cost and risk, before drawing anything. | Strong. Looked at what users actually ask before redesigning. |
| Architecture | One component. | A reasonable flow. | Full skeleton, then depth on the parts this system depends on. | Strong. Replaced the agent with a routed workflow for the common case. |
| Quality and evals | None. | Mentions testing. | Evals per component and end to end, and how they're built. | Passable. Planned to compare answers but only after being asked how. |
| Failure and cost | Ignored. | Mentions one. | Fallbacks, guardrails, latency and cost levers, tied to requirements. | Strong. Kept the agent as a fallback for unusual questions, with a step limit. |
How the answer changes by role
| Role | What to emphasise |
|---|---|
| Forward Deployed EngineerForward Deployed Engineer. An engineer embedded with customers who scopes, builds and ships AI solutions into production. Read the full explanation | Explaining the redesign and its numbers to the customer |
| AI Product Engineer | Implementation, the router eval and monitoring |
Common mistakes
- Swapping the model and keeping the agent loop
- Removing the agent entirely and failing the unusual cases
- Not evaluating the router
- Measuring speed but not correctness
More follow-ups to practise
- "The router misclassifies 5% of questions." Hint: which direction is worse, and a confidence threshold.
- "Customers want to change delivery addresses too." Hint: an action with consequences; workflow plus confirmation.
- "How low can latency go?" Hint: database time, model size, streaming.
Go deeper
- Module: Orchestration and routing
- Framework: AI System Design Framework
- Framework: Opening Any Interview Answer
- Lesson: Workflow or agent?
- Lesson: Routing and fallbacks
- Lesson: Workflow patterns
- Also tests: AI system design
- Also tests: AI numbers: serving, cost and latency
Sources
Representative question: written to match AI system design rounds, not a specific reported interview.