Back to problems

Design Scalable TinyURL Service with One-to-One URL Mapping

Object-Oriented Programming · Confluent · Medium

Design a URL shortening service like TinyURL that enforces a strict one-to-one relationship: every long URL is associated with exactly one short URL, and no two different long URLs can share the same short URL. The service must expose two operations: encode accepts a long URL and returns a unique short URL. If the same long URL is encoded multiple times, the same short URL must be returned each time. decode accepts a short URL and returns the original long URL it was mapped…

Checking your access…