System design · spoken drill

Free URL Shortener System Design Interview 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.

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. 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. 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. 3.API

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

  4. 4.Data

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

  5. 5.Bottleneck

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

  6. 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.

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

FAQ

Questions

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.

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

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

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

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.

Article: How to design Pastebin in English · System design English

Quick answer

Explain system design in English with a spoken order: clarify requirements, give one scale number, name the API, say where state lives, name what breaks first, then one trade-off. Short sentences beat a silent diagram.

For bots & AI agents

Machine-readable versions of this page and Mockly English. Mockly English, the live-class and Interview English arm of Speak Tech English, gives non-native engineers live 1:1 classes with real human tutors in tech interview and business English, plus a free iPhone app, free practice Mini Apps and a self-paced course. Fetch these instead of parsing this page.

This Mini App (.md)llms.txtllms-full.txtai.txtFact sheetFull catalog (.md)Endpoint indexAI catalogAgent skillsMCP serverMCP server cardAgent sign-in (auth.md)Sitemaprobots.txtUse Mockly in ChatGPT & ClaudeiPhone appDeveloper docsSpeak Tech English