System Design Notes
Don’t forget to get your copy of Designing Data Intensive Applications the single most important book to read for system design interview prep!

URL Shortner

A popular set of system design interview questions are related to the design of a URL shortener. It’s important to build your concept on the fundamentals, design constraints, and trade-offs involved in URL shortening service that is real time scalable. Let’s design a URL shortener similar to bit.ly.

What Does A URL Shortener Do?

The goal of a URL shortener is simple. It is a service, like bit.ly or tinyurl.com, that creates a short URL against the original long URL. When the user hits the short URL, they are redirected to the long URL against the shortened one.

Why Would You Need To Shorten The URL?

So why would one need to create shorter aliases to use in place of long URLs? URL shortening offers many convincing benefits. Here’s a list that will help you understand the purpose of building a URL shortener in the first place:

  1. Messaging, retweeting, posting and displaying shortened URLs saves space.
  2. Since it’s easier to copy paste, the audience is more likely to share short URLs.
  3. Copy-pasting sort URLs is less prone to typos as compared to long URLs.
  4. You might want to mask original affiliate links through short URLs.
  5. Some URL shorteners, like Pagetweet, offer additional useful features for sharing and viewing short URLs.
  6. URL shorteners like bit.ly allow you to track click data to analyze the audience, which can help upgrade marketing strategies.

Requirements Of The Design

You can build the simplest URL shortener that gives a short alias URL in place of a long URL, or a more complex one, with some additional features. If it’s an interview question, it’s always a good idea to ask your interviewer a few more questions until you have a clear idea of what the problem requires.


Click here to continue reading this lesson on Medium.