Interview knowledge
Video

System Design Interview: Design Ticketmaster w/ a Ex-Meta Staff Engineer

by Hello Interview14 Mar 2024

Read the original →

Summary AI-generated

Summarised by an AI assistant when this source was saved. Double-check against the original.

In summary, the most interesting aspect of this transcript is the nuanced CAP theorem application, specifically prioritizing strong consistency for ticket booking while maintaining high availability for search, and the practical solution of using distributed locks and virtual waiting queues to handle massive traffic surges during high-demand events.

  • Follow a structured interview framework: requirements, core entities/APIs, high-level design, and deep dives.
  • Prioritize strong consistency for ticket booking to prevent double-booking, while ensuring high availability for search and event viewing.
  • Implement a two-phase booking process (reserve then confirm) with a 10-minute expiration window.
  • Use a distributed lock (e.g., Redis with TTL) instead of database timestamps or cron jobs to reliably manage ticket reservation expiration.
  • Optimize search performance by integrating ElasticSearch with an inverted index and change data capture (CDC) for data synchronization.
  • Handle massive traffic surges for popular events using a virtual waiting queue to protect backend services and improve user experience.
  • Leverage caching (Redis, CDN, or query caching) to reduce read load on the primary database, given a high read-to-write ratio.
  • Focus interview math/estimations on decisions that directly impact design choices rather than generic back-of-the-envelope calculations.

Notes this inspired

  • Cron jobs to fix data vs TTLGrowing

    Depending on the data you need to fix, if it's simply releasing something, then a TTL on a row is better.

  • API AuthenticationGrowing

    Maybe not straight user ID in api. Jwt json web token contains signed json data about the user, like what role they have. Every request contains a signature that the server can…

  • Search optimised databaseGrowing

    It usually builds an inverted index for fast querying, like: Tokenization: Tokenization is the process of breaking a piece of text into individual words. This allows you to map from words to…

  • Search systemsGrowing

    Postgres is fine to begin with for basic search. Select where like term. When would somethint else be more relevant ? Wildcard search are slow tho, it'll scan the whole db. But…

  • Sync between databasesGrowing

    For example between search and main db. When introducing another database, they need to be synced somehow. Easiest: write to both in app code (what if it fails and also makes it…

  • ElasticSearchGrowing

    It builds an inverted index to make searching documents by terms quickly. Example: taylor: (event1, event2) Tokenization in Elasticsearch is the process of breaking a stream of text characters down into smaller,…

Also cited by

  • System Design interviewEstablished

    Allocate specific time slots: 5m for requirements, 20m for high-level design, 15m for deep dive, and 5m for wrapping up. Define requirements and use cases. functional requirements first, and non-functional requirements if…