Skip to content
RED SAGSkills
easyBackend Developer interview question

What is a database transaction, and what do the letters in ACID mean? Give an example where you need one.

What the interviewer wants to hear

  • A transaction groups several operations into one unit of work
  • Atomicity: all or nothing; Consistency: constraints hold
  • Isolation: concurrent transactions do not see each other's partial work
  • Durability: committed data survives crashes
  • Concrete example such as a money transfer or order plus stock update

Model answer

A transaction is a group of database operations that succeed or fail together. ACID describes its guarantees. Atomicity means all or nothing: if anything fails, the whole transaction rolls back. Consistency means the database moves from one valid state to another, so constraints like foreign keys and unique keys still hold. Isolation means concurrent transactions do not see each other's half-finished work; the isolation level, such as read committed or serializable, controls how strict that is. Durability means that once COMMIT returns, the data survives a crash, usually thanks to a write-ahead log. A classic example is a bank transfer: debiting one account and crediting another must happen together, or money disappears. Another is placing an order, where I insert the order rows and decrease stock in one transaction so they never disagree.

Can you answer it under time pressure?

Take a timed easy round and get scored on every answer.

Start mock interview

More easy Backend Developer questions