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
22 practiced
Explain the trade-offs between two-phase commit (2PC) and distributed consensus (e.g., Raft-based transactions) for achieving atomic multi-shard transactions. Discuss blocking behavior, coordinator or leader failures, performance implications, and scenarios where one approach is clearly preferable to the other.
MediumTechnical
30 practiced
A follower in your leader-follower replicated store occasionally lags behind the leader, causing stale reads when clients are routed to it. Describe four strategies to reduce stale reads (e.g., read-from-leader, version checks, client-side staleness tolerance, read-repair) while minimizing impact on read throughput and tail latency. For each, describe trade-offs and best-use scenarios.
HardSystem Design
21 practiced
Explain how you would implement multi-region leader election to provide linearizable writes globally. Discuss deployment topologies (single active leader vs leader-per-region with forwarding), the latency and availability implications, and how network partitions affect progress and correctness.
EasyTechnical
21 practiced
Describe the two-phase commit (2PC) protocol: coordinator and participants, prepare and commit phases. Explain a common failure case where 2PC can block and why that blocking matters. Provide one mitigation strategy (e.g., timeouts, participant recovery) and discuss when you would prefer sagas over distributed transactions.
HardTechnical
28 practiced
Write a short advisory (for engineering teams) on how to reason about CAP in a multi-tenant SaaS product that must guarantee consistency for configuration changes (critical) but can tolerate eventual consistency for analytics and usage metrics. Propose a partition-time strategy, feature-level consistency mapping, and a migration plan for changing consistency levels without service interruption.

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.