Optimistic vs Pessimistic Locking

Start Timer

0:00:00

Let’s say we’re designing a workflow to update user account balances in a banking app, where each transfer involves deducting $100 from one account and adding it to another.

How would you implement this as an SQL transaction, and would you use optimistic or pessimistic locking to handle potential race conditions? Why?

.
.
.
.
.
Topic
Concurrent & Distributed Systems
Tags
SQL
Optimistic Locking
Category
Case Study
Position
Software Engineer
Data Engineer
Difficulty
Easy
Success
N/A
Last asked
This question was asked on September 28, 2026
Companies
What did you think?


Comments

Loading comments