Transactions, Concurrency Control, and Isolation Levels Questions

How a database engine manages concurrent access from multiple transactions: ACID guarantees (atomicity, consistency, isolation, durability), the standard isolation levels (read uncommitted, read committed, repeatable read, serializable) and the anomalies they permit or prevent (dirty reads, non-repeatable reads, phantom reads, lost updates, write skew), pessimistic locking versus optimistic concurrency control, deadlock detection and handling (including a single transaction that holds locks across more than one shard), and choosing an isolation level for a given workload (for example OLTP writes versus reporting reads). Also covers MVCC as the mechanism that delivers these guarantees, including snapshot isolation versus true serializability and the version cleanup (vacuum) MVCC requires to control table and index bloat from old row versions. Does not cover correctness across separate databases or services, such as two-phase commit, distributed consensus, or replication and sharding topology design.

MediumTechnical
37 practiced

Dirty read, non-repeatable read, phantom read, and write skew: for each anomaly, give a short SQL example with two concurrent transactions that demonstrates it, and recommend an isolation level or pattern that would prevent it in a banking-style system that aggregates account balances.

HardTechnical
39 practiced

Explain how Multi-Version Concurrency Control (MVCC) works internally and how snapshot isolation differs from true serializability. Describe an example of a write-skew anomaly and how you would prevent it in a DBMS that provides snapshot isolation.

EasyTechnical
33 practiced

Explain the ACID properties (Atomicity, Consistency, Isolation, Durability). For each property give a concrete example of a database operation that would break if that property were not guaranteed, and briefly describe how a typical RDBMS enforces that property.

HardTechnical
43 practiced

Analyze the performance and correctness trade-offs between running read-only transactions under snapshot isolation versus serializable isolation for a high-throughput analytical workload. Discuss MVCC snapshot management, stale reads, why serializable transactions need predicate locking or conflict tracking, and the runtime and memory overhead that adds. Recommend which isolation level to use, and when it is reasonable to relax the guarantee.

HardTechnical
34 practiced

Compare optimistic and pessimistic concurrency control for two different write paths against the same database: (A) an hourly batch ETL job that writes many rows into shared reporting tables, and (B) an interactive UI where multiple users make small, frequent edits to shared metadata records. Which approach fits each path better, and why? Discuss locking, throughput, and how you would resolve conflicts in each case.

Unlock Full Question Bank

Get access to all 25 Transactions, Concurrency Control, and Isolation Levels interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.