Solve engineering problems with tight resource limits.

We cap your memory and slow down your CPU. Squeeze your solution into as few bytes as you can and climb the leaderboard.

THE PROBLEMS

Sign in with Google or GitHub, then pick a problem.

WORLD 1

MEMORY PUZZLES

Each input is bigger than the memory you get, so loading it all and looping over it won't work.

  • 1-2 MEMORY PUZZLE Difficulty: MEDIUM

    PHONE BOOK SORT

    Sort a million phone numbers in less memory than the numbers take up.

    INPUT
    1,000,000 numbers (~4 MB)
    MEMORY
    1.5 MB
    TRY THIS FIRST: Phone Book Sort
  • 1-3 MEMORY PUZZLE Difficulty: HARD

    TINY CACHE

    Multiply two 512 × 512 matrices on a CPU with a 4 KB cache. We score you on simulated CPU cycles (C and C++ only).

    INPUT
    Two 512 × 512 matrices (1 MB each)
    MEMORY
    4 KB CACHE
    CPU
    Each cache miss costs 100 cycles
    TRY THIS FIRST: Tiny Cache
  • 1-4 MEMORY PUZZLE Difficulty: HARD

    FRIDGE SPELLCHECK

    Build a spell checker for 200,000 words that fits on a smart fridge.

    INPUT
    200,000 words (~2 MB)
    MEMORY
    256 KB
    TRY THIS FIRST: Fridge Spellcheck
WORLD 2

SYSTEM DESIGN

Scaled-down interview-style system design problems run in seconds. We simulate the outside world by dropping requests and killing your program mid-run.

  • 2-1 SYSTEM DESIGN Difficulty: EASY PEASY

    BIG SORT

    Sort 200 MB of data with 2 MB of memory.

    INPUT
    200 MB file
    MEMORY
    2 MB
    TRY THIS FIRST: Big Sort
  • 2-2 SYSTEM DESIGN Difficulty: MEDIUM

    TOP PAGES

    Find the 10 most visited pages in a log 250 times the size of your memory.

    INPUT
    1 GB log
    MEMORY
    4 MB
    TRY THIS FIRST: Top Pages
  • 2-3 SYSTEM DESIGN Difficulty: MEDIUM

    RATE LIMITER

    Allow or reject 1 million API requests from 100,000 users. Each user gets 10 requests a second.

    INPUT
    1,000,000 requests
    MEMORY
    2 MB
    CPU
    50 instructions per decision
    TRY THIS FIRST: Rate Limiter
  • 2-4 BOSS SYSTEM DESIGN Difficulty: HARD

    BIRTHDAY MESSAGES

    Out of 5 million users, email each one with a birthday today, once. The email server takes 1,000 messages a second and drops some.

    INPUT
    5,000,000 users
    MEMORY
    8 MB
    TWIST
    Flaky email API · 3 crashes
    TRY THIS FIRST: Birthday Messages

These targets are for C. Each other language gets its own targets and hard limits that allow for its runtime's overhead. A correct solution over the target is still accepted, as a yellow result.

HOW TO PLAY

  1. SELECT

    Pick a problem.

  2. CODE

    Write your solution in the language you like best.

  3. RUN

    Submit it. We run it and record its peak memory and run time.

  4. SCORE

    On problems with a leaderboard, compare your score with other players'. Trim your solution and resubmit.

HI-SCORES EXAMPLE
RANKPLAYERMEMORYLANG
1STNULLPTR40 KBC
2NDBITFLIP58 KBC
3RDHEAPSTR96 KBC
4THSEGFLT131 KBC
5THMALLOCD188 KBC
6THOOMKILL240 KBC
7THYOU300 KBC

The lowest memory use wins, so on this example board you'd need under 40 KB to take first place.