PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches
|Home/System Design/Amazon

Design a URL shortening platform

Last updated: Mar 29, 2026

Quick Overview

This question evaluates competency in system design and distributed systems architecture, including API design, scalable short-code generation, data modeling and storage/sharding, caching and CDN strategies, consistency and fault-tolerance trade-offs, rate limiting and abuse prevention, analytics, compliance, and capacity planning.

  • hard
  • Amazon
  • System Design
  • Software Engineer

Design a URL shortening platform

Company: Amazon

Role: Software Engineer

Category: System Design

Difficulty: hard

Interview Round: Onsite

Design a URL shortening platform that maps long URLs to short codes and supports redirection at scale. Define the API (create, expand, delete), code generation strategy (hashing, base-N encoding, collision handling), custom aliases, and TTL/expiration. Propose a data model and storage choices for billions of links, and a read-heavy architecture with caches and CDN. Describe rate limiting, abuse/fraud prevention, analytics (click counts, uniques, geo, time), and GDPR/compliance considerations. Provide a capacity plan (QPS, storage), a fault-tolerant deployment (replication, sharding), and consistency trade-offs.

Quick Answer: This question evaluates competency in system design and distributed systems architecture, including API design, scalable short-code generation, data modeling and storage/sharding, caching and CDN strategies, consistency and fault-tolerance trade-offs, rate limiting and abuse prevention, analytics, compliance, and capacity planning.

Related Interview Questions

  • Design a cloud database write path and recovery - Amazon (hard)
  • Design a replicated cloud storage service - Amazon (hard)
  • Measure platform success and drive adoption - Amazon (medium)
  • Design multi-tenant ingestion and processing platform - Amazon (medium)
  • Design globally consistent metadata service - Amazon (medium)
Amazon logo
Amazon
Sep 6, 2025, 12:00 AM
Software Engineer
Onsite
System Design
5
0

Design a Scalable URL Shortening Platform

Context

Build a Bitly-like URL shortener that maps long URLs to short codes and performs HTTP redirection reliably at global scale. Assume the service is read-heavy, stores billions of links, and must meet low latency and high availability requirements.

Requirements

  1. APIs
  • Define REST APIs for:
    • Create short link (with optional custom alias and TTL)
    • Expand short code to original URL (preview)
    • Delete/disable a short link
  1. Short Code Generation
  • Strategy: hashing and/or counter-based IDs
  • Base-N encoding (e.g., base62)
  • Collision handling
  • Support custom aliases
  • TTL/expiration behavior
  1. Data Model and Storage
  • Schema for links, users, and analytics
  • Storage for billions of links (trade-offs: SQL vs NoSQL, KV stores)
  • Indexing and sharding strategy
  1. Read-Heavy Architecture
  • Caches (edge and regional)
  • CDN and edge compute considerations
  • Redirect behavior (301/302/307) and caching semantics
  1. Rate Limiting and Abuse Prevention
  • Per-IP/account rate limiting
  • Malware/phishing detection, Safe Browsing integration
  • Blacklist/allowlist, link scanning
  1. Analytics
  • Click counts, uniques, geo, time-of-day
  • Real-time vs batch pipelines
  1. GDPR/Compliance
  • Data minimization, retention, encryption
  • Right-to-be-forgotten, data residency
  1. Capacity Plan
  • QPS estimates (create vs redirect)
  • Storage sizing (links and logs)
  1. Fault-Tolerant Deployment
  • Multi-AZ/region replication
  • Sharding, failover
  1. Consistency Trade-offs
  • Strong vs eventual consistency (creation, expansion, deletion)
  • Global uniqueness of custom aliases

Solution

Show

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More System Design•More Amazon•More Software Engineer•Amazon Software Engineer•Amazon System Design•Software Engineer System Design
PracHub

Master your tech interviews with 7,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.