Code RoomAutocomplete latency vs quality
HardPrep Room Coding #4315

Autocomplete latency vs quality

Vibe & agenticAlgorithms & data structuresSenior–Staff~18 min

You're shipping an in-editor autocomplete feature: as the user types, your service must return a code suggestion. Product wants 'the smartest model so suggestions are great.' You measure the premium model at ~1.8s median latency; the smaller one at ~250ms with noticeably lower acceptance on hard completions. Walk through how you'd choose the model tier here.

Implement
choose_model_tier(latency_budget_ms: int, fast_latency_ms: int, fast_acceptance_pct: int, premium_latency_ms: int, premium_acceptance_pct: int) → str
Examples
in[300,250,61,1800,78]out"fast"
in[3000,250,61,1800,78]out"premium"
in[200,250,61,1800,78]out"none"
What a strong answer looks like

Treat the AI’s output as a draft to verify, not an answer to trust. Name the specific flaw and the input that triggers it, say how you’d catch it (tests, edge cases, reading critically), and how you’d re-prompt or decompose to get it right.

0:00 of about 18 min

Vibe & agentic: describe the solution in plain language (or narrate it) and the coach grades your approach.

Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.