# Sarvam AI interview prep

## Why does a fast model make some readers wait two seconds?

Original Opend practice case · Updated 2026-11-30

[Cite this case](https://opend.in/prep/sarvam-ai#inference-latency)

Design a streaming chat service with a target of one second to the first visible token. A burst of long documents arrives alongside short chat prompts. Average throughput looks healthy. Users sending short prompts report that the screen stays blank.

**Short answer** — Measure queue wait, prefill and decode separately. Tune admission and batching against first-token latency, inter-token gaps and completed requests under the same traffic mix.

### One slow request, from arrival to first visible token

- **Wait · 1,400 ms** — The request sits behind already admitted work.

- **Prefill · 450 ms** — The model processes the prompt before producing output.

- **First output · 150 ms** — First decode and transport bring this example to 2,000 ms.

### Define the clock the reader experiences

Record request arrival, admission, first visible content and final content. The first network event can contain metadata, so define which event ends the first-token clock. A stream can start promptly and still pause midway. Measure inter-token delays as well as completion time. Sarvam’s chat API supplies the product context for this exercise. The timing trace is illustrative and describes a hypothetical service.

[Sarvam chat completions API](https://docs.sarvam.ai/api/token-factory/chat-completions)

### Choose the lever that can meet the target

In the illustrated request, even eliminating all 450 ms of prefill leaves 1,550 ms. Start with admission and queueing. Try reserving a bounded share of capacity for short interactive traffic, with aging so longer requests still progress. Also compare chunked prefill settings. In vLLM the token budget changes the tradeoff between feeding new requests and continuing decode work. This is an example serving engine for the exercise.

[vLLM optimization and chunked prefill](https://docs.vllm.ai/en/stable/configuration/optimization/)

### Make the benchmark difficult to game

Replay the same arrival times, prompt lengths and output limits. Report p95 first-token time by length bucket alongside p95 inter-token gap, rejection rate and completed tokens per second. Include the long-document bucket in the acceptance criterion. A policy that drops every expensive request can make latency look excellent while completing less user work. Measure the percentiles on individual requests rather than adding component percentiles.

### Illustrative first-token budget for this one request

| Change | Time saved | New first token |
| --- | --- | --- |
| Halve prefill | 225 ms | 1,775 ms |
| Reduce wait to 300 ms | 1,100 ms | 900 ms |
| Double decode speed only | At most 75 ms here | At least 1,925 ms |

### Your shorter queue improves p95 but doubles rejected chats. Did the change succeed?

Count rejections against the service objective and evaluate how many offered requests complete within budget. Then compare the same offered load. If interactive traffic genuinely needs reserved capacity, specify who can use spare capacity and how quickly the reservation can be reclaimed.

Sarvam's careers page spans model, API and infrastructure work. Pick the track in your actual job description. These practice categories are not a verified company interview loop.

## Coding & problem solving

Practice a small, testable solution. Explain data structures, complexity and edge cases aloud.

## LLD / HLD

Explain inference latency, batching, queue capacity and evaluation quality without hiding failure modes behind model names.

## Practical systems & work discussion

Walk through one project you shipped: the constraint, your decision, a failure, and the result you can substantiate.

## Practice questions

These are Opend practice prompts, not verified interview questions.

### How would you reduce tail latency in a model-serving API?

- Measure queue delay separately from token generation and network time.
- Compare batch size, throughput and latency under realistic request lengths.
- Bound queues, apply backpressure and describe safe fallbacks when capacity is exhausted.

### How would you evaluate a multilingual model change?

- Build language- and task-stratified test sets with clear label provenance.
- Track regressions by language, domain and input length; an aggregate score can hide harm.
- Define deployment gates and review ambiguous cases with appropriate language expertise.

### What makes a training data pipeline reproducible?

- Version input manifests, transformations and output checksums.
- Make processing resumable and deterministic where possible. Record exclusions and deduplication rules.
- Keep a small golden dataset to catch changes before a large run.

[Live roles](https://opend.in/jobs?company=Sarvam%20AI)

## Sources

- [Sarvam AI: current teams and roles](https://www.sarvam.ai/careers)
