distributed systems
Applied AI 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 spreads requests across many backend instances so no single server is overwhelmed, and removes 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 range from round-robin to least-connections to consistent-hash for sticky routing. Health checks are what turn a load balancer from a sprayer into a fault-tolerance mechanism. Applied-AI 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 keeping 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 go through the cache to the store), write-back (writes hit the cache and flush later). Eviction (LRU, LFU) and TTL decide what to keep, and cache stampede protection stops a popular expired key from hammering the backing store. CDNs are caches at the network edge. Applied-AI 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 you add or remove a node. 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 smooth out load imbalance. Applied-AI 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 writes accepted while a replica is down. Applied-AI 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 must 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. Applied-AI interviews probe it because every replicated store, queue, and feature pipeline lives somewhere on this spectrum, and naming the point precisely separates senior candidates.⚙️ System Design for AI in ProductionSign in
Core
Concurrency and Thread SafetyWhen multiple threads touch shared mutable state, interleavings cause 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 avoid locks for simple updates. Deadlock arises when locks are acquired in conflicting orders. Applied-AI 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
