distributed systems
AI, ML & GenAI interview questions tagged distributed systems, across every topic.
9 questions · 0 unlocked for you
Concepts behind "distributed systems"
The curriculum that explains the ideas these questions test.
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
Consistent Hashing and ShardingSharding spreads data across nodes so no single machine holds everything, but naive modulo hashing remaps almost every key when a node joins or leaves. Consistent hashing places nodes and keys on a hash ring so that adding or removing a node only reshuffles the keys near it, roughly K/N keys instead of all of them. Virtual nodes even out load imbalance. AI, ML, and GenAI engineer interviews probe it because vector indexes, KV caches, and feature stores are all sharded, and rebalancing cost is the difference between a rolling deploy and an outage.⚙️ System Design for AI in ProductionSign in
Core
Distributed Key-Value StoresA distributed KV store spreads keys across many nodes and replicates each key for durability and availability. The storage engine is a core choice: in-memory (Redis) for microsecond reads, LSM-trees (RocksDB, Cassandra) for write-heavy workloads, B-trees for read-heavy. Replication plus quorum reads and writes (R + W > N) tunes the consistency-availability tradeoff, and hinted handoff keeps accepting writes while a replica is down. AI, ML, and GenAI engineer interviews probe it because feature stores, KV caches, vector metadata, and session state all live in these systems, and the quorum math is a favorite probe.⚙️ System Design for AI in ProductionSign in
Core
CAP and Consistency ModelsThe CAP theorem says that during a network partition a distributed system has to choose between consistency and availability; you cannot have both while the network is split. PACELC extends it: even when there is no partition, you trade latency against consistency. Consistency models form a spectrum from linearizability (acts like one copy, real-time order) down through causal to eventual consistency. Logical clocks (Lamport, vector) order events without synchronized wall clocks. AI, ML, and GenAI engineer interviews probe it because every replicated store, queue, and feature pipeline sits somewhere on this spectrum, and naming the point precisely sets senior candidates apart.⚙️ System Design for AI in ProductionSign in
Core
Concurrency and Thread SafetyWhen multiple threads touch shared mutable state, interleavings produce race conditions: lost updates, torn reads, corrupted data. Thread safety means correctness under any interleaving. Locks/mutexes enforce mutual exclusion (pessimistic); optimistic concurrency checks for conflicts at commit and retries (compare-and-swap, version columns). Atomic operations skip locks for simple updates. Deadlock shows up when locks are acquired in conflicting orders. AI, ML, and GenAI engineer interviews probe it because inference servers, batching queues, and shared caches are all concurrent, and the classic double-increment bug still shows up in production.⚙️ System Design for AI in ProductionSign in
