InterviewStack.io LogoInterviewStack.io

CAP Theorem and Consistency Models Questions

Understand the CAP theorem and how Consistency, Availability, and Partition Tolerance interact in distributed systems. Know different consistency models including strong consistency such as linearizability, eventual consistency, causal consistency, and session consistency, and how to apply them to different use cases. Be familiar with consensus protocols and distributed coordination primitives such as Raft and Paxos, quorum reads and writes, two phase commit and when to use them. Understand trade offs between consistency and availability under network partitions, patterns for hybrid approaches where different data uses different guarantees, and the product and developer experience implications such as latency, stale reads, and API contract clarity.

MediumTechnical
0 practiced
Implement a VectorClock class in Python that supports: increment(node_id), merge(other_clock), and compare(other_clock) returning one of {'less', 'greater', 'concurrent', 'equal'}. Provide function signatures, brief inline comments, and an example of using compare to detect concurrent updates between two replicas.
HardSystem Design
0 practiced
You are designing a messaging system for chat where ordering and user experience matter. Compare three approaches: (A) global linearizable ordering for all messages, (B) causal ordering, and (C) eventual ordering. For each approach, describe required primitives, latency implications, complexity, and how you'd mitigate bad UX in partitions.
HardSystem Design
0 practiced
Design a key-value service API and internal architecture that supports configurable per-key consistency levels: linearizable, causal, and eventual. Requirements: handle 10k RPS per region, multi-region replication, ability to tune consistency per key, and clear developer ergonomics in the client library. Describe components, client behavior, failure handling, and how you route or replicate data.
MediumTechnical
0 practiced
Describe Raft and Paxos at a high level: what problem they solve (consensus), and the main differences an engineer should consider when choosing one for a new distributed component. Focus on understandability, leader election, log replication, dynamic membership, and safety versus liveness trade-offs.
EasyTechnical
0 practiced
Explain quorum reads and writes in replicated storage. Given replication factor N and quorums R and W, state the condition(s) that guarantee strong consistency (no lost writes, reads see latest write). Provide numeric examples (e.g., N=3 with (R=2,W=2) vs (R=1,W=3)) and explain the trade-offs in latency and availability.

Unlock Full Question Bank

Get access to hundreds of CAP Theorem and Consistency Models interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.