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
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?

MediumTechnical
42 practiced

Describe how PostgreSQL's MVCC mechanism works, including how transaction IDs and snapshots determine what a query can see, and why this design causes table and index bloat over time. How would you detect bloat in a production database, and what remediation options are available? Compare their operational trade-offs.

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.

HardTechnical
35 practiced

PostgreSQL index and table bloat are degrading query performance in production. Explain what causes bloat at the MVCC level, how autovacuum configuration affects how much bloat accumulates, and design a maintenance plan that includes routine VACUUM, VACUUM FULL, and reindexing. Assess the risk and downtime each of these operations carries and when each is warranted.

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.