Design LeetCode: A System Design Interview Breakdown
Be able to design a LeetCode-like coding judge platform end-to-end in an interview setting: define functional/non-functional requirements and APIs, safely execute untrusted user code in isolated containers, build an async submission pipeline with queuing and polling, implement real-time competition leaderboards with Redis sorted sets, do the capacity math to justify scaling decisions, and defend every trade-off the way a senior or staff engineer would.
6 sections ยท 13 lessons
Course outline
Framing the Problem
- Functional and Non-Functional Requirements
- Core Entities and API Design
Executing Untrusted Code Safely
- Why Direct Execution, VMs, and Serverless All Fall Short
- Docker Containers as the Isolation Layer
- Universal Test Case Serialization Across Languages
The Submission Pipeline
- Why Synchronous Submission Handling Breaks Under Load
- The Async Flow: Queue, Workers, and Client Polling
Real-Time Competition Leaderboards
- Why Direct DB Queries and Simple Caching Don't Scale
- Redis Sorted Sets for Real-Time Rankings
Scaling to 100,000 Concurrent Users
- Capacity Math: From Submissions to Core Count
- Auto-Scaling, Queue Buffering, and Progressive Polling
Trade-offs and the Interview Bar
- The Six Key Trade-offs in This Design
- What IC4, IC5, and Staff+ Are Expected to Show