Optimistic Concurrency for Two Editors Saving the Same Custom GPT
Last updated: November 29, 2026
Quick Overview
Two builders open the same custom GPT configuration in different tabs, edit different fields, and both click save; the second save silently wipes the first. Use optimistic concurrency control with a version column to detect the conflict, and show how to retry safely for mergeable edits.
OpenAI
November 29, 20260
0
0 solved
Two builders open the same custom GPT configuration in different tabs, edit different fields, and both click save; the second save silently wipes the first. Use optimistic concurrency control with a version column to detect the conflict, and show how to retry safely for mergeable edits.
Custom GPTs and project settings in ChatGPT can be edited by several people in a workspace. This databases and transactions question checks whether the candidate understands lost updates, why read-modify-write needs a guard, and when to choose optimistic over pessimistic locking.
What the Interviewer Expects
- Names the lost update anomaly and shows the interleaving
- Adds a version column and a conditional UPDATE
- Uses rowcount to detect conflict within one transaction
- Distinguishes auto-retry for mergeable changes from surfacing conflicts to users
- Compares with SELECT FOR UPDATE and isolation levels
Key Topics to Cover
How to Approach This
- Apply SOLID principles. Single Responsibility makes code testable, Open/Closed makes it extensible.
- Choose data structures based on access patterns, not familiarity.
- Prefer immutable data and message passing over shared mutable state for concurrency.
- Design APIs with RESTful conventions, versioning, meaningful errors, and pagination from day one.
Possible Follow-up Questions
- Would SERIALIZABLE isolation alone fix this for a web app with long edit sessions?
- How would you merge field-level changes instead of rejecting the whole save?
- How does an ETag and If-Match header expose this in a REST API?
- What happens under heavy contention on one row?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice System Design ProblemsSample Answer
Requirements
Saving must fail loudly if the config changed since the client loaded it. Server-side mutations that can be re-applied (append a tool) should retry automatically. Works with ordinary SQL....
High-Level Design
Lost update: A reads v1, B reads v1, A writes, B writes and overwrites A. Holding a row lock for the minutes a human spends editing is not an option, so use optimistic control: each row has version;...