ML system design
ML and AI system design for interviews: recommendation and ranking, LLM serving, RAG and agents. Free to read.
ML and AI system design for interviews: recommendation and ranking, LLM serving, RAG and agents. Free to read.
17 write-ups
| Title | Difficulty |
|---|---|
| Design an LLM Gateway One proxy between a company's apps and every LLM provider, with model routing, response and prompt caching, fallbacks, cost and latency observability, and per-team budgets and token quotas. | Medium |
| Design an LLM Inference System Serve a /v1/chat/completions API on a shared GPU fleet with continuous batching, a paged KV cache, prefill/decode disaggregation, LoRA adapters and cache-aware routing. | Hard |
| Design a Machine Learning Platform An internal platform where hundreds of teams label data, run experiments on shared GPUs, register models and deploy them to production endpoints, with lineage, safe rollouts and monitoring. | Hard |
| Design a Text-to-Image Generation System A Midjourney-style image generator: latent diffusion with classifier-free guidance, prompt rewriting, layered safety filters, GPU queueing by tier, and evaluation with FID, CLIP score and human preference. | Hard |
| Design a Text-to-Speech Service An ElevenLabs-style speech API: text normalization, codec language models and vocoders, streaming synthesis under 300 ms, prosody control, voice cloning with consent, MOS evaluation and audio watermarking. | Medium |
| Design A/B Testing for LLM Features Send 10% of traffic to a new prompt or model through config, measure five metrics per variant including safety, and roll the change back automatically when safety regresses. | Medium |
| Design an LLM Evaluation and Observability System Trace every LLM call, tool call and agent step, score quality offline and on live traffic with checks, LLM judges and humans, and benchmark multi-agent workflows and coding agents. | Hard |
| Design an LLM Fine-Tuning System A platform to fine-tune LLMs with SFT, LoRA and DPO: datasets, GPU jobs, checkpoints, evals and deployment, applied to code completion, domain Q&A and legal contract analysis. | Hard |
| Design an Offline Batch Inference Service Run a model, plus the user's own pre- and post-processing script, over millions of records on shared GPUs, with sharding, fair allocation, progress tracking and retries that resume work. | Medium |
| LLM Serving Engines What vLLM, SGLang, TGI, TensorRT-LLM and llama.cpp actually do inside, the techniques they share, how they differ, and how to pick and run one in a design. | |
| Model Context Protocol (MCP) How MCP connects AI apps to tools and data. Hosts, clients and servers, tools, resources and prompts, JSON-RPC and transports, OAuth, and how to wire MCP servers into a production agent safely. | |
| How to Approach ML System Design Interviews A step-by-step framework for ML system design rounds, with time budgets for applied ML and ML infra interviews and the calculations to have ready, from QPS and KV cache to A/B sample sizes. | |
| Inference Optimization and Distributed Training How to make large models faster and cheaper to serve and possible to train. Quantization, batching, speculative decoding, and data, tensor and pipeline parallelism, with the arithmetic. | |
| MLOps and LLMOps How models get from a notebook to production and stay healthy there. Features, training pipelines, deployment, real-time prediction at scale, monitoring, LLMOps, and when to train vs call an LLM. | |
| Numbers to Know for ML Systems The arithmetic behind ML infra answers. GPU specs, memory for weights, KV cache and training, FLOPs per token, why decode is bandwidth-bound, fleet sizing, multi-GPU layouts and self-hosting cost. | |
| Generative Model Fundamentals How generative models work and how to measure them: autoregressive vs diffusion, latent diffusion, classifier-free guidance, sampling, CLIP-style contrastive encoders, and FID, CLIP score, MOS and WER. | |
| Privacy in ML Systems How ML systems handle personal data: PII detection and minimization, consent and purpose, deletion requests that reach models, differential privacy, federated learning and on-device models. |