Break the spend down by feature, model, customer and input versus output tokens, because the cause is often narrow: a retry loop, an agent running too many steps, bloated prompts or a few heavy users. Fix waste first, then route simple requests to cheaper models, trim context and output length, cache repeated work and stable prompt prefixes, and move non urgent jobs to discounted batch processing. Check quality on every change.
Why interviewers ask this
Cost discipline is part of the job now, and the interviewer wants a diagnostic approach rather than a reflex to swap in the cheapest model. They listen for attribution, finding the specific driver, and understanding that long contexts and output tokens are usually the expensive parts. They also want quality protected, because a cost cut that quietly degrades answers just moves the problem somewhere else.
How to structure your answer
- Attribute the spend before changing anything.
- Look for waste such as loops, retries and oversized prompts.
- Apply structural savings: routing, trimming, caching and batching.
- Guard quality with evaluation and add cost alerts.
Example answer
I would not start by switching models. I would start by finding out where the money goes, broken down by feature, model, customer, and input versus output tokens, because cost spikes after a launch are usually narrow. On one product it was an agent that sometimes retried a failing tool call over and over, so a small share of conversations made up a large share of the bill. A step limit and a clearer error message fixed that in a day. After waste come the structural savings. Prompts had grown, with retrieved context padded out to twenty chunks when five did the job, so we trimmed that. Simple requests like classification and short rewrites moved to a smaller model, checked against the evaluation set so quality held. The long, identical system prompt was ordered so the provider's prompt caching could reuse it. Nightly summarisation moved to a batch interface at a lower price. And we added an alert on cost per request per feature, so the next spike shows up within a day rather than on the invoice.
Walking into this interview soon? GhostPilot listens to your live call, spots the question the moment it is asked, and puts a structured answer on your screen in real time. Try it on your next mock, or grab a $29 Session Pass, no subscription, for the real thing.
See how it worksFollow-up questions to expect
- How would you attribute cost to individual customers or features?
- How do you make sure a cheaper model has not hurt quality?
- Would you put per user limits in place, and how would they work?
Related ai engineer questions
Your interviewer will ask their own version of this. Paste your actual job description into the free Question Predictor and get the 20 questions that role is most likely to ask, with what each one is really probing.
Predict my questions