Skip to interview prep
Apexed

60. Two staff members edit the same stock count and one change disappears. What would you investigate and change?

MediumDatabases

Technical
Show model answer

Trace whether both clients read the same version and then overwrite it. Choose a strategy based on the operation: an atomic increment for a quantity adjustment, or optimistic concurrency using a version check for replacing a complete record.

On a conflict, return enough information to refresh and reconcile rather than silently overwriting. Test simultaneous writes and retries. Use transactions or locking when the business invariant spans several records and a version check on one row is insufficient.

What interviewers listen for

  • Identify the lost-update path
  • Match control to the operation
  • Visible conflict recovery
Two staff members edit the same stock count and one change disappears. What would you investigate and change — Software engineering interview question — Apexed