Mid-level interview question
(Illustrative numbers.) Model A costs $0.004 per request and is correct 50% of the time; model B costs $0.006 and is correct 95% of the time. Which is cheaper, and what should you track?
Model answer
B. Track cost per useful answer: spend divided by answers that were on time and correct. Retrying until success takes 1 ÷ p attempts on average, so A costs $0.004 ÷ 0.5 = $0.008 per correct answer and B $0.006 ÷ 0.95 ≈ $0.0063. Lateness counts too: in lesson 1's CPU run, 83 of 120 requests met the SLO, so each on-time request cost 1.45 times the average.
Practise the rest
9 Cost per request questions, 492 in all, each with a model answer. Free.
More Cost per request interview questions
- How is an API request priced, and why is the reply often most of the bill?
- How do you turn a machine's hourly price into a cost per token, and how much can batching change it?
- You're deciding between a model API and self-hosting. How do you find the break-even, and what does the simple calculation leave out?
- How do you cut token costs at scale?
- When is a small open model good enough, rather than a frontier model?
- When do you send inference to a fast model and when to a cheap one? Walk me through the cost and latency trade-offs.