Interview practice question
Concurrent updates through an API
System Design · APIs and Communication · Experienced
Two admins edit the same product through your API at the same time, and one overwrites the other's change. How do you prevent this at the API level?
What a strong answer covers
Your AI report card counts how many of these ideas you cover.
- Optimistic concurrency with ETags/versions.
- Client sends If-Match header.
- 412 Precondition Failed on mismatch.
- Client reloads and merges.
- PATCH for partial updates.
Practise this topic
Start without signing up. Sign in free to get an AI report card on your answer.