Safety, privacy and running in production · senior
Running an LLM feature: cost, latency and failures
In production, LLM features fail through cost, latency and wrong promises. A good response finds the cause from data, stops the damage, fixes it and adds a check so it cannot return.
Explain it out loud
Explain it out loud to an AI interviewer that follows up, and see where your answer is thin.
Practise by voiceThe notes
What you must know
- Bill tripled: break cost down by day, feature, model and token type, find the day it changed and match it to a deploy. Usual causes: bigger prompts, a collapsed cache hit rate, a route on a bigger model, more agent steps, unlimited retries, abuse or a leaked key.
- Fixes: revert the change, restore caching, cap steps and output tokens, rate-limit users, rotate leaked keys. Prevent with per-feature budgets, cost attribution and anomaly alerts.
- p95 doubled while the median did not: compare slow and fast traces span by span. Tail causes: huge prompts, retries, a slow tool, long agent paths, a provider slowdown, cold starts and pool exhaustion.
- Quick relief for latency: timeouts with a fallback model, trimming long histories, and streaming. Set latency targets and alerts.
- A bot promised a refund the policy does not allow: pull the trace, tell support and legal, add an interim guardrail, and search logs for similar promises. Honouring the promise is a business decision.
- Prevent promises: the bot never decides eligibility in free text. It calls an eligibility tool that applies rules in code and then phrases the result.
- In an interview about an LLM feature, give the problem, why an LLM, architecture, eval before launch, numbers, one real failure with its root cause and fix, and what you would change.
- Log traces, prompt versions, token counts, cost and latency for every request.
The red pen
Common traps: mistake → fix
Mistake: Cost depends only on traffic
Fix: prompt size, cache hits, model choice and steps matter as much.
Mistake: The bot's words are only text
Fix: they can bind the company; keep decisions in code.
Mistake: Postmortems are for outages only
Fix: write one for quality, cost and trust failures too.
Easy to hard
Questions interviewers ask, easy to hard
- The monthly AI bill tripled with 10 percent more traffic. Find out why.
- p95 latency doubled but the median did not. How do you investigate?
- A bot promised a refund that the policy does not allow. What do you do?
- Tell me about an LLM feature you took to production.
Practise
Practise with these questions
Explain it out loud
Explain it out loud to an AI interviewer that follows up, and see where your answer is thin.
Practise by voiceYour first interview is free
Sign up and start with a 15-minute interview with the full report, and an English conversation. No card needed.