Prevent Lost Updates When Two Users Edit the Same Task

Last updated: November 29, 2026

Quick Overview

Two collaborators open the same Asana task and both save changes a few seconds apart. Design and implement a task store that detects the stale write instead of silently overwriting, plus a client helper that retries safely.

Asana
Software Engineering Fundamentals
Software Engineer
Asana
November 29, 2026
Software Engineer
Onsite
Software Engineering Fundamentals
Medium

0

0

0 solved


Two collaborators open the same Asana task and both save changes a few seconds apart. Design and implement a task store that detects the stale write instead of silently overwriting, plus a client helper that retries safely.

Asana is a multiplayer product: the same task is edited from web, mobile, rules and API clients at once, so concurrency control is a daily concern for product engineers. The interviewer checks whether you can explain the lost update anomaly, choose between pessimistic locks and optimistic versioning, and write the compare-and-set correctly.

What the Interviewer Expects
  • Names the lost update problem and shows the interleaving that causes it
  • Chooses optimistic concurrency with a version number and justifies it over row locks for interactive editing
  • Implements an atomic compare-and-set and a bounded retry loop
  • Separates field-level merges (name vs followers) from whole-record conflicts
  • Discusses what the UI shows a user whose write was rejected
Key Topics to Cover
optimistic concurrency
compare-and-set
lost updates
retry loops
version vectors
How to Approach This
  1. Apply SOLID principles. Single Responsibility makes code testable, Open/Closed makes it extensible.
  2. Choose data structures based on access patterns, not familiarity.
  3. Prefer immutable data and message passing over shared mutable state for concurrency.
  4. Design APIs with RESTful conventions, versioning, meaningful errors, and pagination from day one.
Possible Follow-up Questions
  • How would you avoid conflicts entirely when two users change different fields of the same task?
  • How do you implement the same check in SQL without an application lock?
  • What changes if the mutation is not idempotent, such as appending a comment?
  • How would you surface the conflict in the task pane without losing the user's typing?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice System Design Problems
Sample Answer
Requirements

A task has fields (name, assignee, due date, followers). Many clients read then write. A write based on an old read must be rejected, never silently applied. Reads should not block other readers, and ...

High-Level Design

Each task carries a monotonically increasing version. Clients send the version they read. The store applies the write only if the stored version still matches, then bumps it. On mismatch the client ...


Submit Your Answer
Markdown supported