System Design: Online Judge — Code Execution, Sandboxing, Test Cases, and Scalable Evaluation
What Is an Online Judge? An online judge (LeetCode, HackerRank, Codeforces) accepts code submissions in multiple languages, executes them against […]
Learn to design scalable, reliable systems that handle millions of users. System design interviews test your ability to architect real-world applications, considering tradeoffs, scalability, and best practices.
Core Topics:
Scalability: Load balancing, horizontal vs vertical scaling
Storage: Databases (SQL vs NoSQL), caching (Redis, Memcached)
Reliability: Replication, failover, disaster recovery
Performance: CDNs, caching strategies, database indexing
Common Design Questions:
Design URL shortener (bit.ly)
Design rate limiter
Design Twitter/Instagram feed
Design messaging system (WhatsApp)
Design file storage (Dropbox)
Interview Level: Senior engineers (L5+) at FAANG companies. Requires 3-5+ years experience to tackle effectively.
Preparation: Study system design patterns, understand distributed systems fundamentals, and practice mock interviews.
What Is an Online Judge? An online judge (LeetCode, HackerRank, Codeforces) accepts code submissions in multiple languages, executes them against […]
Requirements and Scale Search autocomplete suggests query completions as the user types. Design constraints: latency must be under 100ms (users
Core Entities Policy: (policy_id, policyholder_id, policy_type=AUTO|HOME|HEALTH|LIFE, coverage_amount_cents, premium_cents, deductible_cents, start_date, end_date, status=ACTIVE|EXPIRED|CANCELLED). Claim: (claim_id, policy_id, claimant_id, incident_date, reported_date, claim_type, description,
Core Entities Property: (property_id, listing_type=SALE|RENT, status=ACTIVE|PENDING|SOLD|WITHDRAWN, address, geo_point, price_cents, bedrooms, bathrooms, sqft, year_built, property_type=HOUSE|CONDO|APARTMENT|LAND, description, agent_id, created_at). PropertyImage: (image_id, property_id,
The Feed Problem A social network feed shows a user the recent posts from people they follow, ranked by relevance
Core Entities Coupon: (coupon_id, code, discount_type=PERCENTAGE|FIXED_AMOUNT|FREE_SHIPPING|BUY_X_GET_Y, discount_value, min_order_amount_cents, max_discount_cents, start_date, end_date, is_active, usage_limit_global, usage_limit_per_user, applicable_to=ALL|CATEGORY|PRODUCT, applicable_ids[]). CouponUsage: (usage_id, coupon_id, user_id,
Core Entities Board: (board_id, workspace_id, name, visibility=PUBLIC|PRIVATE, owner_id, created_at). A board represents a project. Column: (column_id, board_id, name, position, wip_limit).
Why Sharding? A single database server has limits: storage capacity (~tens of terabytes), write throughput (~tens of thousands of writes/second),
Core Entities Wallet: (wallet_id, user_id, currency, balance_cents, status=ACTIVE|FROZEN|CLOSED, created_at). One user may have multiple wallets (different currencies). LedgerEntry: (entry_id, wallet_id,
The Consensus Problem In a distributed system, multiple nodes must agree on a single value (which node is the leader,
Core Entities LeaveType: (leave_type_id, name, accrual_rate_days_per_month, max_balance_days, carry_over_max_days, is_paid, requires_documentation). Examples: Annual Leave (1.67 days/month, max 30 days), Sick Leave
The Three Pillars of Observability Observability is the ability to understand the internal state of a system from its external
Core Entities Ticket: ticket_id, customer_id, subject, description, priority (LOW, MEDIUM, HIGH, URGENT), status (OPEN, IN_PROGRESS, WAITING_ON_CUSTOMER, RESOLVED, CLOSED), category, assigned_agent_id,
Core Entities PaymentIntent: intent_id (idempotency key), amount_cents, currency, customer_id, payment_method_id, status (CREATED, PROCESSING, SUCCEEDED, FAILED, CANCELLED), created_at, metadata. PaymentMethod: method_id,
Core Entities Post: post_id, user_id, content, media_urls[], platforms[] (TWITTER, INSTAGRAM, LINKEDIN, FACEBOOK), scheduled_at (UTC), status (DRAFT, SCHEDULED, PUBLISHING, PUBLISHED, FAILED),