Top 4 Isolation levels Interview Questions
Browse 4 real-world technical and behavioral interview questions about Isolation levels. Review scenarios, edge cases, and architectural best practices.
Explain ACID using a bank transfer of 100 from one account to another, and tell me what isolation protects you from.
In a transfer, atomicity means the debit and credit commit together or not at all, consistency means declared constraints such as a non-negative balance still hold, isolation stops concurrent transactions seeing or overwriting each other's half-done work, and durability means a confirmed commit survives a crash.
Walk me through the transaction isolation levels and which anomalies each one permits.
Each level is defined by the anomalies it allows: READ COMMITTED permits non-repeatable reads and phantoms, PostgreSQL's REPEATABLE READ is snapshot isolation so it prevents both yet still permits write skew, and only SERIALIZABLE rules out all four.
Take this table to third normal form, then tell me when you would deliberately denormalise — and what does ACID guarantee?
Normalisation removes redundancy so a fact is stored once; 3NF is reached when every non-key column depends on the key and nothing but the key. You denormalise knowingly, to buy read performance with write complexity. ACID guarantees far less than candidates assume, particularly its C.
A user submits the form twice and you get two identical orders. Why did the check-then-insert not prevent it, and how do you fix it in the database?
Two transactions can each run the SELECT before either commits, so neither sees the other and both inserts succeed. The fix is a serialisation point the database owns - a unique index on a natural or client-supplied key - plus a defined answer for whoever loses the race. It also connects idempotency to the point an interviewer is testing.