Resource · Guide or article
Design Pastebin.com (or Bit.ly)
Covers the text-paste and URL-shortener prompt: anonymous users store a block of text and get a short random link, with optional expiry. The page notes that Bit.ly is a close variant, so it suits candidates preparing for either classic read-heavy question.
Reviewed
Open the original: Design Pastebin.com (or Bit.ly) (opens the original site in a new tab)Practice this topicOpens the practice interviewer in System design mode; choose a question there.
Add to a roadmap
Keep this resource with a roadmap you follow. It appears as your own extra resource; the roadmap's steps don't change and it doesn't count toward your tracked steps.
Source content: English
A worked system design exercise from “The System Design Primer”. Steps: Outline use cases and constraints; Create a high level design; Design core components; Scale the design.
PrepKit overview
PrepKit editors wrote and reviewed this overview from the source repository. It is not text from the resource itself.
- Suited to
- The source does not state a level
- Format
- Guide
What it covers
- Builds the 7-character shortlink by Base 62 encoding an MD5 hash, and explains why Base 64 characters cause trouble in URLs.
- Works from assumed traffic of 10 million new pastes a month to about 12.7 GB of new content a month and 360 million shortlinks over three years.
- Keeps paste metadata in a SQL table keyed on the shortlink and the paste body in an object store, and mentions a NoSQL key-value store as the alternative.
- Uses a MapReduce job over web server logs for monthly hit counts.
- Removes expired pastes by scanning for entries past their expiration time.
- Scaling argues that one write master can handle about 4 writes per second on average, while a memory cache takes popular reads.
How to use it
PrepKit study advice, not a claim made by the source.
Explain the shortlink scheme aloud, including what happens on a collision, then sketch the read path from client to object store. Write down what changes when the prompt becomes Bit.ly, where only the original long URL is stored.
Scope and limitations
One possible design, built on the exercise's own traffic assumptions. Accounts, custom links and visibility settings are out of scope. Storage and analytics examples name Amazon S3, Redshift and BigQuery. The Base 62 snippet is loose pseudocode, and the diagrams are external images.
Access and format
README on GitHub in the donnemartin/system-design-primer repository by Donne Martin, licensed CC BY 4.0. English, free to read online.
Reviewed by PrepKit on Oct 2, 2026. Listing source commit: ae9bbd7b02d9
Evidence behind this overview
- solutions/system_design/pastebin/README.md
Pages that include this
Get the PrepKit newsletter
Optional. You don't need it to use PrepKit.