</> 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 11: The Second Life of a Seat - Follow-up Feature Evolution

Executive Summary: The product team wants six things: resale and transfer, registration lotteries, dynamic pricing, multi-show tours, movie theatres and flights. Each gets three beats: what changes, what stays, and which decision bends. The organising question is whether the feature touches the hold. Most work lands before it (who gets admitted), around it (what price it locks) or after the sale (who owns the ticket). Only flights change what a hold means, and there this design hands over to another one.

Interviewer: "You've sold out E-7781. Product has a list. What does each item cost, and what does it break?"

You: "One question for every item: does it change the hold? Section 7 put the business's correctness in one conditional write. If a feature leaves that write alone, it's mostly plumbing."

Resale and Transfer: The Seat Stays Sold

Jordan can no longer use seat 12 in Section 114, Row K, and wants to give it to a friend or resell it.

The tempting build releases the seat (Sold → Available) and lets the buyer hold it again. That throws the seat back into the contention pool for any bot to grab, and it breaks Section 5's state machine, where Sold → Available belongs to the audited refund flow.

Instead, ShowSeat for seat 12 stays Sold, and a transfer is one conditional update on the Ticket row's owner_account, which Section 5 already gave it:

UPDATE tickets
   SET owner_account = :buyer, barcode_secret = :new_secret
 WHERE ticket_id = :tid AND owner_account = :seller;  -- 0 rows: someone else won

It is the hold pattern one level up: a conditional write only one buyer can win. A resale reuses the payment saga (authorise, ownership write, capture, void if the write lost) and pays the seller after the transfer commits. No new ticket row is created, so the unique constraint on (show, seat) is untouched; an append-only ownership history keeps the audit trail.

Two rules make it defensible. An organiser's price cap (often face value) is checked on the listing server-side. And the barcode secret rotates on every transfer, so Jordan's old copy dies when the friend's goes live. Section 10 covers why rotating barcodes defeat screenshot resale. Transfers freeze about an hour before doors, so the secrets gate scanners preload are never stale.

Resale and transfer flow: a primary sale issues a ticket owned by Jordan; a transfer to a friend, or a resale listing with a price cap where the buyer pays through the saga, both go through a conditional owner update that rotates the barcode secret, so the ticket is owned by the new holder whose in-app rotating code the gate validates, while Jordan's old secret after transfer is rejected at the gate

Quick check before moving on:


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.