When interviewers ask about ACID transactions they want to see three things: you understand the theory, you can map it to real systems, and you can talk about the impact of your design choices. Below are the most common questions, a short spoken answer you can deliver in 45‑90 seconds, and the next‑level question that often follows. Use them as a rehearsal script; saying the answer out loud helps you stay concise and lets Call Assistant catch any drift in the conversation.
1. What does ACID stand for?
Answer template
"ACID is an acronym for Atomicity, Consistency, Isolation, and Durability. Atomicity means a transaction is all‑or‑nothing; either every change commits or none do. Consistency guarantees that each transaction leaves the database in a valid state according to the schema and business rules. Isolation ensures concurrent transactions don’t interfere with each other, so the result is the same as if they ran sequentially. Durability means once a transaction is committed, it survives crashes and power loss."
Typical follow‑up
"Can you give an example of a situation where one of those properties mattered the most?"
2. How do databases enforce atomicity?
Answer template
"Most relational databases use a write‑ahead log (WAL). When a transaction starts, the system records intent in the log before touching the data pages. If the transaction aborts, the log entries are discarded; if it commits, the log is flushed to stable storage, guaranteeing that the changes can be replayed after a crash. Some NoSQL stores use two‑phase commit or versioned writes to achieve the same effect."
Typical follow‑up
"What overhead does logging introduce, and how do you mitigate it in a high‑throughput service?"
3. Explain the different isolation levels.
Answer template
"Isolation levels define how much a transaction can see of others’ intermediate states. The classic hierarchy is Read Uncommitted, Read Committed, Repeatable Read, and Serializable. Read Uncommitted allows dirty reads; Read Committed prevents them but can still show non‑repeatable reads. Repeatable Read guarantees that rows read once won’t change, but phantom rows can appear. Serializable is the strongest – it behaves as if transactions run one after another, eliminating phantoms. Most production systems default to Read Committed because it balances consistency and performance."
Typical follow‑up
"When would you choose Serializable over Read Committed, and what cost does it incur?"
4. What are “phantom reads” and how does a database prevent them?
Answer template
"A phantom read occurs when a transaction re‑executes a query and sees new rows that weren’t there before. This can happen under Repeatable Read because the lock is on the rows, not the range. To prevent phantoms, the engine uses range locks or predicate locking, which are part of the Serializable isolation level. Some databases also offer snapshot isolation, where each transaction works on a consistent snapshot and thus never sees phantoms."
Typical follow‑up
"Can you describe a real case where phantom reads caused a bug, and how you fixed it?"
5. How does durability work in distributed systems?
Answer template
"Durability in a distributed setting usually relies on replication and quorum writes. When a transaction commits, the leader writes to its local log and then propagates the entry to a majority of replicas before acknowledging the client. If the leader crashes, a new leader can replay the log from the last committed entry, ensuring no loss. Techniques like synchronous replication or write‑ahead logs on each node help meet durability guarantees."
Typical follow‑up
"What trade‑offs do you consider when choosing synchronous versus asynchronous replication?"
6. Describe a time you had to relax ACID guarantees for performance.
Answer template
"In a high‑traffic e‑commerce checkout service, we moved the order‑status updates to an eventually consistent store. The core payment flow still used a relational database with full ACID, but ancillary events (like inventory view updates) were written to a message queue and later synced. This reduced latency by about 30 % while keeping the critical financial transaction fully ACID."
Typical follow‑up
"How did you monitor that the eventual consistency didn’t break business rules?"
7. What is a “two‑phase commit” and when would you use it?
Answer template
"Two‑phase commit (2PC) coordinates a transaction across multiple resource managers. In the first phase, a coordinator asks each participant to prepare – they write a provisional log entry and lock resources. If all participants respond positively, the coordinator sends a commit command; otherwise it sends a rollback. 2PC is useful when you need atomicity across databases, message brokers, or external services, but it adds latency and can leave dangling locks if the coordinator fails."
Typical follow‑up
"What alternatives exist to 2PC for cross‑service consistency?"
8. How do modern NoSQL databases handle ACID properties?
Answer template
"Many document stores now offer ACID transactions scoped to a single partition or a small set of keys. They implement atomicity via versioned writes and use a consensus protocol (like Raft) to achieve durability. Consistency is usually eventual at the cluster level, but you can request strong consistency per request. Isolation is often snapshot‑based, giving repeatable reads without locking the entire dataset."
Typical follow‑up
"What limitations have you hit when trying to model relational constraints in a NoSQL store?"
9. What is “write skew” and how can it be prevented?
Answer template
"Write skew is a form of anomaly that can happen under snapshot isolation when two concurrent transactions read overlapping data, make disjoint updates, and then commit, leaving the database in an invalid state. To prevent it, you can raise the isolation level to Serializable, add explicit locking on the rows involved, or redesign the schema to enforce the invariant in a single transaction."
Typical follow‑up
"Can you share a concrete example where write skew surfaced in production?"
10. How do you measure the impact of ACID enforcement on latency?
Answer template
"I instrument the commit path with timing tags: log‑write latency, lock‑acquire time, and replication sync time. By aggregating these metrics in a monitoring system, I can see the contribution of each stage. In one project we reduced commit latency from ~120 ms to ~80 ms by moving from Serializable to Read Committed and tuning the WAL flush interval, while still meeting our SLA for data integrity."
Typical follow‑up
"What alert thresholds did you set to catch regressions?"
How to practice this
- Record yourself – Use Call Assistant to capture your spoken answer, then replay it to check pacing and filler words.
- Swap roles – Pair with a peer; one asks the question, the other answers, then the asker follows up with the typical next question.
- Add data – Insert a concrete metric or outcome from your own resume into each template so the story feels personal and credible.
FAQ
- Q: Do I need to memorize all ACID properties verbatim? A: No. Focus on the core ideas and a couple of concrete examples; interviewers care more about how you apply the concepts.
- Q: How deep should I go into isolation level internals? A: Aim for a clear high‑level explanation and be ready to dive into lock types or snapshot mechanics if prompted.
- Q: Is it okay to admit I haven’t used a particular isolation level? A: Yes, acknowledge the gap, then describe how you would evaluate its trade‑offs based on the system’s requirements.
- Q: Should I bring up performance numbers in every answer? A: Include numbers only when they reinforce a point; vague ranges (“around 30 % improvement”) are fine if exact figures aren’t at hand.
Frequently asked questions
Do I need to memorize all ACID properties verbatim?
No. Focus on the core ideas and a couple of concrete examples; interviewers care more about how you apply the concepts.
How deep should I go into isolation level internals?
Aim for a clear high‑level explanation and be ready to dive into lock types or snapshot mechanics if prompted.
Is it okay to admit I haven’t used a particular isolation level?
Yes, acknowledge the gap, then describe how you would evaluate its trade‑offs based on the system’s requirements.
Should I bring up performance numbers in every answer?
Include numbers only when they reinforce a point; vague ranges (“around 30 % improvement”) are fine if exact figures aren’t at hand.
#concept questions#ACID transactions#interview prep#database design#technical interview