Design a Shopping Cart Service That Never Drops Items

Last updated: November 29, 2026

Quick Overview

Design the Amazon shopping cart backend so that add-to-cart always succeeds even during partial outages, carts follow the user across devices, and conflicting edits from two devices merge sensibly.

Amazon
System Design
Software Engineer
Amazon
November 29, 2026
Software Engineer
System Design Round
System Design
Medium

0

0

0 solved


Design the Amazon shopping cart backend so that add-to-cart always succeeds even during partial outages, carts follow the user across devices, and conflicting edits from two devices merge sensibly.

The cart is the classic example of Amazon choosing availability over strict consistency, so interviewers like it for testing whether you can justify that choice. Expect probing on conflict resolution, guest-to-signed-in merges, and how the cart interacts with price and inventory.

What the Interviewer Expects
  • Justify an availability-first data model for writes
  • Represent the cart so concurrent edits can be merged
  • Handle guest carts and the merge at sign-in
  • Keep price and availability as read-time lookups, not stored truth
  • Plan multi-region behavior
Key Topics to Cover
Eventual Consistency
Conflict Resolution
CRDTs
Multi-Region
Session Management
How to Approach This
  1. Start by clarifying functional and non-functional requirements with the interviewer.
  2. Estimate the scale: QPS, storage, bandwidth. This drives your design decisions.
  3. Draw a high-level architecture first, then deep dive into 1-2 critical components.
  4. Discuss trade-offs explicitly (e.g., consistency vs availability, SQL vs NoSQL).
  5. Address failure scenarios, monitoring, and how the system handles 10x traffic spikes.
Possible Follow-up Questions
  • If one device removes an item while another increases its quantity, what wins?
  • How do you show a price change since the item was added?
  • How do you cap cart size and prevent abuse by bots?
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

Functional: add, remove, change quantity, save for later; cart visible on web, app and Alexa; guest carts merge on sign-in. Non-functional: writes must succeed even when a region or replica is impaire...

High-Level Design

A stateless Cart service fronts a DynamoDB global table keyed by cart_id (customer id or guest token), one item per cart line with sort key asin#offer_id. Each region serves local reads and writes...


Submit Your Answer
Markdown supported