Back to problems

Design a TinyURL service (encode/decode)

Object-Oriented Programming · Uber · Medium

Problem: Build a TinyURL encoder/decoder Create a URL-shortening component that converts a full URL into a compact URL and can later restore the original address. Implement: Requirements / Constraints Calling encode(longUrl) more than once can: produce the identical shortened URL (idempotent), or generate distinct shortened URLs (multiple codes may map to one URL), provided that decode remains correct. Prevent code conflicts while keeping generated codes fairly compact. The…

Checking your access…