← All problems
Dashboard
Courses
Problems
Badges
Theme
Sign inStart free
Problem 007 · Fundamentals and estimation

Design a Pastebin

Easy 25 min

Design a service where users paste text, get a short link back, and anyone with the link can read the paste. Pastes can be up to 10 MB, most are read a handful of times, and a few go viral and are read millions of times.

Functional requirements

  • Create a paste and receive a short link
  • Read a paste by its link
  • Pastes expire after a chosen time
  • Optional syntax highlighting

Non-functional requirements

  • Reads p95 under 200 ms worldwide
  • Pastes are never lost before they expire
  • Viral pastes must not slow down everything else

Constraints and scale

  • 5 million new pastes per day
  • 10:1 read-to-write ratio, with heavy skew to a few pastes
  • Average paste 10 KB, maximum 10 MB

You will practise

  • Separate metadata from large blobs
  • Serve static content from a CDN
  • Scale a stateless API horizontally
Show 2 hints
  1. Where should a 10 MB blob live: the database or somewhere cheaper?
  2. What makes a paste cacheable at the edge?

Ready to build?

Open the canvas, place your components and explain your decisions. Your draft saves automatically.

Sign in to start

Failure scenarios

  • A paste goes viralA paste is linked from a front-page news story and receives 50 000 reads per second.

Run them from the workspace once your design is in place.