Menu

Design a Scalable URL Shortener (TinyURL)

Medium

Design a Scalable URL Shortener (TinyURL)

MediumCategory: System DesignAcceptance: 85%

Problem Statement

Write an optimal implementation to solve the **design a url shortener** challenge for System Design & Distributed Systems. Ensure your solution handles edge cases, executes with efficient time complexity, and passes all automated test cases.

Examples

Example 1:

Input: input = [1, 2, 3]

Output: [3, 2, 1]

Explanation: Example transformation for design a url shortener.

Constraints

  • 1 <= input.length <= 10^5
  • Time complexity must be O(N) or better.
  • Space complexity must be O(1) auxiliary space where applicable.
Solution Editor
Loading...
Input:input = [1, 2, 3]
Expected Output:[3, 2, 1]