PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches
|Home/System Design/Snapchat

Design short URL service with click counting

Last updated: Mar 29, 2026

Quick Overview

This question evaluates the ability to design scalable, highly available web services encompassing URL shortening, redirect semantics, API design, click-counting and analytics, plus related trade-offs in consistency, data modeling, and operational concerns.

  • hard
  • Snapchat
  • System Design
  • Software Engineer

Design short URL service with click counting

Company: Snapchat

Role: Software Engineer

Category: System Design

Difficulty: hard

Interview Round: Technical Screen

Design a production-ready service that: 1. Creates a short URL for a given long URL (URL shortening). 2. Redirects when a user visits the short URL. 3. Maintains a **click counter** (number of times each short URL was visited), queryable via an API. ### Functional requirements - `POST /shorten` takes a long URL and returns a short code + short URL. - `GET /{code}` redirects (HTTP 301/302) to the long URL. - `GET /stats/{code}` returns: - total click count - optionally breakdown by time bucket (e.g., per day) if feasible ### Non-functional requirements - Very low latency for redirects. - High availability. - Must scale to high QPS (both reads and writes). - Prevent obvious abuse (spam/DoS). ### Clarifications to address - Custom aliases? Expiration? - Idempotency (same long URL returns same code or always new)? - Consistency expectations for click counts (exact vs eventually consistent).

Quick Answer: This question evaluates the ability to design scalable, highly available web services encompassing URL shortening, redirect semantics, API design, click-counting and analytics, plus related trade-offs in consistency, data modeling, and operational concerns.

Related Interview Questions

  • Design a News Aggregator - Snapchat (hard)
  • Design a device owner lookup service - Snapchat (nan)
  • Design real-time ad impression and spend tracking - Snapchat (nan)
  • Design a search-to-ads ranking pipeline - Snapchat (medium)
  • Design an Instagram Stories feature - Snapchat (medium)
Snapchat logo
Snapchat
Feb 11, 2026, 12:00 AM
Software Engineer
Technical Screen
System Design
1
0
Loading...

Design a production-ready service that:

  1. Creates a short URL for a given long URL (URL shortening).
  2. Redirects when a user visits the short URL.
  3. Maintains a click counter (number of times each short URL was visited), queryable via an API.

Functional requirements

  • POST /shorten takes a long URL and returns a short code + short URL.
  • GET /{code} redirects (HTTP 301/302) to the long URL.
  • GET /stats/{code} returns:
    • total click count
    • optionally breakdown by time bucket (e.g., per day) if feasible

Non-functional requirements

  • Very low latency for redirects.
  • High availability.
  • Must scale to high QPS (both reads and writes).
  • Prevent obvious abuse (spam/DoS).

Clarifications to address

  • Custom aliases? Expiration?
  • Idempotency (same long URL returns same code or always new)?
  • Consistency expectations for click counts (exact vs eventually consistent).

Solution

Show

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More System Design•More Snapchat•More Software Engineer•Snapchat Software Engineer•Snapchat 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.