InterviewStack.io LogoInterviewStack.io

Consistency Models and Transactions Questions

Comprehensive knowledge of data consistency models and transactional guarantees in databases and distributed systems. This includes understanding transaction properties such as Atomicity, Consistency, Isolation, and Durability (ACID) and alternative design philosophies such as Basically Available, Soft state, Eventually consistent (BASE). Candidates should be able to choose appropriate isolation levels including read uncommitted, read committed, repeatable read, serializable, and snapshot isolation and explain performance versus correctness tradeoffs and common anomalies such as dirty reads, non repeatable reads, phantom reads, lost updates, and write skew. Understand consistency models including strong consistency, strict serializability, serializability, snapshot isolation, causal consistency, eventual consistency, monotonic reads, and read your writes, and when each model is acceptable based on latency, availability, and business correctness requirements. Discuss replication strategies and their impact on guarantees, including synchronous versus asynchronous replication, multi region replication, replication lag, and replica divergence. Evaluate distributed transaction and coordination approaches such as two phase commit and consensus based protocols and weigh their performance and failure modes. Propose conflict detection and resolution strategies such as last write wins, version vectors and vector clocks, conflict free replicated data types, application level reconciliation, idempotent operations, retries, and saga or compensation patterns for long running workflows. Consider practical engineering concerns including consistency service level objectives, monitoring and alerting for staleness and replication lag, testing strategies for consistency, implications for caching and sharding, and the tradeoffs between developer complexity and user facing correctness.

MediumTechnical
101 practiced
Analysts complain that their analytics replica is often stale. Propose an SLO for replica freshness for analytics workloads, describe how you would measure freshness (including instrumentation and sampling), and recommend mitigation tactics such as nearline ingestion, replication tuning, or changing topology to reduce staleness while balancing cost.
MediumTechnical
91 practiced
Explain read/write quorum parameters (N, R, W) in quorum-based systems similar to Dynamo. Given different SLAs (low-latency reads preferred, high write throughput preferred, or strong consistency required), demonstrate choosing R and W for each SLA and show example failure scenarios and how your choices behave under node failures and partitions.
EasyTechnical
94 practiced
Explain how snapshot isolation (SI) works and why it prevents some anomalies but can allow write skew. Provide a concrete example with two concurrent transactions in a banking-like system that systemically violates an invariant under SI. As a Solutions Architect, list strategies to mitigate or prevent such write skew when the invariant is critical.
EasyTechnical
105 practiced
Explain vector clocks and version vectors: how they capture causality across replicas, how to compare two vectors (happens-before, concurrent), and practical limitations such as growth with replica count. Provide a concrete use-case where vector clocks are superior to simple timestamps for conflict detection.
EasyTechnical
155 practiced
As a Solutions Architect designing a payment processing API that must tolerate network retries and partial failures, explain idempotency and propose an idempotency key strategy. Include where keys are generated (client vs server), how they are stored, TTLs for stored keys, scaling concerns, and how to handle malicious or replayed keys.

Unlock Full Question Bank

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

Sign in to Continue

Join thousands of developers preparing for their dream job.