Design URL creation and redirect flows with durable unique aliases and explicit cache behavior. Address collisions, newly created links, expiration, disablement, and the tradeoffs introduced by editable destinations.
Design a service that creates short links for destination URLs and redirects requests for those short links.
### Clarifying Questions
The report supplies the system name without workload details. Clarify link creation rate, redirect traffic, expiration, custom aliases, editability, and abuse controls. For a baseline, choose generated immutable aliases with optional expiration; these are design choices rather than reported requirements.
### What a Strong Answer Covers
Creation and redirect APIs, collision handling, durable mappings, cache behavior, availability, and validation. Explain which consistency requirements apply to newly created, expired, or disabled links.
### Follow-up Questions
- How would you prevent a cached mapping from continuing to serve after a link is disabled?
- What changes if users may edit destinations after creation?
Overview: Design URL creation and redirect flows with durable unique aliases and explicit cache behavior. Address collisions, newly created links, expiration, disablement, and the tradeoffs introduced by editable destinations.
Design a service that creates short links for destination URLs and redirects requests for those short links.
Clarifying Questions Guidance
The report supplies the system name without workload details. Clarify link creation rate, redirect traffic, expiration, custom aliases, editability, and abuse controls. For a baseline, choose generated immutable aliases with optional expiration; these are design choices rather than reported requirements.
What a Strong Answer Covers Guidance
Creation and redirect APIs, collision handling, durable mappings, cache behavior, availability, and validation. Explain which consistency requirements apply to newly created, expired, or disabled links.
Follow-up Questions Guidance
How would you prevent a cached mapping from continuing to serve after a link is disabled?
What changes if users may edit destinations after creation?