Skip to content
Tech Interview Prep home
Technical interview guide

Transactions & Isolation Levels

ACID guarantees, and the isolation-level trade-off between correctness and concurrent throughput.

Read
24 min
Practice MCQs
25
Interview QA
25
Edition
v3
Editorial status
Reviewed

Scope: SQL principles with PostgreSQL 18 examples; vendor-specific behavior must be verified.

Interview QA

Treat each question like a live interview question: answer out loud first (structure, assumptions, tradeoffs), then open the model answer to spot gaps and rehearse a tighter follow-up.

Curated: · Written: · Reviewed:

QA-1

Explain the ACID properties, and which one is most often misunderstood.

QA-2

Walk through the isolation levels and the anomalies each permits.

QA-3

A counter is undercounting under load. Diagnose and fix it.

QA-4

Explain write skew with an example, and how you would prevent it.

QA-5

How would you implement retry logic for serializable transactions?

QA-6

How would you implement a job queue in the database?

QA-7

Explain deadlocks and how you would prevent and handle them.

QA-8

Why are long-running transactions dangerous, and how would you find them?

QA-9

When would you choose serializable over read committed?

QA-10

Explain optimistic versus pessimistic concurrency control.

QA-11

How do transactions interact with connection pooling?

QA-12

How does Two-Phase Locking (2PL) differ from Multi-Version Concurrency Control (MVCC) in managing transaction concurrency?

QA-13

Explain how MVCC lets readers avoid blocking writers.

QA-14

A booking system occasionally double-books a room. How do you fix it?

QA-15

Why should network calls and long-running non-database work be avoided inside an active database transaction?

QA-16

How should transaction boundaries be chosen in application code?

QA-17

Explain what a savepoint is and when it is useful.

QA-18

How do read replicas interact with transactional consistency?

QA-19

What happens if two transactions update the same row at read committed?

QA-20

How would you handle a transaction that must span several services?

QA-21

Explain what happens during a commit and what could make it fail.

QA-22

How would you reduce lock contention in a hot part of the schema?

QA-23

What would you check when reviewing code that opens a transaction?

QA-24

Explain the difference between a transaction being slow and a transaction being long.

QA-25

How would you explain isolation levels to a developer who has only used the default?