Agent Patterns interview question

Agentic AIAgent PatternsObservabilityCost Optimizationhard

Trace mining of 50,000 runs of a telecom billing-support agent gives the tool paths below. The team will hard-code the three most frequent paths as deterministic workflows ($0.008 per request) and keep the agent ($0.040 per run, assume the same on every path) for everything else; a classifier that routes every request costs $0.001. Assuming perfect routing, what is the new average cost per request?

Tool pathShare of runs
get_customer → get_invoice → explain_charges46%
get_customer → get_usage → explain_charges21%
get_customer → get_plan → compare_plans13%
310 other distinct paths20%
  1. AAbout $0.035 per request, roughly 14% less than today: 20% of requests run a $0.008 workflow, the other 80% stay on the $0.040 agent, and every request pays the $0.001 router.
  2. BAbout $0.009 per request, roughly 78% less than today: every request runs one of the $0.008 workflows after the $0.001 router, since the three paths can absorb the long tail.
  3. CAbout $0.015 per request, roughly 62% less than today: 80% of requests run a $0.008 workflow, the 20% long tail stays on the $0.040 agent, and every request pays the $0.001 router.
  4. DAbout $0.025 per request, roughly 38% less than today: with two serving paths, the expected cost is the mean of the $0.008 workflow cost and the $0.040 agent cost, plus the $0.001 router.
Show the answer and explanation

Correct answer: C, About $0.015 per request, roughly 62% less than today: 80% of requests run a $0.008 workflow, the 20% long tail stays on the $0.040 agent, and every request pays the $0.001 router.

Explanation Agent Patterns

Agents are for tasks whose path cannot be predicted. Traces often show that most production runs follow a few identical tool paths, and those paths can graduate into code.

The three frequent paths cover 46% + 21% + 13% = 80% of runs. Expected cost per request is the share-weighted mix plus the router, which every request pays:

ComponentCalculation$ per request
Workflows0.80 × 0.0080.0064
Agent (long tail)0.20 × 0.0400.0080
Router1.00 × 0.0010.0010
Total0.0154

That is 0.0154 / 0.040 = 38.5% of today's cost, i.e. 61.5% (about 62%) less. Latency and reliability usually improve too: a workflow makes fewer model calls, follows a fixed order and can be unit-tested.

Why the other answers are wrong:

  • $0.035 swaps the shares: it moves only 20% of traffic to workflows.
  • $0.009 forces the long tail into the nearest workflow. Those 310 paths average about 0.06% of runs each; they are exactly the open-ended cases the agent exists for, and a wrong workflow gives a wrong answer.
  • $0.025 averages the two costs without weighting them by traffic share.

Design details: give each workflow a fallback that hands the case to the agent when it meets an unexpected state, check that the frequent paths also share the same decision logic and not just the same tool names, and re-mine traces regularly as new frequent paths appear.

Interview tip: present this as a lifecycle: launch with an agent to discover the paths, then harden the frequent ones into workflows, measured with cost, latency and success per path.

Practice it as a quiz

Answer this and the other free questions with instant grading, streaks and weak-topic tracking, or unlock all 4,000 questions.

More Agentic AI questions

  1. What control flow does this LangGraph graph implement?
  2. A retail client wants to benchmark a customer-service agent that must follow a written returns policy, call order-management APIs and handle multi-turn…
  3. You are building an MCP server for a retailer's merchandising team. (1) summarize_reviews needs an LLM to condense 500 reviews, but the server must not hold…
  4. A telecom network-diagnosis orchestrator fans out to 8 sub-agents in parallel (one per system: radio network, core, billing, …) and waits for all of them…
  5. A bank's document pipeline in Google's Agent Development Kit (ADK) must always run extract → validate → summarise, in that order. It is built as an LlmAgent…