Design an e-commerce platform like Amazon or eBay

Quick Overview

Design an online store where users sign in, search a product catalog, keep a cart, pay securely and track their orders. It tests how you split services, choose storage for each access pattern, reserve stock so items are not oversold, and keep checkout correct when calls fail or are retried.

Design an e-commerce platform like Amazon or eBay

Role: Software Engineer

Category: System Design

Difficulty: hard

Interview Round: Other

Design an e-commerce platform similar to Amazon or eBay. The system should let users sign in, find products, manage a cart, and check out securely with order tracking. The platform must support these functional requirements: 1. Users can sign in, so their cart and order history persist. 2. Users can browse products by category and search by keyword, and see key details such as price. 3. Users can add, update and remove items in a cart, and the cart is saved for logged-in users. 4. Users can place orders, view their order history and track order status. 5. Payments support multiple methods (for example, credit cards) and refunds, and are handled securely. 6. Stock updates in real time: it goes down when an order is placed and back up when an item is returned. ```hint Decide how stale each piece of data may be Go through the data the platform shows and stores, and ask which of it can be a few seconds out of date without harm and which cannot. Let that answer drive each service's storage choice. ``` ```hint Follow one unit of stock Trace a single item from search to a paid order. Look for every point where two buyers could both get the last unit, or where a unit could stay held after a buyer walks away. ``` ```hint Break checkout on purpose Assume any call during checkout can time out or be retried. Check that a user is never charged twice and that a paid order is never lost. ``` ### Constraints & Assumptions - The interviewer gives these non-functional targets as examples: favor availability over consistency, keep page loads under 300 ms, and keep uptime at 99.9%. - The list is open-ended. Propose any other targets the design needs (scale, latency per operation, security) and justify them. ### Clarifying Questions to Ask - How many daily active users, products and orders per day should the design handle, and how large are the peaks during sales? - Is this a single retailer, or a marketplace where third-party sellers list their own stock? - Should carts persist for guests too, and should a guest cart merge into the user's cart at sign-in? - Should adding an item to the cart hold stock, or is stock held only at checkout? - Are notifications, reviews and seller tools in scope, or can they be left out? ### What a Strong Answer Covers - Agreed scope, non-functional targets, and estimates for traffic and storage that show how reads compare with writes. - A data model for users, products, inventory, carts, orders and payments, with APIs for search, cart changes, order creation, payment and order tracking. - A service breakdown in which each service's storage choice is justified by its access pattern and consistency needs. - How stock is checked, reserved, committed and released so items are not oversold during traffic spikes. - How checkout stays correct when calls fail or are retried (no double charges, no lost paid orders, accurate order status), with card data handled in a PCI-compliant way. ### Follow-up Questions - A sale offers 1,000 units of one product and 100,000 users try to buy within a minute. What changes in the design? - The payment provider charges the card, but your service times out before it records the result. How does the system recover without charging twice or losing the order? - How would you add third-party sellers, each with their own inventory and payouts? - How do you keep the search index in sync with catalog and price changes, and how stale may it be?

Overview: Design an online store where users sign in, search a product catalog, keep a cart, pay securely and track their orders. It tests how you split services, choose storage for each access pattern, reserve stock so items are not oversold, and keep checkout correct when calls fail or are retried.

Nov 25, 2026
hardSoftware EngineerOtherSystem Design
0
0

Design an e-commerce platform similar to Amazon or eBay. The system should let users sign in, find products, manage a cart, and check out securely with order tracking.

The platform must support these functional requirements:

  1. Users can sign in, so their cart and order history persist.
  2. Users can browse products by category and search by keyword, and see key details such as price.
  3. Users can add, update and remove items in a cart, and the cart is saved for logged-in users.
  4. Users can place orders, view their order history and track order status.
  5. Payments support multiple methods (for example, credit cards) and refunds, and are handled securely.
  6. Stock updates in real time: it goes down when an order is placed and back up when an item is returned.

Constraints & Assumptions

  • The interviewer gives these non-functional targets as examples: favor availability over consistency, keep page loads under 300 ms, and keep uptime at 99.9%.
  • The list is open-ended. Propose any other targets the design needs (scale, latency per operation, security) and justify them.

Clarifying Questions to Ask Guidance

  • How many daily active users, products and orders per day should the design handle, and how large are the peaks during sales?
  • Is this a single retailer, or a marketplace where third-party sellers list their own stock?
  • Should carts persist for guests too, and should a guest cart merge into the user's cart at sign-in?
  • Should adding an item to the cart hold stock, or is stock held only at checkout?
  • Are notifications, reviews and seller tools in scope, or can they be left out?

What a Strong Answer Covers Guidance

  • Agreed scope, non-functional targets, and estimates for traffic and storage that show how reads compare with writes.
  • A data model for users, products, inventory, carts, orders and payments, with APIs for search, cart changes, order creation, payment and order tracking.
  • A service breakdown in which each service's storage choice is justified by its access pattern and consistency needs.
  • How stock is checked, reserved, committed and released so items are not oversold during traffic spikes.
  • How checkout stays correct when calls fail or are retried (no double charges, no lost paid orders, accurate order status), with card data handled in a PCI-compliant way.

Follow-up Questions Guidance

  • A sale offers 1,000 units of one product and 100,000 users try to buy within a minute. What changes in the design?
  • The payment provider charges the card, but your service times out before it records the result. How does the system recover without charging twice or losing the order?
  • How would you add third-party sellers, each with their own inventory and payouts?
  • How do you keep the search index in sync with catalog and price changes, and how stale may it be?