FrontendPro

136Design Amazon/Flipkart checkout: pricing, cart synchronization, payments, and failure recovery

hardAbout 60 minutesSystem designcheckoutpaymentsidempotencye-commercesystem-design

Problem

Design the frontend of an e-commerce cart and checkout like Amazon or Flipkart:

  • a cart that stays in sync across devices and tabs, including for guests who later log in;
  • prices, discounts, taxes and delivery charges that are always correct, even when prices or stock change during checkout;
  • address and delivery-slot selection, payment with cards, UPI and wallets, including redirects to banks or apps;
  • no double charges and no lost orders when users double-click, refresh, lose the network or return from a payment app;
  • a fast, trustworthy experience during a big sale with heavy traffic.

Step-by-step

The server owns prices, stock, discounts and the final total. The client shows them, collects choices, and never computes the amount that will be charged.

Unlock the full solution

What's inside

  • Step-by-step
  • Requirements
  • Architecture
  • Data model and state
  • Key flows and trade-offs
  • Performance and reliability
  • Follow-up questions

Includes 2 code listings, 4 follow-up questions.

One-time payment by UPI, card or net banking. Launch price.

All 150 answersOne payment, yours forever