</> MAANG.io
system design · 301

Advanced

Master system design interviews with scalable architecture patterns, distributed systems, and real-world design challenges.

0/480 solved 0% complete

Section 2: Sold At Most Once - Requirements (Functional & Non-Functional)

Executive Summary: This section turns Section 1's answers into a contract you can test: ten numbered functional requirements, three invariants (a seat is sold at most once, a hold is all-or-nothing, a fan is charged only for seats they receive), and per-path targets rather than one number for "the service". We close by defending the number interviewers push on hardest: why a hold lasts 8 minutes.

The interviewer caps the marker: "So what exactly are we promising?" The weak answer is "fans buy tickets, it's fast, it handles the big on-sale." Nobody can test that. Every line below is something a test could check or an on-call engineer could be paged on.

The Functional Contract

# Requirement What it commits us to
FR1 Browse and search events Event pages; search by artist, city, date. Seconds of staleness are fine.
FR2 Seat map with availability A static layout per venue plus live availability per show, served at most 2 s behind the database.
FR3 Hold seats Specific seats or best-available (a count, optionally a section). All-or-nothing, with an 8-minute expiry. A lost race returns alternatives, not a bare error (Section 4).
FR4 Release Seats return to sale on cancel or expiry, automatically. A declined card leaves the hold in place for another attempt; the seats return when the fan gives up or the hold expires.
FR5 Checkout Pay for a live hold through an external payment provider (PSP). One charge per checkout, however often it is retried.
FR6 Issue tickets Tickets bound to the buyer's account, with a barcode that resists screenshot resale (Section 10).
FR7 Per-account limit At most 4 tickets per show per account, counted across the account's one live hold and its orders. Checked inside the hold, never in the UI.
FR8 Virtual waiting room For hot on-sales: join before the sale, see a position and an estimate, get admitted in a fair order.
FR9 Order history A fan sees their orders and tickets.
FR10 Organiser inventory setup Venue layouts, shows, price tiers, on-sale times. Thin: the back office is out of scope (Section 1).

Walk Jordan through it. At 09:52 Jordan opens show E-7781's page (FR1) and joins the pre-queue (FR8). Once admitted, they pick Section 112, Row F, seats 7–8 (FR2). Seat 8 went a second earlier, so the hold fails as a unit and offers Section 114, Row K, seats 11–12 (FR3). Jordan takes them, two tickets against a limit of 4 (FR7), pays (FR5), and gets tickets in the app (FR6, FR9). Had Jordan closed the tab, the seats would have returned to sale at 10:13:14 on their own (FR4).

Sign in to continue reading

The rest of this lesson is available with a free account. Signing in with Google or Microsoft is free.

Sign in to read the full lesson

Sign in to MAANG.io

Use your Google or Microsoft account — no password to remember.

Continue with Google Continue with Microsoft

Please accept the terms above to continue.