Questions: Optimistic Concurrency Control: Version Numbers

5 questions to test your understanding

Score: 0 / 5
Question 1 Multiple Choice

Transaction T1 and T2 both read row id=42 at version=5. T1 updates the row first, bumping it to version=6. T2 then executes: UPDATE accounts SET balance=300, version=6 WHERE id=42 AND version=5. What happens?

AT2's update succeeds and the balance is set to 300
BT2's update matches zero rows — the conflict is detected and T2 must retry
CT2 blocks, waiting for T1 to release a lock before proceeding
DA deadlock is recorded and both transactions are rolled back
Question 2 Multiple Choice

Which workload is most suited to optimistic concurrency control?

AA high-frequency trading platform where many transactions update the same account balance per second
BA content platform where millions of users each update only their own profile data
CA ticket booking system during a flash sale where thousands of users compete for the last 10 seats
DA bank transfer system where strict consistency is enforced across accounts
Question 3 True / False

In optimistic concurrency control, a transaction holds no locks during its read and processing phases.

TTrue
FFalse
Question 4 True / False

Optimistic concurrency control prevents most data conflicts between concurrent transactions by detecting them before they can occur.

TTrue
FFalse
Question 5 Short Answer

Why can optimistic concurrency control perform worse than pessimistic locking under high contention, even though OCC avoids lock overhead?

Think about your answer, then reveal below.