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
The Scale Wars
25% off on all challenges
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
EasyDesign a complete passenger registry for the RMS Titanic's fateful maiden voyage from Southampton to New York.
#2 Cabin Assignments
EasyMap each first-class passenger to exactly one private cabin aboard Titanic. Design the 1:1 relationship between passengers and cabins.
#3 Crew Departments
EasyOrganize all 885 Titanic crew members into their proper departments. Design the 1:Many relationship between departments and crew.
#4 Ticket Booking Ledger
EasyTrack the complete booking lifecycle - from initial purchase through upgrades, cancellations, and refunds - with proper financial precision.
#5 Grand Dining Reservations
MediumDesign 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)
MediumThe 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)
MediumThe Titanic's mail room tracking system has redundant data scattered everywhere. Eliminate the partial dependencies to achieve Second Normal Form.
#8 Lifeboat Allocation
MediumDesign the lifeboat allocation system with CHECK constraints, capacity limits, and priority boarding rules enforced at the schema level.
#9 SOS Communication Log
HardBuild an immutable communication log with soft deletes and a tamper-proof audit trail for every Marconi wireless message sent or received.
#10 Survivor Registry
HardDesign the ultimate integration challenge - link survivors to passengers, crew, lifeboats, and medical records across every table built in Act 1.
Act 2
#11 The Harvard Face Book
MediumDesign the foundational user profile table for a campus social network - unique emails, house affiliations, and proper indexing for fast lookups.
#12 Friend Requests
HardModel bidirectional friendships using a self-referencing Many-to-Many pattern with canonical ordering to prevent duplicate rows.
#13 The Wall (Posts & Media)
HardBuild a polymorphic content system - text posts, photo posts, and link shares - each with different metadata, plus likes and comments.
#14 News Feed Engine
HardDesign a pre-computed feed table that denormalizes data for read performance - the classic fan-out-on-write pattern.
#15 Photo Albums (Hierarchical Data)
HardModel nested photo albums as a tree structure using self-referencing parent_id and materialized paths for efficient subtree queries.
#16 Events & RSVPs
HardDesign the events system with complex M:M RSVP metadata, recurring event patterns, and invitation tracking.
#17 Privacy & Access Control
HardDesign granular privacy controls - visibility enums, custom audience lists, and a blocked users system for row-level security modeling.
#18 Notification Engine
HardBuild the complete notification system - type registry, user preferences, read/unread tracking, and aggregation grouping for the Act 2 capstone.
Act 3
#19 Broker Registry (RBAC)
HardDesign a flexible Role-Based Access Control system where permissions are data-driven, not hardcoded - roles, permissions, and a mapping between them.
#20 Client Portfolios
HardDesign financial data tables with DECIMAL precision - clients, accounts, stocks, and portfolio holdings where rounding errors are unacceptable.
#21 Trade Engine (Double-Entry Ledger)
HardDesign a trade execution system with double-entry bookkeeping - every buy creates a debit and credit, and the ledger must ALWAYS balance.
#22 Commission Tracking
HardDesign tiered commission calculations stored as configurable data - rates that change over time, splits between broker and firm, and payout tracking.
#23 Client Onboarding (State Machine)
HardModel a state machine in the database - defined states, valid transitions between them, and a document management workflow for KYC compliance.
#24 SEC Audit Trail
HardBuild 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
HardExtend the trading platform for international markets - currency tables, historical exchange rates, and point-in-time rate lookups.
#26 Risk & Margin System
HardDesign a risk monitoring system with exposure limits, margin thresholds, and portfolio snapshots for real-time alerting.
#27 IPO Pipeline (Workflow Engine)
HardDesign a multi-stage workflow engine with parallel stages, multi-approver patterns, and stage dependencies for managing IPO deals.
#28 Market Data Feed (Time-Series)
HardDesign a time-series data architecture - high-frequency tick ingestion, OHLCV candle aggregation, table partitioning, and tiered storage policies.
#29 Regulatory Reporting (Star Schema)
HardDesign 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
HardThe Act 3 capstone - integrate brokers, clients, portfolios, trading, commissions, compliance, risk, and reporting into ONE unified schema of 15+ tables.
Act 4
#31 Mission Control (Distributed Data)
Very HardDesign 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)
Very HardDesign 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
Very HardDesign a scientific data catalog with weighted scoring, measurement uncertainty tracking, and composite habitability rankings for candidate planets.
#34 Cryo-Sleep Registry (Bi-Temporal Data)
ExpertDesign 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).
#35 Resource Allocation (Optimization)
ExpertDesign 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)
ExpertDesign 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)
ExpertModel 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)
ExpertDesign 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)
ExpertDesign 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
LegendaryDesign 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)
LegendaryDesign 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)
LegendaryDesign a self-referencing replication tree tracking Agent Smith clones, their lineage, generation depth, and the pods they override.
#43 Anomaly Detection (Pattern Schema)
LegendaryDesign an anomaly detection system with configurable pattern rules, event correlation, and threat scoring for Matrix glitches.
#44 The Construct (Skill Tree Schema)
LegendaryDesign 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)
LegendaryDesign 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)
LegendaryDesign a Git-like version control system in relational tables with repositories, branches, immutable commits, file snapshots, and diff tracking.
#47 Machine City (Multi-Tenant)
LegendaryDesign a multi-tenant architecture for 12 Matrix instances with tenant isolation, shared infrastructure tables, and provisioning workflows.
#48 The Prophecy Engine (Rules Engine)
LegendaryDesign a configurable rules engine with nested condition trees, weighted action outcomes, rule versioning, and evaluation logging.
#49 Matrix Reload (Migration Orchestration)
LegendaryDesign 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
LegendaryDesign the COMPLETE Matrix data architecture spanning 8 domains with bounded contexts, cross-domain event integration, and 25+ table coordination as the ultimate capstone challenge.
Act 6
#51 The Menu Board
HardDesign 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
HardDesign the franchise agreement system: a franchisee licenses an exclusive territory, and no two agreements may overlap.
#53 The Speedee Service System
HardModel the kitchen order pipeline: an order moves through prep stations in sequence, and every station transition is timestamped.
#54 Supply Chain Standardization
HardDesign the supplier and distribution schema that guarantees every restaurant gets identical ingredients, sourced through approved channels only.
#55 Real Estate Empire
ExpertDesign 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.
#56 Royalty & Rebate Engine
ExpertDesign the schema that calculates monthly royalty owed on gross sales and reconciles it against supplier rebates earned on standardized purchasing.
#57 Multi-Location Inventory
ExpertDesign a stock-tracking schema that covers per-location inventory levels, transfers between restaurants, and automatic reorder triggers.
#58 Franchise Performance Scorecard
ExpertDesign the compliance and performance auditing system, including anonymous mystery-shopper inspections and a formal underperformance flagging process.
#59 National Ad Fund
LegendaryDesign 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.
#60 The Golden Arches Empire
LegendaryCapstone: unify territory rights, real estate leasing, royalty calculation, and supply chain into one integrated franchise-empire schema.
Act 7
#61 Patient Intake Registry
HardDesign the patient intake system: registration, admissions, symptom reporting, and triage priority for a fast-moving outbreak.
#62 Contact Tracing Graph
HardModel 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
HardDesign the specimen-to-result pipeline: collection, test ordering, and results, with turnaround time trackable at every stage.
#64 Hospital Bed Capacity
HardDesign the ward and bed inventory system, including per-bed occupancy and surge capacity for when a normal ward isn't enough.
#65 Quarantine & Isolation Tracking
ExpertDesign the schema for issuing quarantine orders, tracking compliance check-ins, and logging violations that escalate to enforcement.
#66 Vaccine Cold-Chain Logistics
ExpertDesign 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
ExpertDesign a reportable-disease case schema where every status change - suspected, probable, confirmed, ruled out - is logged, and public-health hand-offs are tracked explicitly.
#68 Transmission Modeling Data
ExpertDesign the schema behind outbreak-cluster analysis: who infected whom, grouped into clusters, feeding a daily effective-reproduction-number time series.
#69 Global Health Data Exchange
LegendaryDesign the interoperability layer that lets health jurisdictions share case data under formal agreements, with consent tracked on every exchange.
#70 CDC Command Center
LegendaryCapstone: unify patient intake, contact tracing, quarantine, and case reporting into one command-center schema anchored on the patient.
Act 8
#71 Avatar Creation
HardDesign the account and avatar system: one player can control an avatar, and every piece of that avatar's appearance is tracked as its own customization slot.
#72 Inventory & Loot System
HardDesign the item catalog and inventory system, distinguishing items an avatar is carrying from items an avatar currently has equipped.
#73 Quest & Achievement Tracker
HardDesign a quest system where some quests require an earlier quest to be completed first - a prerequisite chain pointing back into the same table.
#74 Guild & Clan System
HardDesign 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.
#75 Matchmaking & Ranked Play
ExpertDesign 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.
#76 Virtual Economy & Marketplace
ExpertDesign the item marketplace and a double-entry currency ledger where every trade produces a matching debit and credit.
#77 In-Game Crafting System
ExpertDesign a crafting system where each recipe requires several material items in specific quantities, and an avatar's crafting jobs are queued, not instant.
#78 The Easter Egg Hunt
ExpertDesign 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.
#79 Cross-Server Player Migration
LegendaryDesign the schema for transferring a player between regional servers, including a second table for resolving item and name conflicts the migration uncovers.
#80 The OASIS
LegendaryCapstone: unify avatars, inventory, guilds, the marketplace, and quests into one integrated virtual-world schema anchored on the avatar.