Case brief
Understand the scenario, task, and constraints.
A pilot that worked for a hundred volunteers
An internal AI assistant answers employees' questions from company documents, cites its sources and calls two read-only tools. A hundred volunteers tried it and liked it. The business now wants it rolled out to a hundred thousand employees who did not ask for it.
That sounds like the same system with more servers. It is not. Scaling a prototype a thousandfold produces a different system that happens to share a prompt. The hard constraint is that the prototype proved usefulness and nothing else. It says nothing about cost, tail latency, permissions, fairness between departments or adoption, and the model provider's uptime caps what the system can promise.
A few terms carry the case. Tail latency is the response time of the slowest requests: p95 is the time that 95% of requests beat, p99 the time that 99% beat. A token is the unit a model provider meters and bills, roughly a short word or part of one; input tokens are what we send (system prompt, retrieved documents, conversation history) and output tokens are what the model writes. A tenant is a group whose data and capacity must be kept apart; here each department is one. A gateway is a single service that every model call passes through. A 429 is the HTTP status a provider returns when a caller exceeds its rate limit. A cohort is a group of users who receive a version at the same time.
The core idea fits in one sentence: walk the thousandfold jump in tenfold steps, and fix what breaks at each before taking the next. The figure shows the three steps and what fails at each.
The answer follows that picture. It sizes the jump from licensed users down to tokens and dollars, then walks it in tenfold steps and names what breaks at each. The design puts one gateway in front of every model call for identity, per-user limits, a fair queue, metering, routing and safe caching. It rebuilds the evaluation set from production traffic instead of the demo questions. It rolls out by cohort, with a rollback that is a pointer flip: the "live" label moves back to the previous version, which is still deployed, so nothing has to be rebuilt.
What you need to design
The prompt, verbatim from the question bank: "A prototype works for 100 users. The customer now wants to deploy it to 100,000 users." Your job is to explain the jump end to end at interview depth, from what the prototype hid to a cohort rollout. Expect follow-ups on turning users into tokens and dollars, the gateway, provider failover, rebuilding the eval set, rollback, ownership, measuring adoption and a cost pivot from Finance.
The case is written for engineers preparing for Forward Deployed, solutions or applied-AI engineering interviews, especially a round that asks what changes between a demo and production, or how to roll an AI tool out across a large company. It assumes comfort with LLM (large language model) APIs and token pricing, retrieval with permissions, and basic reliability and rollout practice.
There is no published worked design for this prompt. The source has talking points: the prompt, a list of seventeen items to cover and one adoption follow-up. The design here is assembled from those and from neighbouring material, listed below. Every number is a stated assumption for the whiteboard, not a measurement.
Where each part of the answer comes from.
| Source | What it contributes here |
|---|---|
| A problem-decomposition interview prompt | The prompt, the seventeen items to cover, the adoption follow-up and its nine answers, reproduced verbatim in step 1, the seventeen-item check and step 10 |
| A neighbouring prompt, "AI Migration from Prototype to Production" | The notebook variant of the same question, in step 2 |
| Cost & Latency cram sheets and additions | Why demos die in production, Little's Law, prices, rate limits and the batch discount (steps 2 and 4, the gateway and the cost pivot) |
| Production and operations tutorial | Retries, breakers, fallback, degradation, budgets and the 99.9% answer (the gateway and failover deep dives) |
| Notes on prompt versioning and rollback, and on delivery gates and metrics | Shadow, canary, pointer-flip rollback, override rate and week-4 retention (step 8 and step 10) |
| Notes on identity, secrets and tenant fairness | Identity and fair queuing in the gateway deep dive |
| The Secure Multi-Tenant AI Platform, Evaluation and Release Gating, Observability and Production Diagnosis, Consumer-Scale Chat Service, LLM Inference Serving and Production LLM Gateway cases | Cross-linked by section instead of re-explained |
Work through the walkthrough in order. Before you read step 5, write down what you expect to break at each tenfold step, then compare. Rehearse the 45-minute plan aloud with a timer. Mark each section as read when you finish it, and come back to the level calibration and the Quick review the night before the interview.
Next: build the answer in interview order.
Start the walkthroughDesign walkthrough
Follow the reasoning from discovery to delivery.
1. Ask what "successful" meant before scaling it
"Works" is the word to attack first. A prototype is usually judged on a demo and a few enthusiastic users. That evidence says the idea is valuable. It says nothing about cost, tail latency, abuse, or the users who never volunteered. The question bank's own list of biggest mistakes includes "Treating a prototype as a production system."
So ask before sizing anything. Each question below has an assumed answer we carry through the rest of the case, and each answer decides part of the design.
Discovery questions, the assumed answers and what each decides.
| Question | Assumed answer | What it decides |
|---|---|---|
| What does the prototype do? | An internal assistant: answers from company documents and calls two read-only tools | RAG plus light tool use, not a free-form agent |
| Who are the 100,000? | Employees of one enterprise, across departments and three regions | SSO, departments as tenants, residency questions |
| How was "success" measured? | Thumbs-up rate and a manager's impression from 100 volunteers | No real eval set exists yet; build one |
| What must stay true at scale? | Answers cite sources; no user sees a document they cannot open | Permission-aware retrieval is a gate, not a feature |
| What latency is acceptable? | First token under 2 s at p95; full answer under 10 s | Streaming, queueing and routing budgets |
| Is there a budget? | Yes, but nobody has priced it yet | The sizing in step 4 is part of the answer |
| When, and how fast? | Company-wide within a quarter | A staged rollout by cohort, not a launch day |
Two answers reshape the design more than the rest. "Thumbs-up from 100 volunteers" means there is no evaluation set to trust, so building one becomes work in the plan. "No user sees a document they cannot open" turns permission filtering from a nice-to-have into a release gate: a single failure blocks the release.
The weak answer draws autoscaling and a load balancer. It treats the jump as a compute problem. The strong answer says three things in the first two minutes: the evidence of success does not transfer, the bill scales with request shape rather than with users, and adoption is a deliverable. Request shape means how many tokens each request carries and how many model calls it triggers, which can grow even when the user count does not.
A spoken version of that opening, from the source:
"A hundred volunteers proved the idea is useful. A hundred thousand employees will test everything the volunteers forgave: cost, the slow tail, permissions, abuse and whether anyone changes how they work."
3. State requirements as testable constraints
A requirement that cannot fail a test is a wish. "Scalable" is a wish. "Sustains 20 requests a second at p95 first-token under 2 s" is a constraint, because a load test can fail it.
The functional core does not change from the prototype: answer questions from company documents with citations, call the two read-only tools, and keep a short conversation history. What changes is everything around that core: identity, limits, fairness, failure handling, evaluation, rollout and support. The table states each new property so that a test can fail it.
Production requirements stated as tests.
| Constraint | Stated so it can be tested |
|---|---|
| Throughput | 20 requests/s sustained at peak, 40 requests/s burst for 10 minutes |
| Latency | First token under 2 s p95; full answer under 10 s p95; measured per stage |
| Availability | 99.9% for the assistant's own service; a provider outage degrades, never errors |
| Isolation | Zero answers citing a document the user cannot open, tested before every release |
| Fairness | One department's burst cannot raise another's p95 by more than 20% |
| Cost | Cost per daily active user tracked by department; monthly spend within the approved budget ±10% |
| Quality | No regression against the production-derived eval set on any intent slice |
| Operability | Every page has a runbook; rollback in under 5 minutes without a redeploy |
| Adoption | Week-4 retention and task success reported per department cohort |
A few rows deserve a sentence each. Latency is measured per stage because streaming can hide a slow full answer behind a fast first token. Availability is stated for the assistant's own service only, since the provider's uptime is outside our control; the failover deep dive explains what to promise instead. Fairness is testable by replaying one department's burst while measuring another department's p95. These are case bars to agree with the customer; the prototype established none of them.
Every new constraint needs an owner in the architecture, meaning a component whose job is to keep it true.
The component that keeps each constraint true.
| Constraint | Primary component(s) |
|---|---|
| Throughput and latency | Gateway queue, model router, streaming, provider capacity |
| Availability | Retry, circuit breaker, fallback provider, graceful degradation |
| Isolation | SSO at the gateway, permission filter in retrieval, scoped cache keys |
| Fairness | Per-user token buckets, weighted fair queue per department |
| Cost | Budget meter before the call, routing, caching, batch path |
| Quality | Eval gate in CI, sampled online evaluation |
| Operability | Prompt registry with a live pointer, runbooks, on-call |
| Adoption | Cohort waves with onboarding, department champions, per-cohort usage and retention metrics |
Adoption is the one constraint kept true by people and process rather than a box on the diagram: cohort rollout in step 8, a named owner in step 9 and per-cohort measurement in step 10.
4. Size the thousandfold jump from users down to tokens
Say the arithmetic aloud. It turns "scale" into three numbers the customer must approve: requests per second, tokens per minute and dollars per month. Every figure below is an assumption; the method is what gets scored.
From licensed users to requests, tokens and concurrency.
| Step | Assumption | Result |
|---|---|---|
| Licensed users | 100,000 | (starting point) |
| Daily active share | 30% once adoption settles | 30,000 daily active users |
| Requests per active user | 8 a day | 240,000 requests a day |
| Business-hours concentration | 80% of traffic in 8 hours | ≈ 6.7 requests/s during working hours |
| Peak | 3× the working-hours average | ≈ 20 requests/s |
| Input per request | 6,000 tokens: 1,500 system and tools, 3,500 retrieved, 1,000 history | 1.44B input tokens a day |
| Output per request | 500 tokens | 120M output tokens a day |
| Concurrency | Little's Law: 20/s × 5 s average | ≈ 100 requests in flight at peak |
| Peak token rate | 20/s × 6,500 tokens | ≈ 130,000 tokens/s ≈ 7.8M tokens/minute |
Follow the chain once. 30% of 100,000 licensed users are active on a given day, so 30,000 people send 8 requests each: 240,000 a day. 80% of those, 192,000, arrive in 8 working hours (28,800 seconds), about 6.7 a second. Traffic is lumpy inside those hours, so a 3× peak gives about 20 a second. Each request carries 6,000 input tokens, so the day uses 240,000 × 6,000 = 1.44 billion input tokens and 240,000 × 500 = 120 million output tokens. At peak, 20 requests a second × 6,500 tokens is 130,000 tokens a second, about 7.8 million a minute.
Little's Law, from the cost additions, says concurrency = throughput × latency. At 20 requests a second, each taking 5 seconds on average, about 100 requests are in flight at once, and each holds a connection, a queue slot and a share of the provider's limits. The law turns latency work into capacity work: halving average latency halves the in-flight slots to provision.
Now price it. On the source's September 2026 prices, the naive design (every request on one mid-tier model) costs about $4,080 a day, roughly $122,000 a month, against about $400 a month for the pilot. Two things follow. First, the bill went up about 300 times, not 1,000 times, because only 30% of licensed users are active. Adoption is a cost variable. Second, three cheap levers (routing 70% of requests to a smaller model, caching the stable prompt prefix, and capping output length) cut the naive bill by nearly half, to about $67,000, without touching quality on the hard 30% that still goes to the mid-tier model. The cost deep dive works each row and its caveats. Prices change constantly, so in the interview state the mechanism and say "I'd check current pricing" for the digits.
The cost additions give a rule of thumb that a real agent request can become 5–20 sub-requests: planning, tool calls, retries and checks each call the model. This assistant makes few calls per question today. If the tools grow into an agent, multiply the call count before trusting any of this.
Then check the provider. 7.8 million tokens a minute at peak must fit the account's tokens-per-minute and requests-per-minute limits, split by model after routing, because each model has its own limit. Anthropic meters input and output tokens per minute separately, and tokens read from the prompt cache do not count toward the input limit. At peak, 20 requests a second is 1,200 a minute. The 840 small-model requests carry 6,000 uncached input tokens each, about 5.0M input tokens a minute, because Haiku 4.5 will not cache the 1,500-token prefix. The 360 mid-tier requests carry 4,500 uncached tokens each once the prefix is cached, about 1.6M. Output is about 600,000 tokens a minute across both. Anthropic's published Scale tier gives each of these models 10M input and 2M output tokens a minute, and a $200,000 monthly spend cap that covers even the naive $122,000. Plan for twice the peak, because retries during an incident and the Monday spike stack on each other; at twice the peak the small model needs about 10.1M input tokens a minute, just over the published limit, so the account needs custom limits. A sudden jump can also return 429s below those limits, because the provider caps how fast per-minute usage may grow, which is one more reason to ramp traffic through cohort waves. That headroom is a procurement conversation with the provider, and it starts weeks before launch.
5. Walk each tenfold step and name what breaks
Scale in tenfold steps, because each step breaks something different. A plan that jumps from 100 to 100,000 finds all of them on the same morning. The table reads left to right: what breaks first, the first signal that shows it, and the fix to have in place before taking the next step.
What each tenfold step breaks, how it shows and what to fix first.
| Step | What breaks first | First signal | Fix before the next step |
|---|---|---|---|
| 100 → 1,000 | Shared API key and no per-user identity; the demo eval set; prompt edited live; support is one engineer's inbox | Complaints reach the builder directly; answers wrong on documents the demo never touched | SSO and per-user identity; versioned prompts; structured logs and traces; first eval set from real logs |
| 1,000 → 10,000 | Provider 429s at peak; the bill becomes visible; queueing inflates p95; retrieval exposes documents across departments | 429 rate; invoice; p95 rising while p50 stays flat; a permissions complaint | Gateway with rate limits, retry, breaker and fallback; permission-filtered retrieval; routing and caching; budgets per department |
| 10,000 → 100,000 | Department bursts starve each other; provider capacity; multi-region and residency; eval cost; incident blast radius; adoption stalls | One department's p95 degrades during another's peak; eval bill spikes; week-4 retention flat | Weighted fair queue; capacity commitment and a warm fallback; sampled online eval; on-call and runbooks; cohort rollout with change management |
One signal in the middle row is worth learning to read. When p95 rises while p50 (the median) stays flat, most requests are as fast as before and a growing minority is waiting. That pattern points to queueing behind a limit, not to a slower model.
The source expects the prototype's weaknesses to show up in roughly this order: identity first, capacity second, fairness and organisation last. The fix for each step is cheap before that step and expensive during it. Treat the user counts as a planning device rather than exact triggers; a heavy department can hit the capacity problems at 5,000 users. Cohort rollout (step 8) is what lets each step happen on purpose.
6. Draw the architecture end to end
The organising rule is admit, assemble, answer, learn. Each verb belongs to a part of the system that makes one decision.
- Admit. The gateway decides who may use a model and how much.
- Assemble. Retrieval decides what the answer may see.
- Answer. The model path decides what it costs and how it fails.
- Learn. The control plane decides what changes reach users, and on what evidence.
The first figure is the interactive answer path, top to bottom. A request arrives over SSE (server-sent events, a one-way stream from server to browser that lets the answer appear as it is written) and passes the gateway's checks before the orchestrator assembles context.
The second figure shows the two paths that never make a user wait. The async lane takes reports, summaries and reindexing through a queue to workers and the provider's batch API. Ingestion parses sources, chunks and embeds them, and writes them to the index with ACL metadata, so the permission filter has something to filter on.
Two pieces sit across both paths and are not drawn as boxes in those figures. The control plane versions the prompt registry and its live pointer, routing rules, department quotas, the CI evaluation gate, budgets, anomaly alerts and cohort flags. Observability traces each request's tokens, cost, stage timings and outcome.
The same flow, drawn a second way, groups the components into four planes: control plane, gateway, answer path and async lane.
Follow one request through it. This example is illustrative. A finance analyst asks, "What is the limit for client dinners in the travel policy?" The gateway validates her SSO token, checks her token bucket and department budget, and the input guard screens the text. The fair queue places the request by her department's weight. The orchestrator assembles the frozen system prompt first (so the provider's prefix cache can reuse it), then retrieval returns only policy chunks her groups may open. The cache misses, so the router classifies the question as an easy lookup and sends it to the small model, inside retry and a breaker. The output check confirms a citation is present and no personal data leaks, and the answer streams back. The trace records tokens, cost, stage timings, the model that answered and the outcome.
The table lists the same components in request order. The right-hand column matters most: each component has a defined way to fail.
Components in request order, with each one's responsibility and failure behaviour.
| # | Component | Responsibility | Fails how |
|---|---|---|---|
| 01 | Client | Streams the answer, shows citations | Degrades: shows a labelled partial or degraded answer |
| 02 | Gateway | SSO token validation, per-user token bucket, budget meter | Closed on auth; sheds the async lane first under load |
| 03 | Input guard | Rule-based screen first, model-based screen second | Closed for known attacks; logs and allows on timeout for low-risk intents |
| 04 | Fair queue | Orders admitted work by department weight | Never drops an admitted request silently |
| 05 | Orchestrator | Assembles context in a prefix-stable order, calls tools under a step cap | Degrades: answer without the tool, say so |
| 06 | Retrieval | Filters by the user's permissions before vector search | Closed: no filter, no results |
| 07 | Cache | Serves repeated safe answers; key carries prompt version, model and permission scope | Degrades to a miss; never serves across scopes |
| 08 | Model router | Sends easy intents to the small model | Degrades to the mid-tier model |
| 09 | Primary provider | Answers under retry-with-backoff inside a breaker | Breaker opens; traffic moves to the fallback |
| 10 | Fallback provider | Warm second provider or region with its own validated prompt | Degrades to a labelled "try again shortly" answer |
| 11 | Output check | PII scan, citation presence | Closed: withholds the answer and says why |
| 12 | Async lane | Non-interactive work through a queue and the batch API | Delays; users see job status |
| 13 | Ingestion | Incremental indexing with ACL metadata | Stale but safe; freshness alert |
| 14 | Observability | One trace per request with tokens, cost, stages and outcome | Degrades: request still served, gap logged |
| 15 | Control plane | Versioned prompts, routing, quotas, flags, eval gate | Changes blocked until the gate passes |
"Closed" means the component refuses when it cannot do its check; "degrades" means it serves a reduced but labelled result. The pattern is deliberate. Anything guarding identity, permissions or personal data fails closed, and anything guarding speed or convenience degrades.
Point at three boundaries while the diagram is up. The admission boundary is the gateway: nothing reaches a model without identity, a quota and a budget check. The isolation boundary is retrieval and the cache key: both carry the user's permission scope. The change boundary is the control plane: a prompt edit is a release with a gate, never a hot edit. The gateway deep dive and the failover deep dive explain the admission and model-path mechanisms in detail.
7. Rebuild the eval set from production, not the demo
The prototype's eval set, if it exists, is the demo questions. It measures what already worked on the questions the builder thought to ask. That is survivorship, not evaluation: the set contains only the cases that survived the builder's own selection. The Evaluation and Release Gating case designs the full release gate; this step names what the scale-up changes.
Build the new set from the first cohorts' real traffic. Sample by intent and by department, because 100,000 users ask questions the 100 never did. Label with the customer's subject-matter experts, not the builder, since only they know whether a policy answer is right. Add adversarial cases for permissions and prompt injection, and hold that security slice at zero failures. The source's phrase for the safety gate is "A hard block, not a review comment."
Gate on slices, not on the aggregate. A slice is one subset of the eval set, such as one department's questions of one intent. Section 8 of the Evaluation and Release Gating case makes the point: an average can rise while one department's intent collapses. Report each slice against a named baseline, which is the version currently serving.
Keep evaluating after launch. Run a sampled online evaluation on live traffic, and read the user signals beside it: thumbs, regenerates and escalations. The cost additions warn about the new bill: LLM-as-judge (using a model to grade answers) is inference too, and at 240,000 requests a day it is not free. Stratify the sample so small slices are still covered, use a cheaper judge with a periodic strong-judge audit, and cache judge calls on unchanged question-and-answer pairs. Section 14 of the Evaluation and Release Gating case has the full cost card.
8. Roll out by cohort with a pointer-flip rollback
Never launch to 100,000 people on one day. Roll out by cohort, so each tenfold step in step 5 happens on purpose, to a group that can be supported. Use shadow, canary and promote, and know the risk each puts on a real user: shadow puts none, because users never see the new version; canary puts it on a small slice. The source adds cohort waves between canary and promote.
Release stages and the gate to leave each. Shadow and canary are quoted from the source's release notes; the cohort-wave row is the source author's addition for this design.
| Stage | What happens | Gate to move on |
|---|---|---|
| Shadow | "The new version runs alongside the live one on real traffic; both outputs are logged; compared offline" | Eval gate passed; zero isolation failures in shadow |
| Canary | A small slice of real users sees it; "the same metrics are watched live" | p95, error rate and cost per request within limits for 48 hours |
| Cohort waves | In this design, 1% → 10% → 50% → 100%, one department wave at a time | Each wave: support tickets per 1,000 users, week-1 retention, no open severity-1 incidents |
| Promote | Repoint the live pointer | Executive sponsor signs on the success metrics |
The cohort-wave gate uses adoption and support signals, not just system metrics. A wave that keeps p95 green but floods the helpdesk is not ready for the next wave.
Split cohorts per user, never per request. One person's experience must not flicker between versions mid-conversation, which happens if each request is assigned independently. Hold the safety gate identical across arms, so the new version cannot pass a looser security check than the old.
Make rollback a pointer flip. The source's rule: "If rollback requires a build, it is not a rollback; it is a hot-fix under pressure." The version that was live five minutes ago stays deployed, ready to take traffic, and rollback moves the live pointer back to it. That is how the operability requirement of rollback in under 5 minutes is met. Test the rollback before the first wave, and make rollback_tested a gate that blocks limited production.
9. Assign owners before the first page
At 100 users, the builder is the owner, the on-call and the support desk. At 100,000, that arrangement is the single point of failure. Name the owners before the first cohort, not after the first incident.
Who owns each area and what they own.
| Area | Owner | What it owns |
|---|---|---|
| Platform and gateway | AI platform team | SLOs, capacity, provider relationships, on-call |
| Product behaviour | Product owner | Prompts, intents, routing policy, release decisions |
| Knowledge content | Department content owners | Source freshness, document permissions |
| Security review | Security team | The review gate, red-team results, incident response for leaks |
| Budget | Finance partner plus product owner | Department budgets, anomaly thresholds |
| Support | IT helpdesk (L1), app team (L2), platform (L3) | Tickets, known issues, escalation |
| Adoption | Product owner, with the executive sponsor and department champions | Cohort onboarding, the adoption metrics in step 10, the stalled-adoption investigation |
The support row is a ladder: the helpdesk takes first contact (L1), the application team handles behaviour problems (L2), and the platform team handles serving problems (L3). The builder's inbox is no longer on it.
Write runbooks for the incidents that will happen. The cost cram sheet lists fifteen, and four matter from week one.
- Cost 5× after rollout. The sheet's diagnosis: "The increase is likely from request shape, not just user count." Look at tokens per request, retries and call counts before blaming headcount.
- Latency 2 s to 20 s after a deploy. Roll back the prompt or reranker, and activate the fallback provider.
- One tenant over-using. The sheet's instruction is to "distinguish healthy adoption from runaway automation": a department that adopted the tool is good news; a script calling it in a loop is not.
- Cache hit rate dropping. Look for a silent prefix invalidator, such as a timestamp or user name inserted at the top of the prompt, which makes every request's prefix different.
Add a fifth for a permissions leak, owned by security.
Run the security review against evidence, not a checkbox. A gate can be structurally real and still accept free text as evidence, so a reviewer ends up approving a sentence that says "tested". Require adversarial testing and permission-boundary probes as listed artefacts before the review passes.
10. Measure adoption, not only uptime
A system can be technically ready and still fail, because nobody uses it. Adoption is the last item on the bank's list, and it is where the follow-up goes.
Measure adoption with numbers that cannot be faked by a launch email. Start with two.
- The override rate, how often a person who reviews an answer before acting on it edits, rejects or corrects it. A rate that falls over time means trust is being earned; a flat rate means the assistant is not ready for less supervision.
- Week-4 retention: "Whether the thing deployed is still the thing being used a month later."
The assistant's tools are read-only, so there is no action to approve; the override is a person changing or discarding an answer before using it. Measure it in the workflows where answers are reviewed, and read a falling rate beside outcome audits, since reviewers can also stop checking.
Add active users as a share of licensed users, task success by intent, and cost per successful task. The cost additions insist on the last one: a cheaper model that needs a retry or a human correction is not cheaper.
The bank's follow-up, verbatim: "The system is technically ready but users are not adopting it. What do you investigate?" Its answer list, verbatim: whether the problem is important enough, workflow fit, user trust, response quality, latency, training and onboarding, incentives, integration friction, and whether the product solves the user's actual pain point.
Nine causes in a flat list are hard to act on, so order them into an investigation.
- Start with data, not opinions. Segment usage by department and intent, and find where users try once and stop.
- Read those sessions. A drop after the first answer points to quality or trust. A drop before any answer points to latency or onboarding. Low first use points to workflow fit and integration friction: the assistant lives in a separate tab while the work lives in another tool.
- Only then talk to users, and ask about their pain rather than the product. That is where importance, incentives and the actual pain point come out.
The cost cram sheet's executive table says adoption depends on "Perceived latency, workflow fit, reliability, explainability." Each of those maps to a part of the design: streaming, integration, failover and citations.
A spoken version of the stance, from the source:
"Adoption is a deliverable. I would measure it per cohort, and treat a flat week-4 retention as a bug with a root cause, not a marketing problem."
Technical deep dives
Examine mechanisms, alternatives, and operational consequences.
Admit, queue and route at one gateway
Put every model call behind one gateway. The prototype's direct calls leave no single place to enforce identity, limits, fairness or cost, so each rule would have to be repeated in every caller. The Production LLM Gateway case designs that gateway in depth, in its sections 5 to 10. This section names only what the scale-up adds.
Identity first
Authorisation logic assumes identity is already established. Validate the customer's own SSO token, map their groups to internal roles, and derive the user's permission scope once per request. The prototype's shared key cannot tell 100,000 people apart, so it cannot enforce a single rule about them.
Limits and fairness are two mechanisms
In one line, a rate limit answers "may this request proceed at all?"; a fair queue answers "in what order do requests get served under load?"
Give each user a token bucket sized in tokens, not only requests. A token bucket holds a budget that refills at a fixed rate; each request spends from it, and a request that would overdraw it waits or is refused. Sizing it in LLM tokens matters because one request with a 50-page upload can cost as much as fifty short questions.
Feed admitted work into a weighted fair queue per department. Instead of first come, first served, the queue serves departments in proportion to their weights, so a department with a burst gets its share but cannot take everyone's. Illustratively, if Finance submits 500 requests in a minute at quarter-end while HR submits 20, a single queue would make HR wait behind all 500; the fair queue keeps serving HR's 20 at their share while Finance's burst waits for its own. Section 7 of the Secure Multi-Tenant AI Platform case has the full argument.
Meter before the call
The production guide's rule: "The cap has to fire before the API call, not after — checking cost post-hoc only tells you what you already spent." Estimate the request's tokens, check the user's and department's budget, and only then call the provider. Output is unknown before the call, so reserve the input estimate plus the request's output ceiling, then settle the reservation against the usage the response reports. Without the settle step, every bucket drifts by the gap between the ceiling and the real output. Use a real tokeniser for the estimate; the guide shows a word-count heuristic underestimating token counts and letting expensive requests through.
Route by intent
The production guide calls routing "The single biggest cost lever in a production LLM system." A router classifies each request and sends easy intents, such as a policy lookup, to the small model. Pick the routing threshold from a labelled sample of real traffic, not intuition, and measure the misroute rate against the cost saved.
The cost additions add a warning. Prompt caches are scoped to a model, so a three-model cascade means three cold prefixes, each paying full input price until it warms. Measure one strong model at lower effort before building a cascade; it may be cheaper overall once caching is counted.
Cache what is safe
The cram sheet's rule: caching is acceptable only when the key includes tenant and permission boundaries and invalidation respects document and access changes. Otherwise a cached answer built from a document one user may see is served to another who may not.
For this case, the cheapest win is the provider's prefix cache on the frozen system prompt and tool list. It stores no answer, only the provider's processing of an identical prompt start, so it cannot leak content between users. The answer cache comes second and carries the user's permission scope, prompt version and model in its key.
Stream, and move slow work off the critical path
Streaming buys perceived latency, not real latency: the first words arrive sooner, but the full answer takes as long. Report generation and document summaries do not need a waiting user. Send them through a queue to the batch API, which the cost additions put at 50% of standard cost. Workers scale by queue depth, as the cram sheet's infrastructure section says, not by CPU, because the workers spend their time waiting on the provider rather than computing.
Fail over before the provider fails the users
At 100 users, a provider outage is an anecdote. At 100,000, it is an incident with a headcount.
The production guide gives the chain in order. Retry with backoff handles a single failed call by waiting and trying again. On a 429, wait at least as long as the provider's retry-after header says when one is sent. A 429 for a reached monthly spend cap carries no retry-after and will not clear with retries, so send it to an alert, not the retry loop. A circuit breaker wraps the retried call: after enough failures it "opens" and stops sending traffic to the dependency for a while, so retries do not pile onto a provider that is already down. A fallback provider takes the traffic while the breaker is open. Graceful degradation is the floor when all of that fails. The guide's one-liner: "Retries handle one bad call; a circuit breaker handles a bad dependency — you want both, with the breaker wrapping the retried call."
Set the reliability target honestly. The guide's FDE (Forward Deployed Engineer) track answers the "99.9% uptime" request directly: "Separate your infra's uptime from the upstream provider's — you can't promise more than your dependency provides, and fallback/circuit-breaker design is how you buy margin, not a guarantee." Say that sentence to the customer before the contract says something else. One limit is worth adding: a fallback buys nothing against a dependency both paths share, such as the customer's SSO, so name those dependencies in the agreement too.
Keep the fallback warm and validated. A fallback provider that has never served real traffic fails at the worst moment. The guide's agent track names the trap: tool schemas and structured-output contracts are not portable across models, so the fallback path needs its own prompt and its own eval run. Route a small, steady share of traffic to it so its latency and quality stay measured. Tag every response with the model that answered, because cost and quality shift silently when traffic moves.
Degrade in front of people and fail loudly in front of machines. That is the guide's own trade-off line. The assistant shows a person a labelled degraded answer, which they can judge. The async lane stops and alerts rather than writing a half-finished report that a downstream process would trust.
Price the sizing and cut the bill
The cost additions list the tiers the source uses: Claude Sonnet 5 at $2.00 input and $10.00 output per million tokens, and Claude Haiku 4.5 at $1.00 and $5.00, checked in September 2026 on Anthropic's pricing page. These are source-reported inputs for the worked example, not current offers; recheck prices, cache minimums and routing quality before procurement.
The source's cost scenarios, each row adding one lever to the row above.
| Scenario | Daily cost | Monthly |
|---|---|---|
| Prototype: 100 users × 8 requests, one mid-tier model | ≈ $14 | ≈ $400 |
| Naive scale: 240,000 requests on one mid-tier model | $2,880 input + $1,200 output = $4,080 | ≈ $122,000 |
| + route 70% of requests to the small model | ≈ $2,650 | ≈ $80,000 |
| + cache the 1,500-token stable prefix (read price 10% of input; only the mid-tier 30% benefits, because Haiku 4.5 will not cache a prompt under 4,096 tokens) | ≈ $2,460 | ≈ $74,000 |
| + cap average output at 350 tokens | ≈ $2,220 | ≈ $67,000 |
Work each row once so you can rebuild it on a whiteboard.
- Prototype. One mid-tier request costs 6,000 × $2/M + 500 × $10/M = $0.012 + $0.005 = $0.017. 800 requests a day is about $14, about $400 a month.
- Naive scale. 1.44 billion input tokens × $2/M = $2,880, plus 120 million output tokens × $10/M = $1,200: $4,080 a day, about $122,000 over 30 days. That is about 300 times the pilot, not 1,000, because only 30% of licensed users are active.
- Routing. A small-model request costs 6,000 × $1/M + 500 × $5/M = $0.0085, half the mid-tier price. The worked figures use one token count for both models, but counts depend on the tokenizer: Anthropic says Claude 4.7 and later models produce about 30% more tokens for the same text than earlier ones such as Haiku 4.5, so measure each model's real counts before trusting the split. With 70% on the small model, the average is 0.7 × $0.0085 + 0.3 × $0.017 ≈ $0.011, about $2,650 a day.
- Prefix caching. Cached input tokens are read at 10% of the input price. The source's caching references give minimum cacheable lengths of 1,024 tokens for Sonnet 5 and 4,096 for Haiku 4.5, so the 1,500-token prefix caches only on the mid-tier model. Each of the 72,000 mid-tier requests that reads the cache saves 1,500 × $2/M × 0.9 = $0.0027. Writing the entry costs 1.25 times the input price, $0.00375 for the 1,500 tokens, and the entry lives five minutes, refreshed on each read. The prefix is identical for every user and mid-tier traffic runs at several requests a second in working hours, so the entry stays warm and is rewritten at most once per five-minute gap: no more than 288 writes a day, under $1.10 a day including the write premium. Net saving: about $193 a day, giving about $2,460.
- Output cap. Cutting average output from 500 to 350 tokens saves 150 output tokens per request. Lower the average through the prompt and answer format; the output ceiling only truncates, cutting an answer mid-sentence, so set it above the target and watch how often answers stop at it. The saving is about $126 a day on the small model and $108 on the mid-tier model, giving about $2,220, or $67,000 a month.
The last row is about 55% of the naive bill, which is the "nearly half" saving. One assumption sits inside the arithmetic and is worth saying aloud. The routing row assumes the small model answers its 70% well enough; if misroutes cause retries or human corrections, cost per successful task rises even while the invoice falls. These are approximate scenarios, and the real savings depend on measured cache hits and quality-preserving routing.
The cost pivot that follows this section in an interview is worked in Practice.
Failure modes and the seventeen-item check
The prompt lists seventeen things to cover. Check the answer against them, in the order given. The table maps each item to the part of this casebook that teaches it.
The bank's seventeen items and where this casebook covers each.
| Item (verbatim) | Where this casebook covers it |
|---|---|
| Traffic and capacity modelling | Step 4, sizing |
| Multi-tenancy | Step 1 and the gateway: departments as tenants, permission scope |
| Rate limits | Step 4 and the gateway: provider limits and per-user buckets |
| Queuing | The gateway: fair queue per department |
| Caching | The gateway: prefix cache first, scoped answer cache second |
| Model routing | Step 4 and the gateway |
| Batch processing | The gateway: async lane and the batch API |
| Streaming | The gateway |
| Cost controls | Step 4, the gateway, the cost deep dive and the cost pivot |
| Autoscaling | The gateway: workers by queue depth |
| Observability | Step 6 and step 9; the Observability and Production Diagnosis case for the full design |
| Reliability targets | Step 3 and the failover deep dive |
| Rollbacks | Step 8 |
| Security review | Step 9 |
| Support model | Step 9 |
| Change management | Step 8 and step 10: cohort waves, onboarding, champions |
| Adoption measurement | Step 10 |
The change-management row names champions, people in each department who help colleagues adopt the tool; the source lists them here without a fuller treatment.
Then volunteer failure modes before the interviewer asks, each with the signal that catches it. A failure with no signal is one you learn about from a user.
Failure modes worth volunteering, the signal that catches each, and the mitigation.
| Failure | Signal | Mitigation |
|---|---|---|
| Bill grows faster than users | Cost per active user rising | Request-shape breakdown; routing, prefix cache, output cap |
| Monday-morning 429 storm | Provider 429 rate at peak | Capacity commitment, jittered retry, fallback, shed async lane |
| Department A's burst slows department B | Per-department p95 divergence | Weighted fair queue |
| Answer cites a forbidden document | Isolation test failure; user report | Filter before search; scope in cache key; release gate at zero |
| Prompt edit silently regresses quality | Slice score drop on the online sample | Prompt registry, eval gate, pointer-flip rollback |
| Fallback fails when needed | Fallback error rate on first real use | Keep it warm with a steady traffic share and its own eval |
| Eval bill triples | Judge spend per release | Stratified sample, cheaper judge with audits, cached judge calls |
| Launch succeeds, usage decays | Flat week-4 retention | Step 10's investigation, per cohort |
Jittered retry, in the second row, means each client waits a slightly random time before retrying, so thousands of clients that failed together do not all retry in the same instant and cause a second spike.
References and source boundaries
The source has talking points for this prompt, not a worked design: the prompt, the seventeen items and one follow-up come from the question bank, and the rest is assembled from the cram sheets, the production guide and the notes listed in the brief. The workload, thresholds, prices and cohort sizes are whiteboard assumptions. The related cases (Secure Multi-Tenant AI Platform, Evaluation and Release Gating, Observability and Production Diagnosis, Consumer-Scale Chat Service, LLM Inference Serving and Production LLM Gateway) teach their mechanisms in more depth.
Fact-check sources, checked 27 September 2026:
- Anthropic pricing: Claude Sonnet 5 at $2/$10 and Claude Haiku 4.5 at $1/$5 per million tokens; cache reads at 0.1× input; Batch API at 50% off.
- Anthropic prompt caching: minimum cacheable prompt length of 1,024 tokens for Sonnet 5 and 4,096 for Haiku 4.5.
Practice
Attempt the case before revealing the worked reasoning.
Attempt the design on a blank page
"A prototype works for 100 users. The customer now wants to deploy it to 100,000 users." Without looking back, ask what "works" meant, size the jump from licensed users to requests a second, tokens a minute and dollars a month, and name what breaks at each tenfold step. Draw the architecture with its three boundaries, then defend it against a provider outage, a permission leak, a department burst and flat adoption. This blank-page exercise is authored guidance; the questions below are the source's self-checks, follow-ups and cost drill.
Work through your answer
This local worksheet is a prototype addition. Notes save in this browser. Nothing is submitted or scored.
Check your reasoning
Reveal the self-assessment rubric
This checklist is an authored addition. Assess what you can explain without reopening the walkthrough.
0 of 9 reasoning checks covered.
Check yourself
These are the source's twelve self-check questions. Answer each aloud before opening it.
Why is "the prototype works" weak evidence for scaling?
It was judged by a hundred forgiving volunteers on demo questions. It says nothing about cost, tail latency, permissions, abuse or adoption.
Walk the sizing from 100,000 licensed users to tokens per minute.
30% daily active × 8 requests = 240,000 a day. 80% of them in 8 hours with a 3× peak gives about 20 a second. × 6,500 tokens (6,000 in, 500 out) ≈ 130,000 tokens a second ≈ 7.8M tokens a minute.
Why did the bill rise about 300 times rather than 1,000?
Only 30% of licensed users are active each day, so adoption sets cost as much as headcount does.
What breaks first between 100 and 1,000 users?
Identity and process: a shared key, a demo eval set, live prompt edits and one-person support.
How do a rate limit and a fair queue differ?
The limit decides whether a request may proceed; the queue decides the order admitted requests are served under load.
Why must the budget check fire before the call?
Checking after the call only reports what was already spent.
What do you tell a customer who asks for 99.9% uptime?
The service cannot promise more than its provider gives; fallback and breakers buy margin, not a guarantee.
Why rebuild the eval set?
The demo set measures what already worked; production traffic from real cohorts contains the questions that will fail.
What makes a rollback a real rollback?
It repoints to a version that is still deployed, in minutes, with no build.
Why split cohorts per user rather than per request?
So one person's experience does not flicker between versions mid-conversation.
The system is ready but nobody uses it. Where do you start?
Segment usage by department and intent, read the sessions where users stop, then check quality, trust, latency, onboarding and workflow fit.
What is the sixty-second cost answer?
Route easy intents down, cache the stable prefix, cap output, batch non-interactive work, budget per department before the call, and prove it with cost per successful task.
Answer the follow-ups
The first follow-up is the question bank's own; the other five are the source's follow-ups beyond it. Answer each before opening it.
The system is technically ready but users are not adopting it. What do you investigate?
The bank's answer list: whether the problem is important enough, workflow fit, user trust, response quality, latency, training and onboarding, incentives, integration friction, and whether the product solves the user's actual pain point.
Order it. Segment usage by department and intent and find where users try once and stop. Read those sessions: a drop after the first answer points to quality or trust, a drop before any answer to latency or onboarding, and low first use to workflow fit and integration friction. Only then talk to users, about their pain rather than the product. Treat flat week-4 retention as a bug with a root cause.
Why not just autoscale?
LLM load does not correlate with CPU, as the cram sheet notes. The limits are provider tokens per minute, cost and fairness, none of which more servers fix.
Do you build the fallback now or later?
Now, warm, with its own eval. A cold fallback fails the first time it matters.
What do you cut to launch faster?
The answer cache and the model cascade. Never identity, permission filtering or rollback.
How do you know the router is right?
A labelled sample of real traffic: measure the misroute rate against the cost saved.
One department wants a custom prompt. What do you do?
Give it a configuration per department behind the same gate, never a fork. A fork escapes the eval gate and the rollback pointer.
Answer the cost pivot in ten minutes
The interviewer's pivot: "The pilot cost $400 a month. Finance just saw the forecast." The source has no drill for this prompt, so the card below is a self-drill grounded in the cost cram sheets. Attempt it before opening.
The pilot cost $400 a month and Finance has seen the $122,000 forecast. What do you say?
The ten-minute cost card.
| Part | Answer |
|---|---|
| Dominant driver | Input tokens per request (system prompt, retrieved chunks, history) multiplied by 240,000 requests a day; output verbosity second |
| Cheapest lever first | Route easy intents to the small model; cache the frozen prefix; cap and trim output; move non-interactive work to the batch API; budgets per department before the call |
| Metric that proves it | Cost per successful task by department and intent; cache-read share of input tokens; output tokens per answer; share of traffic per model; misroute rate |
| Do not | Cut quality globally by downgrading every request, or cache answers without the user's permission scope in the key |
| 60-second line | The forecast grew with request shape more than with users. I would route easy intents to a small model, cache the stable prefix, cap output, batch what nobody waits for, and give every department a budget enforced before the call, then prove it with cost per successful task. |
The cram sheet's incident line applies unchanged: "The increase is likely from request shape, not just user count. I would isolate token growth, retries, agent steps, and batch jobs before changing the model."
Its roadmap sentence is the right shape for Finance: first instrument the bottlenecks, then apply safe quick wins, and finally redesign heavy workflows with routing, caching and async processing.
Every strong cost answer follows four verbs in order. Measure tokens and cost per request path first. Route by intent. Bound output, context and tool steps. Cache safely, with the permission scope in every key.
Deliver it in forty-five minutes
Spend the time on the gap between prototype and production. The model choice is a sentence.
The forty-five-minute delivery plan.
| Minutes | Phase |
|---|---|
| 0–6 | Clarify: what "works" meant, who the 100,000 are, the budget (step 1) |
| 6–10 | What the prototype hides (step 2) |
| 10–16 | Sizing aloud: requests, tokens per minute, dollars (step 4) |
| 16–22 | The tenfold table (step 5) |
| 22–30 | Architecture and the gateway (step 6 and the gateway) |
| 30–36 | Reliability, eval and rollout (failover, step 7 and step 8) |
| 36–41 | Ownership and adoption, including the follow-up (step 9 and step 10) |
| 41–45 | Failure modes and the cost pivot (failure modes and the cost pivot) |
Requirements (step 3) have no slot of their own in the source's plan; state the key constraints inside the clarify phase or while sizing.
Give the two-minute spoken answer.
"First I would ask what 'works' meant, because a hundred volunteers prove the idea is useful and nothing about cost, the slow tail, permissions or adoption. Assuming an internal document assistant going to 100,000 employees, I would size it: about 30% daily active at eight requests each is 240,000 requests a day, around 20 a second at peak and roughly 8 million tokens a minute. On one mid-tier model that is about $120,000 a month; routing, prefix caching and an output cap cut it by nearly half.
Then I would walk the tenfold steps. At a thousand users I need SSO (single sign-on), versioned prompts and traces. At ten thousand I need a gateway with per-user limits, retry inside a circuit breaker, a fallback provider and permission-filtered retrieval. At a hundred thousand I need fair queuing per department, a capacity commitment, sampled online evaluation and on-call.
I would rebuild the eval set from real traffic, gate every release on slices with security at zero, and roll out by department cohort with shadow, canary and a pointer-flip rollback. Finally I would measure adoption, week-4 retention and override rate, because a system nobody uses has failed however well it scales."
The lines that carry the round, from the source:
- "A hundred volunteers proved the idea, not the system."
- "The bill scales with request shape, not with users."
- "Each tenfold step breaks something different."
- "A rate limit decides whether; a fair queue decides in what order."
- "You can't promise more than your dependency provides."
- "If rollback requires a build, it is not a rollback."
- "Adoption is a deliverable."
Calibrate your answer to the level
The levels split on whether the thousandfold jump is treated as a capacity problem, an operating problem, or a change programme for a whole organisation.
How senior, staff and principal answers differ, and what each still misses.
| Level | Sounds like | Missing |
|---|---|---|
| Senior | Sizes 240,000 requests a day down to about 20 a second and 7.8M tokens a minute, then puts one gateway in front of every call with per-user token buckets, retry inside a circuit breaker, a warm fallback and permission-filtered retrieval. Cuts the naive $122,000 month with routing, prefix caching and an output cap. | Who owns the prompt, the budget and the pager, and how 100,000 people arrive without a launch-day cliff. |
| Staff | Walks the tenfold steps and names what breaks at each: identity, then capacity, then fairness. Adds a weighted fair queue per department, an eval set rebuilt from real traffic and gated on slices, cohort waves with a pointer-flip rollback, and named owners with runbooks and a support ladder. | Whether anyone changes how they work, and what the provider relationship needs beyond one quarter. |
| Principal | Treats adoption as the deliverable, measuring week-4 retention and override rate per cohort and investigating a flat curve like a bug. Starts the capacity commitment weeks ahead, tells the customer the service cannot promise more uptime than its provider gives, and keeps per-department prompts as configuration behind one gate, never a fork. | The real department mix, active share and current prices, which only the first cohorts and the price sheet can confirm. |
Return to the decisions you could not explain.
Review the essentialsQuick review
Recall the decisions, failure responses, and closing answer.
The jump, the boundaries and the deliverable
Ask what "works" meant: a hundred volunteers prove usefulness, not cost, tail latency, permissions or adoption. Name what demos hide (traffic shape, tail latency, usage expansion and governance cost) plus drifting prompts, pilot-sized quotas and one-person support. State constraints as tests: requests a second, p95 first token, zero forbidden citations, fairness between departments and a budget.
Size from licensed users to requests, tokens per minute and dollars; adoption is a cost variable. Scale in tenfold steps, expecting identity to break first, capacity second, fairness and organisation last, and fix each before the next step.
Draw admit, assemble, answer, learn, with boundaries at the gateway (admission), retrieval and the cache key (isolation) and the control plane (change). Put one gateway in front of every call for identity, per-user limits, a fair queue, metering before the call, routing and safe caching. Chain retry inside a breaker, a warm fallback with its own eval, and degradation, and never promise more uptime than the provider gives.
Rebuild the eval set from production traffic, gate on slices against the serving version, and hold security at zero. Roll out by user cohort through shadow and canary, with a tested rollback that is a pointer flip. Name owners, runbooks and a support ladder before the first cohort. Measure adoption with week-4 retention and override rate, and investigate a stall from data, to sessions, to users.
Numbers to recall
- Traffic (assumptions): 100,000 licensed, 30% daily active, 8 requests each = 240,000 a day; 80% in 8 hours ≈ 6.7/s; 3× peak ≈ 20/s.
- Tokens: 6,000 in (1,500 system and tools, 3,500 retrieved, 1,000 history) + 500 out; 1.44B in and 120M out a day; ≈ 7.8M tokens a minute at peak, metered per model as about 5.0M small-model and 1.6M mid-tier uncached input plus 0.6M output; plan for 2× peak, which needs custom limits on the small model.
- Little's Law: 20/s × 5 s ≈ 100 in flight; halve latency, halve the slots.
- Cost (September 2026 prices): pilot ≈ $400 a month; naive ≈ $122,000; + routing 70% ≈ $80,000; + prefix cache ≈ $74,000; + 350-token output cap ≈ $67,000. About 300×, not 1,000×.
- Requirements: 20/s sustained, 40/s burst for 10 minutes; first token < 2 s p95, full answer < 10 s p95; 99.9% own service; zero forbidden citations; ≤ 20% p95 impact across departments; budget ±10%; rollback < 5 minutes.
- Rollout: shadow, canary for 48 hours, waves of 1% → 10% → 50% → 100%, promote on the sponsor's sign-off.
- Agents: 5–20 sub-requests per request; batch API at 50% of standard cost.
The closing answer
Check the answer against the bank's seventeen items and volunteer the failure modes with their signals. Spend the forty-five minutes on the gap between prototype and production, not on the model choice. Answer the cost pivot with routing, prefix caching, output caps, batching and budgets before the call, proved by cost per successful task.
The closing line: a hundred volunteers proved the idea, not the system. Each tenfold step breaks something different, the bill scales with request shape rather than users, and adoption is a deliverable.