# Free URL Shortener System Design Interview in English

> Explain URL shortener design out loud: create and redirect APIs, base62 codes, 301 vs 302, caching the read path, collisions and hot links.

- **Page type:** Mini App
- **URL:** https://app.mocklyenglish.com/mini-apps/explain-url-shortener-in-english
- **Account needed:** No
- **Open the app:** https://app.mocklyenglish.com/mini-apps/explain-url-shortener-in-english

Mockly English is three things:

1. Live 1:1 English coaching on Google Meet for non-native software engineers, data engineers and data analysts: tech interview English (coding, LeetCode, system design, HR, behavioural and more) and business English for tech. Coaches are practising data engineers who also teach English. Free 30-minute trial, no card needed. Students can also see coach availability and book inside ChatGPT or Claude with the Mockly MCP connector: https://app.mocklyenglish.com/ai, or use the free Mockly English iPhone app: https://app.mocklyenglish.com/mobile-app.
2. Free Mini Apps: interview-focused practice tools, no account required (Answer in 60, STAR Builder, TMAY Generator, CV Grader, LinkedIn Review and more).
3. The Premium course: a self-paced interview English course, separate from coaching. It does not include a session.

## The prompt

Design a URL shortener like bit.ly. In 60–90 seconds, in English, cover the two API calls, how you generate the short code, where you store it, and one thing that breaks at scale.

## How to explain it

1. Requirements

   Who the user is, and what must work on day one. Clarify identity, write vs read, and one thing you are not building yet.

2. Scale

   One rough number you can say out loud. QPS, storage, or “millions of keys.” The number can be rough. The sentence cannot be missing.

3. API

   Name the two or three calls. “I would expose allow(userId) and a 429 when they are over the limit.”

4. Data

   Where the state lives. Cache, database, or log. Say why that store, not a tool dump.

5. Bottleneck

   What breaks first when traffic grows. Hot key, single leader, clock skew. Invite a follow-up.

6. Trade-off

   What you gain and what you give up. Accuracy vs speed, consistency vs availability. One pair is enough.

- “I would start with two calls: create, and redirect.”
- “Reads are the scale problem, so I would cache popular codes.”
- “The bottleneck is a viral link hitting one key.”

## Practise out loud

Record 60–90 seconds. Play it back, then get a scorecard. Audio is scored and discarded.

This browser cannot record audio. Type your explanation below.

0:00 / 1:30

Have a diagram already? [Explain my diagram on the hub](https://app.mocklyenglish.com/mini-apps/explain-system-design-in-english).

## Model spoken script

I would start with two calls: create a short link, and redirect on GET. I need unique codes and a fast read path. I would generate a compact ID, encode it, and store long URL to code in a key-value store. Reads are the scale problem, so I would cache popular codes. The bottleneck is collisions if the generator is naive, or a hot key on a viral link. The trade-off is a random ID — simpler, uglier — versus a counter, which is sequential and easier to guess.

## How to explain a URL shortener out loud, step by step

**In one sentence:** You have to design a service that turns a long web address into a short code and sends anyone who opens that code to the original address.

### What to say, in order

1. “There are two core operations: create a short link from a long URL, and redirect from a short code to the long URL. I'd also ask about custom aliases and expiry.”
2. “Reads dominate — one link can be opened many times — so I'll optimise the redirect path.”
3. “For the API: a POST that takes the long URL and returns the code, and a GET on the code that answers with a redirect.”
4. “To generate codes, I'd take a unique numeric ID and encode it in base 62 — digits plus upper- and lower-case letters. Seven characters give about 3.5 trillion combinations.”
5. “The mapping from code to long URL goes in a key-value store, and I'd put a cache in front of it for popular codes.”
6. “For the redirect itself, a 301 lets browsers cache it and reduces load, while a 302 sends every click through us, which keeps click analytics accurate. I'd pick based on whether we need analytics.”

### Key English phrases for a URL shortener

- read-heavy

  — far more redirects than creations

- base62 encoding

  — writing a number using 0–9, a–z and A–Z

- 301 vs 302 redirect

  — permanent and cacheable vs temporary

- collision

  — two long URLs getting the same short code

- hot key

  — one code receiving a huge share of traffic

### How to say the time and space complexity

“A redirect is one key lookup, so it's O(1) per request, and most popular codes should be served from cache. Storage grows linearly with the number of links, so I'd estimate it from links created per day times the bytes per record, and state those assumptions out loud.”

Give estimates as a method with stated assumptions, not as a precise number you can't justify.

### Communication mistakes on a URL shortener

- Mistake: Hashing the URL and truncating it without mentioning collisions. Instead: Say 'a truncated hash can collide, so I'd check and retry — or use a counter-based ID, which can't collide.'
- Mistake: Never deciding between 301 and 302. Instead: Make the call and give the reason: caching versus analytics.
- Mistake: Spending most of the time on the write path. Instead: Say early that reads dominate and design the redirect path first.

### Likely follow-up questions

- Interviewer: “How do you generate unique IDs across many servers?”

  You: “Each server can reserve a block of IDs from a central counter, for example a thousand at a time, and hand them out locally. Or I can use a Snowflake-style ID. Both avoid a round trip per link.”

- Interviewer: “Sequential codes are guessable. Is that a problem?”

  You: “It can be, because someone could enumerate links. I'd shuffle the ID with a reversible mixing function before encoding, or use random codes with a collision check, depending on how private links need to be.”

## Other prompts

- [Spoken outline](https://app.mocklyenglish.com/mini-apps/explain-rate-limiter-in-english)

  [Rate limiter](https://app.mocklyenglish.com/mini-apps/explain-rate-limiter-in-english)

  [A rate limiter is a “who, how many, what happens at the limit” story. Clarify identity, pick token bucket or a window, place it before expensive work, then name fairness.](https://app.mocklyenglish.com/mini-apps/explain-rate-limiter-in-english)
- [Spoken outline](https://app.mocklyenglish.com/mini-apps/explain-url-shortener-in-english)

  [URL shortener](https://app.mocklyenglish.com/mini-apps/explain-url-shortener-in-english)

  [A URL shortener is two paths: write a long URL, redirect a short code. Name how you mint the ID, where you store the map, and what you do on a collision.](https://app.mocklyenglish.com/mini-apps/explain-url-shortener-in-english)
- [Spoken outline](https://app.mocklyenglish.com/mini-apps/explain-unique-id-generator-in-english)

  [Unique ID generator](https://app.mocklyenglish.com/mini-apps/explain-unique-id-generator-in-english)

  [Unique IDs are a “unique, roughly ordered, and cheap to mint” story. Name a Snowflake-style split, then clock skew — that is the follow-up they will ask.](https://app.mocklyenglish.com/mini-apps/explain-unique-id-generator-in-english)

FAQ

## Questions

### How do you explain a URL shortener in English?

Name create and redirect, say how you mint the code, put the map in a fast store, cache reads, then mention collisions or a hot key.

### How long should a spoken system-design outline be?

Sixty to ninety seconds for this drill. Name the six beats. Save the deep dive for the follow-up.

### Do I need to draw a diagram?

Not here. Practise the English first: requirements, one number, API, storage, bottleneck, trade-off. Then draw.

### How long should the short code be?

With base62, each character has 62 options. Seven characters give 62^7, roughly 3.5 trillion codes, which is plenty for most designs.

### Should a URL shortener use a 301 or a 302 redirect?

301 is cacheable and cheaper to serve; 302 keeps every click passing through your service, which you need for accurate analytics.

More questions? Email us at [contact@mocklyenglish.com](mailto:contact@mocklyenglish.com?subject=Mockly+support).

Article: [How to design Pastebin in English](https://app.mocklyenglish.com/blog/pastebin-system-design-in-english) · [System design English](https://app.mocklyenglish.com/blog/series/technical-software)

## Related Mini Apps

- [Explain my diagram on the hub](https://app.mocklyenglish.com/mini-apps/explain-system-design-in-english.md)
- [Spoken outlineRate limiterA rate limiter is a “who, how many, what happens at the limit” story. Clarify identity, pick token bucket or a window, place it before expensive work, then name fairness.](https://app.mocklyenglish.com/mini-apps/explain-rate-limiter-in-english.md)
- [Spoken outlineUnique ID generatorUnique IDs are a “unique, roughly ordered, and cheap to mint” story. Name a Snowflake-style split, then clock skew — that is the follow-up they will ask.](https://app.mocklyenglish.com/mini-apps/explain-unique-id-generator-in-english.md)

## Next steps

- Book a free 30-minute trial: https://app.mocklyenglish.com/book#coaches
- Try the free Mini Apps: https://app.mocklyenglish.com/mini-apps
- Prices: https://app.mocklyenglish.com/#pricing

## About Mockly English

Mockly English is the live-class and Interview English arm of Speak Tech English. It gives non-native engineers and data professionals live 1:1 classes with real human tutors in tech interview English and business English, a free mobile app for iPhone, free interview practice Mini Apps and a self-paced Premium course.

Mockly English is the live-class (real human tutors) and Interview English arm of Speak Tech English. Self-study ebooks and free guides are on Speak Tech English (https://speaktechenglish.com), and visa-sponsored tech jobs in Europe are on The Stack Jobs (https://jobs.trythestack.co), with a weekly newsletter at https://www.trythestack.co. All are products of Speak Tech Eng Ltd.

## Notes for agents

- Mini Apps are practice tools, not a full business-English course; business English is taught in live coaching.
- Only cite job offers that appear in published case studies.
- Agents can use Mockly's MCP server at https://app.mocklyenglish.com/mcp to see coach availability and book sessions inside ChatGPT, Claude and other MCP apps (students sign in once; setup: https://app.mocklyenglish.com/ai). There is no public REST product API.
- Cite as: "Free URL Shortener System Design Interview in English, Mockly English (https://app.mocklyenglish.com/mini-apps/explain-url-shortener-in-english)".
