Collaborative Shopping

Design a collaborative shopping experience where multiple people share a single cart in real time, add and remove items concurrently, and one designated participant checks out on behalf of the group.

00

Practice checkpoints

The requirements are open as a taste. From the numbers onward, the full guide opens in the app.

  1. 01
    Clarify scope
  2. 02
    Requirements + scale
  3. 03
    API + data modelUnlocks in the app
  4. 04
    Draw architectureUnlocks in the app
  5. 05
    Deep diveUnlocks in the app
  6. 06
    Trade-off decisionUnlocks in the app
01

Requirements that shape the design

Do not only state requirements. Ask for them. Each card pairs the design constraint with a clarification question you can say out loud before drawing the architecture.

Functional requirements

01One live shared cart, or separate carts merged at the end?

One live shared cart: every member sees the same line items within a heartbeat, and any member’s edit shows up for everyone — merging private carts at checkout is a different, much easier product.

02What can each member do — add, remove, change quantities?

All three, concurrently: adds, removes, and quantity changes from any member must converge to one agreed cart without anyone waiting for a turn.

03Who pays — anyone, or one designated buyer?

Exactly one designated buyer may check out for the group; the role can be handed off mid-session, but at any instant only one member holds it.

04What happens to an edit that arrives during checkout?

The cart freezes the moment checkout starts: the buyer pays for exactly the cart they confirmed, and late edits are rejected with a visible checkout-in-progress state, never merged silently.

05Do members see who changed what?

Yes: every line item carries who-added and who-changed metadata, and resolved conflicts are surfaced (“Maya removed this item”) instead of applied invisibly.

06What does a member who dropped offline come back to?

A reconnecting member syncs forward from their last seen cart version, and any edit they queued offline replays with a client operation ID so it is neither lost nor applied twice.

Out of scopeProduct catalog, search, and recommendations · Payment processing internals (the Payment System question) · Splitting the bill between members after purchase

Non-functional requirements

01How fast must my edit appear on everyone else’s screen?

Edits appear on every member’s screen in about 150 ms — slower than a heartbeat and people re-add items they think never registered, manufacturing the very conflicts the design must resolve.

02Two edits race — can two members end up seeing different carts?

All screens converge: the server stamps every accepted edit with a monotonic per-cart version, so clients apply the same order and cannot end up holding different carts.

03What is the consistency bar at checkout?

Checkout is exactly-once: a lease makes it a critical section, a second submit is rejected, and the winning buyer’s own retry after a timeout stays safe because the lease token makes it idempotent.

04Is “who is viewing right now” stored like the cart itself?

Presence (who is viewing right now) is ephemeral socket state with a TTL (time-to-live — it expires on its own); cart line items are durable rows — the two layers never share a store.

05Where does scale pressure actually come from here?

The scaling pressure is fan-out (group size × edit rate), not storage: carts are kilobytes, so the design optimizes the push path, not the write path.

Keep asking — the interview is a conversation

Real interviews probe far more than a tidy list. These are the scope questions that separate candidates who interrogate the problem from those who recite it.

  • How large is a typical group — three friends or a fifty-person office order? Fan-out cost and conflict math both hang on this.
  • When two members set the same quantity differently, is latest-wins with a visible notice acceptable, or must quantities merge (both adds count)?
  • Can the buyer role change mid-session, and who is allowed to hand it off?
  • Do we hold inventory while people are still shopping, or only once checkout starts?
  • How long may a cart sit idle before we expire it and release anything it holds?
01

Unlock the full playbook for Collaborative Shopping

Numbers, architecture diagram, API and data model, deep dives, expected topics, self-check, whiteboard starter, and common mistakes unlock inside the app.

02

Numbers that force architecture decisions

Locked in the app

03

Architecture path

Locked in the app

04

API and data model

Locked in the app

05

Deep dive directions

Locked in the app

+Series

Practice the related series