AI Research Scientist • Senior-Level
AI Research Scientist • Senior-Level
High QualityInterview Summary
The interview focused on designing an LLM routing system that balances model accuracy and inference cost. The problem started with a simple probability calculation involving two language models, then progressed into assumptions about model performance, ML-based routing, threshold optimization, and multi-turn conversation support.
Interview Details
ML System Design: Cost-Aware LLM Routing
The interviewer presented a scenario involving two language models with different accuracy levels and inference costs. Suppose an application has access to two LLMs:
| Model | Accuracy | Cost per Query |
|---|---|---|
| Small Model | 80% | 1 unit |
| Large Model | 95% | 10 units |
The small model is significantly cheaper but less accurate, while the large model provides higher accuracy at ten times the inference cost. The objective is to build a routing system that decides which model should process each incoming query. The system must satisfy two goals:
- Achieve at least 90% overall accuracy.
- Minimize the expected inference cost per query.
The interviewer introduced five questions that progressively extended this scenario.
Question 1 — Random Router: Probability and Expected Cost
The first question assumed that the router makes decisions randomly. For every incoming query, the system independently selects either the small model or the large model according to a fixed probability. "What probability should be assigned to the large model to achieve 90% overall accuracy?" I needed to calculate the minimum probability of selecting the large model while meeting the target accuracy. The expected accuracy can be expressed as: `Expected Accuracy = p * 0.95 + (1 -
Unlock Full Details
Create a free account to unlock this interview experience report.