Lesson 16 of 19
17. Transactions and Locking

Interview questions

6 min read+10 XP

Interview questions (with the counter-questions you'll get)

Q1. What is a transaction, and what does ACID guarantee?

They're testing: fundamentals with depth.

Think about your answer first, then open it.

reveal

Q2. How do you stop two users booking the last seat?

They're testing: the most common concurrency question.

Think about your answer first, then open it.

reveal

Q3. Explain the isolation levels and the anomalies they prevent.

They're testing: precise knowledge.

Think about your answer first, then open it.

reveal

Q4. Pessimistic vs optimistic locking: when do you use each?

They're testing: trade-off thinking.

Think about your answer first, then open it.

reveal

Q5. What is a deadlock, and how do you handle it?

They're testing: operational understanding.

Think about your answer first, then open it.

reveal

Q6. How do you handle a transaction that spans multiple services?

They're testing: microservices realism.

Think about your answer first, then open it.

reveal

Q7. How does two-phase commit work, and what's its weakness?

They're testing: a classic protocol.

Think about your answer first, then open it.

reveal

Q8. How would you implement a distributed lock, and what can go wrong?

They're testing: depth beyond "use Redis".

Think about your answer first, then open it.

reveal

Q9. How do seat holds work in a ticketing system?

They're testing: applying concepts to a classic design.

Think about your answer first, then open it.

reveal

Q10. You see the stock of a product go negative in production. How do you investigate and fix it?

They're testing: debugging concurrency in real life.

Think about your answer first, then open it.

reveal