Design a Production-Ready URL Shortener

Quick Overview

This question evaluates competency in designing a scalable, reliable, and secure production URL shortening service, covering API design, link data modeling and analytics, ID/token generation, caching and read/write paths, partitioning/replication/consistency choices, rate limiting and abuse mitigation, TTL handling and cleanup, and HA/DR and monitoring. Commonly asked in system design interviews to probe architectural trade-offs for high-read consumer services, it belongs to the System Design domain and emphasizes practical application of distributed systems and operational concepts rather than only conceptual theory.

Design a Production-Ready URL Shortener

Company: Remitly

Role: Software Engineer

Category: System Design

Difficulty: hard

Interview Round: Onsite

Design a production-ready URL shortening service. Specify public APIs for creating, resolving, and managing short links (including optional custom aliases and expiration). Propose a database schema, an ID or token generation strategy with collision avoidance, and a read/write path with caching. Discuss partitioning, replication, and consistency, rate limiting and abuse/spam mitigation, analytics and click tracking, TTL handling and cleanup, and strategies for high availability, disaster recovery, and monitoring. Compare key trade-offs you would make under different traffic patterns.

Overview: This question evaluates competency in designing a scalable, reliable, and secure production URL shortening service, covering API design, link data modeling and analytics, ID/token generation, caching and read/write paths, partitioning/replication/consistency choices, rate limiting and abuse mitigation, TTL handling and cleanup, and HA/DR and monitoring. Commonly asked in system design interviews to probe architectural trade-offs for high-read consumer services, it belongs to the System Design domain and emphasizes practical application of distributed systems and operational concepts rather than only conceptual theory.

|Home/System Design/Remitly
Remitly logo
Remitly
Aug 13, 2025
hardSoftware EngineerOnsiteSystem Design
13
0

System Design: Production-Ready URL Shortening Service

Goal

Design a production-ready URL shortening service that can issue short links, resolve them at low latency, and provide management and analytics. The service must be scalable, reliable, and secure.

Requirements

  • Public APIs to:
    1. Create short links (optionally with custom alias and expiration/TTL).
    2. Resolve short links to their destination.
    3. Manage short links (enable/disable, update destination, extend TTL, fetch stats).
  • Propose a database schema for links and analytics.
  • Propose an ID/token generation strategy with collision avoidance.
  • Describe read/write paths with caching.
  • Discuss partitioning, replication, and consistency choices.
  • Include rate limiting, abuse/spam mitigation.
  • Include analytics and click tracking.
  • Describe TTL handling and cleanup.
  • Strategies for high availability (HA), disaster recovery (DR), and monitoring.
  • Compare key trade-offs under different traffic patterns (read-heavy vs write-heavy, hot-spot links vs long-tail, single-region vs global).

Assume a consumer-facing scale with very high read QPS and moderate writes, and that links can be public or managed by authenticated users.

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...