Functional Requirements
Functional Requirements define the boundary of the system — what it does, not how fast or how reliably it does it.
Getting FRs right in an interview is a signal that you can scope a problem instead of designing everything at once.
What is Pastebin?¶
Pastebin is a service where you paste a chunk of text — code, logs, config files, error traces — and get back a short URL you can share. The person you share it with clicks the link and reads the full text. That's the whole product.
It's structurally very similar to a URL Shortener. Instead of storing a pointer to someone else's URL, you're storing the content itself. The short code generation, caching, and DB sharding problems are identical — but now you also have to store and retrieve potentially large text blobs.
Scope decisions made during requirements¶
Text only — no images or PDFs
The temptation is to support all file types, but binary files (images, PDFs) introduce a completely different set of problems: S3-like storage infrastructure, content-type detection, rendering pipelines, virus scanning. That's a separate system. Pastebin's core value is sharing text. Scoping to text-only in an interview is a strong signal — it shows you can draw a boundary around the problem.
Writes require authentication — reads are anonymous
Anyone can read a paste if they have the URL. But to create a paste, you need an account. This matters because custom URLs need an owner — without authentication, two anonymous users could race to claim the same alias with no way to resolve it. Requiring auth for writes solves this cleanly.
Custom aliases are supported
Users can request a custom short code (pastebin.com/my-config) instead of a system-generated one. This is a meaningful new concept not covered in URL Shortener — in the deep dive we'll handle collisions between custom aliases and auto-generated codes, and reserved word blocking.
Fixed expiry options — not free-form
Rather than letting users specify arbitrary durations, the system offers three options: 1 day, 7 days, 30 days. Default is 30 days if the user doesn't specify. Fixed options are better than free-form for two reasons: no validation complexity on arbitrary inputs, and the background cleanup job is simpler when you know exactly which expiry buckets to scan.
Creator can delete before expiry
The creator of a paste can delete it manually before its expiry time. Implemented as a soft delete — a flag on the record, not a physical row deletion. This keeps audit trails intact and makes the operation fast.
Final Functional Requirements¶
1. Authenticated users can create a paste (text content only)
2. Creator gets back a short URL
- System generates a random short code by default
- User can optionally request a custom alias
3. Anyone with the URL can view the paste (no auth required to read)
4. Paste has an expiry time
- User selects: 1 day, 7 days, or 30 days
- Default: 30 days if not specified
5. Expired pastes are no longer accessible
6. Creator can delete their paste before expiry
Interview framing
"Core FRs: create a paste, get a short URL, anyone can read via URL. Auth required to write, not to read. Text only — no binary files, that's a different system. Fixed expiry options (1/7/30 days) rather than free-form — simpler validation and cleanup. Custom aliases supported for registered users. Creator can delete before expiry."