LLM inference and serving practice problems

28 problems · 0 solved

Serving an LLM means answering many users quickly and cheaply on limited GPU memory. Generation happens one token at a time, and the model stores past keys and values in a KV cache so it does not redo work. Running a serving system is a bit like running a busy restaurant kitchen: you batch orders, reuse prepared items and keep every burner in use. These problems cover the core ideas behind modern inference engines. You will generate tokens with a KV cache, work out how many tokens fit in GPU memory, allocate KV memory in pages, evict cache blocks with LRU, count prefix cache hits with a token trie, estimate whether decoding is memory-bound, simulate continuous batching and a chunked prefill scheduler, verify draft tokens in speculative decoding, compute TTFT, TPOT and throughput, size concurrency with Little's law, and price requests with cached input tokens. Start with the Easy problems on latency metrics, memory sizing and pricing. Then do KV cache decoding, paging and prefix caching, and finish with batching, chunked prefill and speculative sampling. Inference cost drives product decisions, and these topics appear often in LLM infrastructure interviews.

Easy 11

Medium 11

Hard 6

Related topics

All practice problems