← Questions

Design a basic task management system

0
AmazonSystem designLast asked Sep 2025

A system design interview question asked in Amazon's technical phone screen, last asked Sep 2025. It tests crud, apis and data modeling.

Design a simple task management system. Users add tasks, mark them completed, and list them.

Requirements

  • Functional: add a task with a unique id and a description; mark a task completed by id; list all incomplete tasks; list all completed tasks; get a task by id.
  • Non-functional: safe when several requests change tasks at once; consistent (a task is never both completed and incomplete in the lists); fast lists as the number of tasks grows; easy to test.

Clarifying questions

  • One user, or many users each with their own tasks?
  • In memory only, or must tasks survive a restart?
  • Can a completed task be reopened? Can tasks be deleted?
  • How many tasks, and do lists need pagination?

What a strong answer covers

  • Data model: Task(id, description, status, created_at, completed_at), and an API or class with add_task, complete_task, incomplete_tasks, completed_tasks, get_task.
  • Storage choice argued: in memory (a map by id plus a set or ordered map per status) for a single process, a database table with an index on (status, created_at) once it must persist or scale.
  • Thread safety: a lock around changes in memory, or a single conditional update (UPDATE … SET status = 'done' WHERE id = ? AND status = 'open') in the database; idempotent completion.
  • ID generation: auto-increment (ordered, but a single point of contention and hard to shard), UUIDs (no coordination, no order), time-ordered ids such as UUIDv7 or Snowflake ids (ordered and shardable); a hash of timestamp plus attributes risks collisions.
  • Performance: pagination with cursors, indexes for each list.
  • Testing: unit tests for each operation and invalid ids, concurrency tests that complete the same task from many threads.

Follow-ups

  • Add due dates and reminders for tasks that are due soon.
  • Add teams, assignments and permissions.
  • The system grows to millions of users. How do you shard the tasks?

Where it's asked

  • Amazon · Technical phone screen · Last asked Sep 202560 min · Live coding in a shared editor that does not run code, plus Leadership Principles questions · No AI

What it tests

crud · apis · data modeling

Your canvas
Draw your answer hereBoxes, arrows and notes, saved for you to come back to.Sign in to start drawing