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.

HardTechnical
39 practiced

You need to change a high-throughput OLTP database's isolation level from read committed to repeatable read, but the team is worried about the production impact. Design an experiment to validate the change safely: how would you generate a representative workload, what would you measure (throughput, latency, serialization failures, lock waits), what trade-offs do you expect, and what is your rollback plan if something goes wrong in production?

MediumTechnical
42 practiced

A batch job reads from a table while another process is writing to it at the same time. What kinds of inconsistencies or locking issues can happen, and how would transaction isolation level, snapshot reads, or load timing affect what your query returns?

EasyTechnical
31 practiced

What is a database transaction, and why do COMMIT and ROLLBACK matter for keeping data correct? Walk through a concrete example, such as a batch data-load job, where a transaction boundary prevents partial or inconsistent data from landing in the table.

MediumTechnical
43 practiced

Walk through the SQL isolation levels: READ UNCOMMITTED, READ COMMITTED, REPEATABLE READ, SERIALIZABLE. For each level, describe which anomalies it prevents (dirty reads, non-repeatable reads, phantom reads), and give a short SQL snippet or scenario that demonstrates one anomaly.

EasyTechnical
32 practiced

List the four standard SQL isolation levels (read uncommitted, read committed, repeatable read, serializable) and for each, state which of the classic anomalies (dirty read, non-repeatable read, phantom read, write skew) it still permits. Which isolation level does PostgreSQL actually provide by default, and what does that guarantee in practice for a reader running concurrently with writers?

Unlock Full Question Bank

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

Sign in to Continue

Join thousands of developers preparing for their dream job.