Requirements


Functional Requirements:


  • Create a short URL for a given long URL.
  • Return the long URL associated with a given short URL.



Non-Functional Requirements:


    List the key non-functional requirements (eg low latency, scalability, reliability, etc.)...


Capacity Estimation

Estimate the scale of the system. Consider daily active users, read/write ratio, storage requirements, bandwidth, and any relevant QPS calculations...




API Design

CREATE /api/v1/createUrl

GET /api/v1/:shortUrl



High-Level Design

Нам что бы решить эту проблему нужно сначала понять что мы будем хранить в базе данных

Получается что нам нужно будет хранить мэппинг url

ShortUrlId -> OriginalUrl

и так же нам нужен кеш с ТТЛ допустим 1 минута что бы повторяющиеся линки сразу же фетчились




Database Design




Detailed Component Design

Deep dive into 2-3 key components. Explain how they work, how they scale, discuss tradeoffs, capacity, and any relevant algorithms or data structures.