system design
AI, ML & GenAI interview questions tagged system design, across every topic.
111 questions · 12 unlocked for you
Concepts behind "system design"
The curriculum that explains the ideas these questions test.
Foundational
Rate Limiting, Retries, and BackoffLLM systems rely on rate-limited, sometimes-failing providers, so resilient design is essential. Rate limiting (token bucket) shields your service and enforces per-tenant quotas; retries with exponential backoff and jitter absorb transient failures without hammering a struggling dependency; circuit breakers stop sending requests to a failing service so it can recover. AI, ML, and GenAI engineer interviews probe it because LLM calls are slow, expensive, and flaky, and naive retry logic turns a blip into an outage.⚙️ System Design for AI in Production
Foundational
Idempotency and Exactly-Once EffectsIn a distributed system, calls fail and get retried, so the same request can land more than once. Idempotency means running a request twice yields the same effect as running it once, achieved with idempotency keys and deduplication. It underpins safe retries: without it, a retried payment charges twice or a retried pipeline double-counts. AI, ML, and GenAI engineer interviews probe it because LLM/data pipelines are full of flaky, retried steps, and 'exactly-once' is really 'at-least-once delivery plus idempotent processing'.⚙️ System Design for AI in Production
Foundational
LLM Cost OptimizationLLM systems get expensive fast, and the cost model comes down mostly to tokens and number of model calls. The levers, in rough order of impact: route easy queries to cheaper/smaller models, cache repeated and similar requests, trim context (fewer, better chunks), use cheaper retrieval/reranking, and for agents cut unnecessary steps. The discipline is measuring cost per request and going after the dominant contributor. AI, ML, and GenAI engineer interviews probe it because cost is a primary production constraint and most teams overspend by defaulting to the biggest model on everything.⚙️ System Design for AI in Production
Foundational
Load BalancingA load balancer distributes requests across many backend instances so no single server is overwhelmed, and pulls failed instances from rotation. L4 balancers route by IP and port (fast, protocol-agnostic); L7 balancers read the request (path, headers, cookies) and route by content. Algorithms span round-robin, least-connections, and consistent-hash for sticky routing. Health checks are what turn a load balancer from a sprayer into a fault-tolerance mechanism. AI, ML, and GenAI engineer interviews probe it because inference fleets have wildly uneven request costs, so the algorithm choice actually matters.⚙️ System Design for AI in Production
Foundational
Caching StrategiesA cache trades freshness for speed by holding a copy of hot data closer to the request. The strategy is the write/read pattern: cache-aside (app fills the cache on a miss), write-through (writes pass through the cache to the store), write-back (writes hit the cache and flush later). Eviction (LRU, LFU) and TTL govern what to keep, and cache stampede protection prevents a popular expired key from hammering the backing store. CDNs are caches at the network edge. AI, ML, and GenAI engineer interviews probe it because LLM responses, embeddings, and retrieval results are expensive enough that caching is a first-class design decision.⚙️ System Design for AI in Production
Core
Fault Tolerance and Graceful DegradationAI systems rely on flaky, slow dependencies (model providers, vector stores, tools), so they must degrade gracefully rather than fail hard. Circuit breakers stop calling a failing dependency so it can recover; fallbacks return a cached, simpler, or safe response when the primary path fails; timeouts and bulkheads keep failures contained. The aim is for one component's failure to become a degraded experience, not an outage. AI, ML, and GenAI engineer interviews probe it because LLM dependencies fail often and naive designs turn a provider blip into a total outage.⚙️ System Design for AI in ProductionSign in
