You are asked two separate system design questions.
1. Design an online event ticketing platform (like Ticketmaster)
Design a large-scale web service where users can:
-
Browse events (concerts, sports, theater) by city/date/venue.
-
View seating charts and real-time seat availability.
-
Select specific seats and purchase tickets.
-
Receive a digital ticket/QR code.
Assume:
-
Millions of users, with traffic spikes when popular events go on sale.
-
Each event has a finite set of seats, and overselling must not happen.
-
There may be waitlists or temporary seat holds while a user is checking out.
Describe a high-level design that covers:
-
Main functional requirements and non-functional goals (availability, consistency, latency).
-
Core APIs (e.g., search events, hold seats, purchase tickets).
-
Data model for events, venues, seats, reservations, and orders.
-
How to prevent double-booking the same seat under high concurrency.
-
Overall architecture: services, databases, caches, message queues.
-
Strategies for scaling, handling flash-sale spikes, and ensuring reliability.
2. Design an online coding practice & interview-prep platform
Design a web platform where users can:
-
Browse and search a catalog of coding problems by tags/difficulty.
-
View problem statements and constraints.
-
Write code in the browser in multiple languages.
-
Run code against sample tests and hidden test cases.
-
Submit solutions and see whether they passed, with basic statistics.
Assume:
-
Millions of registered users, globally distributed.
-
Spiky traffic (e.g., evenings and weekends are busier).
-
Code must run in a secure, resource-isolated environment.
Describe a high-level design that covers:
-
Key functional requirements and non-functional goals.
-
Core APIs (e.g., list problems, get problem details, submit code, get results).
-
Data model for users, problems, test cases, submissions, and results.
-
Architecture for the code-execution service (sandboxing, job queue, worker nodes).
-
Storage choices for code, problem metadata, and execution logs.
-
Strategies for scaling, ensuring fairness in resource usage, and system reliability.
For both systems, state reasonable assumptions and provide a clear, component-level architecture with major trade-offs explained.