Phase 5 · Distributed Systems
Consistency, consensus, distributed transactions and concurrency.
- CAP, PACELC & Consistency Models: What "consistent" really means across replicas: CAP as a partition-time choice, PACELC for the normal case, the model hierarchy from linearizable to eventual, quorums, anti-entropy, and conflict resolution with CRDTs.
- Consensus, Leader Election & Time: How machines agree when networks lie and clocks drift: Raft in detail, Paxos intuition, etcd/ZooKeeper in practice, leases with fencing tokens, failure detectors, split brain, NTP vs TrueTime, and Lamport/vector/hybrid logical clocks.
- Idempotency, Distributed Transactions, 2PC & Sagas: Keeping money and orders correct across services: idempotency keys on both sides of every hop, 2PC and why it blocks, TC/C, sagas with compensations, transactional outbox + CDC, inbox dedup, the exactly-once illusion, and reconciliation.
- Concurrency, Locking & Distributed Locks: Race conditions, optimistic vs pessimistic locking, atomic ops, Redis/etcd locks, fencing tokens and deadlocks — the bugs that only show up at 3 AM under load.
- Data Systems Theory: System Models, Ordering, Encoding & Derived Data: The theory senior interviews probe without naming it: system models and fault types, safety vs liveness, the two generals and FLP results, state machine replication and why total order broadcast is consensus, Avro schema resolution and rolling upgrades, stream-table duality, the three kinds of stream join, "unbundling the database" with CDC and a log, the end-to-end argument for exactly-once, when Byzantine fault tolerance is worth it, and what modern data systems add.