Skip to content
SD-38 · System design

Design a Social Marketplace

Asked at Mid level45 minutes
Our answers stay hidden until you reveal them.

Design a marketplace inside a large social network, where people sell things to others nearby. A seller posts a listing with photos, a price, a category and a location; buyers browse and search listings near them, filter by price and category, open a listing to see the seller’s profile and mutual friends, and message the seller through the network’s messenger. Sellers mark items sold, renew or delete them.

The social network has billions of accounts, and the marketplace has 30 million daily users and 150 million live listings, with 5 million new ones a day. The hard parts are search that mixes words, filters and distance over 150 million listings in under 200 ms, keeping that search index in step with the database so sold items vanish, delivering photos (most of the bytes), and keeping scams and banned goods out.

Good questions to ask first

Decide what you would assume for each before you look at ours.

  1. 1How many users and listings?
  2. 2How far do people search?
  3. 3How fresh must search be?
  4. 4Photos per listing?
  5. 5Do we handle payments?
  6. 6Messaging?
  7. 7How long does a listing stay up?
  8. 8Who sees a listing?

How to spend the 45 minutes

  1. 5minPart 1: Requirements and scope
  2. 5minPart 2: Estimates
  3. 5minPart 3: API
  4. 15minPart 4: Architecture, stage by stage
  5. 15minPart 5: Search, index sync and trust
Sketch your own design: boxes, arrows and the numbers that matter. Then compare it with ours.Break it in the labVisual walkthrough