LLD Schema Design Lab
ScaleDojo Learn: LLD Fundamentals
Master database schema design, entity relationships, constraints, and data modeling step by step.
Or read the history behind it
The Schema Chronicles - Evolution of relational databases and modern data modeling
Big Billion Days
A high-pressure system design and engineering challenge inspired by the scale of Big Billion Days. Design a system that can handle millions of users, massive traffic spikes, real-time inventory updates, concurrent orders, payments, and flash-sale demand without compromising performance or reliability.
Compare stats and compete with top...
CHALLENGE MAP
Progressive Schema Design Curriculum
Solve levels sequentially - each clear unlocks the next challenge
Act 1
#1 The Passenger Manifest
EasyFresherAmazonGoogleDesign a complete passenger registry for the RMS Titanic's fateful maiden voyage from Southampton to New York.
#2 Cabin Assignments
EasyFresherAmazonGoogleMap each first-class passenger to exactly one private cabin aboard Titanic. Design the 1:1 relationship between passengers and cabins.
#3 Crew Departments
EasyFresherAmazonMicrosoftOrganize all 885 Titanic crew members into their proper departments. Design the 1:Many relationship between departments and crew.
#4 Ticket Booking Ledger
EasyFresherAmazonStripeTrack the complete booking lifecycle - from initial purchase through upgrades, cancellations, and refunds - with proper financial precision.
#5 Grand Dining Reservations
MediumSDE 1AmazonAirbnbDesign the grand first-class dining reservation system - passengers, tables, sittings, and seat assignments in an elegant Many-to-Many schema.
#6 Cargo Hold Cleanup (1NF)
MediumSDE 1AmazonGoogleThe cargo manifest is riddled with data quality nightmares - comma-separated values, repeating groups, and atomic violations. Fix the 1NF mess.
#7 Mail Room Sorting (2NF)
MediumSDE 1AmazonMicrosoftThe Titanic's mail room tracking system has redundant data scattered everywhere. Eliminate the partial dependencies to achieve Second Normal Form.
#8 Lifeboat Allocation
MediumSDE 1AmazonGoogleDesign the lifeboat allocation system with CHECK constraints, capacity limits, and priority boarding rules enforced at the schema level. It also links to the passengers table from an earlier level - add it as a stand-in with just an id so that link can be drawn.
#9 SOS Communication Log
HardSDE 2AmazonStripeBuild an immutable communication log with soft deletes and a tamper-proof audit trail for every Marconi wireless message sent or received.
#10 Survivor Registry
HardSDE 2AmazonMicrosoftDesign the ultimate integration challenge - link survivors to passengers, crew, lifeboats, and medical records across every table built in Act 1. It also links to tables from earlier levels (passengers, crew and lifeboats) - add each as a stand-in with just an id so those links can be drawn.
Act 2
#11 The Harvard Face Book
MediumSDE 1MetaDesign the foundational user profile table for a campus social network - unique emails, house affiliations, and proper indexing for fast lookups.
#12 Friend Requests
HardSDE 2MetaLinkedInModel bidirectional friendships using a self-referencing Many-to-Many pattern with canonical ordering to prevent duplicate rows.
#13 The Wall (Posts & Media)
HardSDE 3MetaBuild a polymorphic content system - text posts, photo posts, and link shares - each with different metadata, plus likes and comments. It also links to the users table from an earlier level - add it as a stand-in with just an id so that link can be drawn.
#14 News Feed Engine
HardSDE 3MetaX (Twitter)Design a pre-computed feed table that denormalizes data for read performance - the classic fan-out-on-write pattern.
#15 Photo Albums (Hierarchical Data)
HardSDE 2MetaModel nested photo albums as a tree structure using self-referencing parent_id and materialized paths for efficient subtree queries. It also links to the users table from an earlier level - add it as a stand-in with just an id so that link can be drawn.
#16 Events & RSVPs
HardSDE 3MetaLinkedInDesign the events system with complex M:M RSVP metadata, recurring event patterns, and invitation tracking. It also links to the users table from an earlier level - add it as a stand-in with just an id so that link can be drawn.
#17 Privacy & Access Control
HardSDE 3MetaDesign granular privacy controls - visibility enums, custom audience lists, and a blocked users system for row-level security modeling. It also links to the users table from an earlier level - add it as a stand-in with just an id so that link can be drawn.
#18 Notification Engine
HardSDE 3MetaLinkedInBuild the complete notification system - type registry, user preferences, read/unread tracking, and aggregation grouping for the Act 2 capstone. It also links to the users table from an earlier level - add it as a stand-in with just an id so that link can be drawn.
Act 3
#19 Broker Registry (RBAC)
HardSDE 2AmazonMicrosoftDesign a flexible Role-Based Access Control system where permissions are data-driven, not hardcoded - roles, permissions, and a mapping between them.
#20 Client Portfolios
HardSDE 3StripePayPalDesign financial data tables with DECIMAL precision - clients, accounts, stocks, and portfolio holdings where rounding errors are unacceptable. It also links to the brokers table from an earlier level - add it as a stand-in with just an id so that link can be drawn.
#21 Trade Engine (Double-Entry Ledger)
HardSDE 3StripePayPalDesign a trade execution system with double-entry bookkeeping - every buy creates a debit and credit, and the ledger must ALWAYS balance. It also links to tables from earlier levels (accounts and stocks) - add each as a stand-in with just an id so those links can be drawn.
#22 Commission Tracking
HardSDE 2StripeUberDesign tiered commission calculations stored as configurable data - rates that change over time, splits between broker and firm, and payout tracking. It also links to tables from earlier levels (roles, trades and brokers) - add each as a stand-in with just an id so those links can be drawn.
#23 Client Onboarding (State Machine)
HardSDE 3StripePayPalModel a state machine in the database - defined states, valid transitions between them, and a document management workflow for KYC compliance. It also links to the clients table from an earlier level - add it as a stand-in with just an id so that link can be drawn.
#24 SEC Audit Trail
HardSDE 3StripePayPalBuild a tamper-proof, append-only audit log with hash-chain integrity - every action is recorded, nothing can be modified, and tampering is detectable.
#25 Multi-Currency Trading
HardSDE 2StripePayPalExtend the trading platform for international markets - currency tables, historical exchange rates, and point-in-time rate lookups.
#26 Risk & Margin System
HardSDE 3StripePayPalDesign a risk monitoring system with exposure limits, margin thresholds, and portfolio snapshots for real-time alerting. It also links to the accounts table from an earlier level - add it as a stand-in with just an id so that link can be drawn.
#27 IPO Pipeline (Workflow Engine)
HardSDE 3MicrosoftAmazonDesign a multi-stage workflow engine with parallel stages, multi-approver patterns, and stage dependencies for managing IPO deals.
#28 Market Data Feed (Time-Series)
HardSDE 3AmazonDesign a time-series data architecture - high-frequency tick ingestion, OHLCV candle aggregation, table partitioning, and tiered storage policies. It also links to the stocks table from an earlier level - add it as a stand-in with just an id so that link can be drawn.
#29 Regulatory Reporting (Star Schema)
HardSDE 3AmazonMicrosoftDesign a data warehouse star schema - fact tables for trades, dimension tables for date/client/stock, and Slowly Changing Dimensions (SCD Type 2).
#30 Stratton Oakmont - Complete Platform
HardStaff+StripePayPalThe Act 3 capstone - join brokers and their roles, clients and accounts, orders, trades and ledger entries, commissions, risk profiles and an audit trail into ONE unified schema of 11+ tables.
Act 4
#31 Mission Control (Distributed Data)
ExpertSDE 3AmazonDesign distributed data schemas with vector clocks, conflict resolution, and sync tracking across 12 Lazarus missions where time dilation warps every timestamp.
#32 Endurance Telemetry (IoT Schema)
ExpertSDE 3AmazonDesign a high-frequency IoT sensor schema for the Endurance spacecraft with raw ingestion, rollup aggregation tables, and threshold-based alert tracking.
#33 Planet Habitability Database
ExpertSDE 3GoogleAmazonDesign a scientific data catalog with weighted scoring, measurement uncertainty tracking, and composite habitability rankings for candidate planets. It also links to the missions table from an earlier level - add it as a stand-in with just an id so that link can be drawn.
#34 Cryo-Sleep Registry (Bi-Temporal Data)
ExpertStaff+MicrosoftDesign a bi-temporal data model that tracks crew vitals across two time dimensions: Valid Time (when the measurement was true in reality) and Transaction Time (when it was recorded in the database) - alongside each crew member's cryo-sleep sessions.
#35 Resource Allocation (Optimization)
ExpertSDE 3AmazonDesign an inventory management system with consumption tracking, depletion projections, and scenario modeling for a spacecraft with finite, irreplaceable resources.
#36 TARS Message Protocol (Queue Schema)
ExpertSDE 3AmazonDesign a relational message queue with guaranteed delivery, idempotent consumption, dead letter handling, and retry with exponential backoff for interstellar communications.
#37 Wormhole Navigation (Graph in SQL)
ExpertSDE 3GoogleUberModel a directed weighted graph of spatial anomalies connected by wormholes using an adjacency list pattern, with computed shortest paths and self-referencing constraints.
#38 Colony Data (Schema Versioning)
ExpertSDE 3AmazonGoogleDesign a migration tracking and schema versioning system that records every structural change to the database, supports rollback, and maintains a live registry of all tables and columns.
#39 Quantum Data (CQRS Pattern)
ExpertStaff+MicrosoftDesign a CQRS (Command Query Responsibility Segregation) architecture with separate write-optimized event logs and read-optimized projection tables for Tesseract gravity data.
#40 Cooper Station - Humanity Reborn
LegendaryStaff+MicrosoftAmazonDesign the complete data architecture for Cooper Station - humanity's new home orbiting Saturn - with citizens, zones, resources, healthcare, governance, and cross-domain event tracking using DDD bounded contexts.
Act 5
#41 The Power Plant (Billion-Scale Schema)
LegendaryStaff+GoogleAmazonDesign a billion-scale schema for 6.8 billion human pods with sub-millisecond lookups, partition strategies, and optimal key selection.
#42 Agent Smith Tracking (Replication)
LegendarySDE 3MetaLinkedInDesign a self-referencing replication tree tracking Agent Smith clones, their lineage, generation depth, and the pods they override.
#43 Anomaly Detection (Pattern Schema)
LegendarySDE 3StripePayPalDesign an anomaly detection system with configurable pattern rules, event correlation, and threat scoring for Matrix glitches.
#44 The Construct (Skill Tree Schema)
LegendarySDE 3MicrosoftDesign a skill tree system with prerequisite DAGs, mutual exclusion constraints, and progression tracking for uploading combat programs into operatives.
#45 Zion Access Control (Zero-Trust)
LegendaryStaff+GoogleMicrosoftDesign a zero-trust access control system with MFA, device trust, session management, policy-based authorization, and real-time revocation after Cypher's betrayal.
#46 The Source Code (Version Control Schema)
LegendaryStaff+MicrosoftDesign a Git-like version control system in relational tables with repositories, branches, immutable commits, file snapshots, and diff tracking.
#47 Machine City (Multi-Tenant)
LegendarySDE 3AmazonMicrosoftDesign a multi-tenant architecture for 12 Matrix instances with tenant isolation, shared infrastructure tables, and provisioning workflows.
#48 The Prophecy Engine (Rules Engine)
LegendarySDE 3StripePayPalDesign a configurable rules engine with nested condition trees, ordered action outcomes, rule versioning, and evaluation logging.
#49 Matrix Reload (Migration Orchestration)
LegendaryStaff+AmazonDesign a phased migration orchestration system with checkpoint snapshots, rollback scripts, validation checks, and detailed logging for upgrading 6.8 billion rows.
#50 The Architect's Masterpiece
LegendaryStaff+MicrosoftAmazonDesign the core of the Matrix data architecture across its bounded contexts - pods, agents, surveillance, identity, and cross-domain events - as the ultimate capstone challenge.
Act 6
#51 The Menu Board
HardSDE 2DoorDashDesign the product catalog for a fast-food chain where the same menu item can carry a different price - or not exist at all - at different locations.
#52 Franchise Territory Rights
HardSDE 2DoorDashDesign the franchise agreement system: a franchisee licenses an exclusive territory, and every agreement keeps its dates so a territory's history of holders is preserved.
#53 The Speedee Service System
HardSDE 2DoorDashModel the kitchen order pipeline: an order moves through prep stations in sequence, and every station transition is timestamped.
#54 Supply Chain Standardization
HardSDE 2AmazonDesign the supplier and distribution schema that guarantees every restaurant gets identical ingredients, sourced through approved channels only.
#55 Real Estate Empire
ExpertSDE 3AirbnbDesign the real estate holding structure that makes the company landlord to every one of its own franchisees - the twist that makes the empire actually profitable. It also links to the franchisees table from an earlier level - add it as a stand-in with just an id so that link can be drawn.
#56 Royalty & Rebate Engine
ExpertSDE 3StripePayPalDesign the schema that calculates monthly royalty owed on gross sales and reconciles it against supplier rebates earned on standardized purchasing. It also links to tables from earlier levels (franchise_agreements and suppliers) - add each as a stand-in with just an id so those links can be drawn.
#57 Multi-Location Inventory
ExpertSDE 3AmazonDesign a stock-tracking schema that covers per-location inventory levels, transfers between restaurants, and automatic reorder triggers. It also links to the restaurants table from an earlier level - add it as a stand-in with just an id so that link can be drawn.
#58 Franchise Performance Scorecard
ExpertSDE 3DoorDashDesign the compliance and performance auditing system, including anonymous mystery-shopper inspections and a formal underperformance flagging process. It also links to tables from earlier levels (restaurants and franchise_agreements) - add each as a stand-in with just an id so those links can be drawn.
#59 National Ad Fund
LegendarySDE 3GoogleMetaDesign a cooperative marketing fund: every restaurant contributes a percentage of sales into a shared pool, and campaigns draw from it with regional allocation and ROI tracking. It also links to the restaurants table from an earlier level - add it as a stand-in with just an id so that link can be drawn.
#60 The Golden Arches Empire
LegendaryStaff+DoorDashCapstone: unify territory rights, real estate leasing, royalty calculation, and compliance into one integrated franchise-empire schema. It also links to tables from earlier levels (territories and properties) - add each as a stand-in with just an id so those links can be drawn.
Act 7
#61 Patient Intake Registry
HardSDE 2AppleDesign the patient intake system: registration, admissions, symptom reporting, and triage priority for a fast-moving outbreak.
#62 Contact Tracing Graph
HardSDE 2AppleGoogleModel the exposure network: who was in contact with whom, when, and for how long - the graph that turns one case into a map of a hundred.
#63 Lab Test Pipeline
HardSDE 2AmazonDesign the specimen-to-result pipeline: collection, test ordering, and results, with turnaround time trackable at every stage. It also links to the patients table from an earlier level - add it as a stand-in with just an id so that link can be drawn.
#64 Hospital Bed Capacity
HardSDE 2AmazonDesign the ward and bed inventory system, including per-bed occupancy and surge capacity for when a normal ward isn't enough. It also links to the patients table from an earlier level - add it as a stand-in with just an id so that link can be drawn.
#65 Quarantine & Isolation Tracking
ExpertSDE 3AmazonDesign the schema for issuing quarantine orders, tracking compliance check-ins, and logging violations that escalate to enforcement. It also links to the patients table from an earlier level - add it as a stand-in with just an id so that link can be drawn.
#66 Vaccine Cold-Chain Logistics
ExpertSDE 3AmazonDesign the vaccine batch and cold-chain shipment schema, with a continuous temperature log that proves - or disproves - a shipment stayed viable.
#67 Epidemiological Case Reporting
ExpertSDE 3AppleGoogleDesign a reportable-disease case schema where every status change - suspected, probable, confirmed, ruled out - is logged, and public-health hand-offs are tracked explicitly. It also links to the patients table from an earlier level - add it as a stand-in with just an id so that link can be drawn.
#68 Transmission Modeling Data
ExpertSDE 3AppleGoogleDesign the schema behind outbreak-cluster analysis: who infected whom, grouped into clusters, feeding a daily effective-reproduction-number time series. It also links to the patients table from an earlier level - add it as a stand-in with just an id so that link can be drawn.
#69 Global Health Data Exchange
LegendarySDE 3AppleGoogleDesign the interoperability layer that lets health jurisdictions share case data under formal agreements, with consent tracked on every exchange. It also links to the reportable_cases table from an earlier level - add it as a stand-in with just an id so that link can be drawn.
#70 CDC Command Center
LegendaryStaff+AppleGoogleCapstone: unify patient intake, contact tracing, quarantine, and case reporting into one command-center schema anchored on the patient.
Act 8
#71 Avatar Creation
HardSDE 2MetaAppleDesign the account and avatar system: one player can own several avatars, and every piece of an avatar's appearance is tracked as its own customization slot.
#72 Inventory & Loot System
HardSDE 2MetaDesign the item catalog and inventory system, distinguishing items an avatar is carrying from items an avatar currently has equipped. It also links to the avatars table from an earlier level - add it as a stand-in with just an id so that link can be drawn.
#73 Quest & Achievement Tracker
HardSDE 2MetaAppleDesign a quest system where some quests require an earlier quest to be completed first - a prerequisite chain pointing back into the same table. It also links to the avatars table from an earlier level - add it as a stand-in with just an id so that link can be drawn.
#74 Guild & Clan System
HardSDE 3MetaDesign the guild membership system as a many-to-many relationship between avatars and guilds, plus an invitation flow with two references back to the same avatars table. It also links to the avatars table from an earlier level - add it as a stand-in with just an id so that link can be drawn.
#75 Matchmaking & Ranked Play
ExpertSDE 3MetaDesign the ranked-match system: a per-mode skill rating, a match record, and a rich junction table capturing each participant's team and rating change. It also links to the avatars table from an earlier level - add it as a stand-in with just an id so that link can be drawn.
#76 Virtual Economy & Marketplace
ExpertSDE 3StripePayPalDesign the item marketplace and a double-entry currency ledger where every trade produces a matching debit and credit. It also links to tables from earlier levels (avatars and items) - add each as a stand-in with just an id so those links can be drawn.
#77 In-Game Crafting System
ExpertSDE 3MetaDesign a crafting system where each recipe requires several material items in specific quantities, and an avatar's crafting jobs are queued, not instant. It also links to tables from earlier levels (items and avatars) - add each as a stand-in with just an id so those links can be drawn.
#78 The Easter Egg Hunt
ExpertSDE 3MetaDesign the schema behind a Halliday-style sequential puzzle hunt: ordered clues, per-avatar solve progress, a completion-time leaderboard, and an anti-cheat audit trail. It also links to the avatars table from an earlier level - add it as a stand-in with just an id so that link can be drawn.
#79 Cross-Server Player Migration
LegendarySDE 3AmazonDesign the schema for transferring a player between regional servers, including a second table for resolving item and name conflicts the migration uncovers. It also links to tables from earlier levels (avatars and items) - add each as a stand-in with just an id so those links can be drawn.
#80 The OASIS
LegendaryStaff+MetaCapstone: unify avatars, inventory, guilds, the marketplace, and quests into one integrated virtual-world schema anchored on the avatar.
Act 9
#81 URL Shortener
EasyFresherX (Twitter)GoogleDesign the schema behind a URL shortener - unique short codes mapped to long URLs, optionally owned by a registered user.
#82 Rate Limiter
EasyFresherStripeAmazonDesign the schema that backs a rate limiter's configuration and audit trail - not the hot-path counter itself (that lives in a cache), but what configures and logs it.
#83 Chat System (WhatsApp)
MediumSDE 1MetaAppleDesign the schema for 1:1 and group messaging - conversations, membership, and an ordered message history.
#84 News Feed System
MediumSDE 1MetaX (Twitter)Design the schema behind a social news feed - posts, who-follows-whom, and a materialized per-user feed table.
#85 Instagram (Photo Sharing)
MediumSDE 2MetaDesign the schema for a photo-sharing app - posts with images, likes, and the follow graph.
#86 Hotel Reservation System
MediumSDE 2AirbnbDesign the schema for hotel room reservations - hotels, their rooms, guests, and date-ranged bookings.
#87 Ride-Sharing (Uber)
HardSDE 3UberDesign the schema for a ride-sharing platform - riders, drivers, ride requests, and the payment tied to each completed ride.
#88 Payment System (Stripe)
HardSDE 3StripePayPalDesign the schema for a payment processor - merchants, their customers, stored payment methods, charges, and refunds.
#89 Food Delivery (DoorDash)
HardSDE 3DoorDashUberDesign the schema for a food delivery platform - restaurants, their menus, customer orders with multiple line items, and driver assignment.
#90 Ticketmaster / Event Ticketing
HardSDE 2Design the schema for an event-ticketing platform - venues, seats, events, and the purchase that claims one specific seat for one specific event.