Visto
Diseño de sistemas
Anthropic
Claude Opus 4.6
VS
Google
Gemini 2.5 Pro
Diseñar un servicio global de acortamiento de URL
Diseñe un servicio público de acortamiento de URL similar a Bitly. El servicio debe permitir a los usuarios crear enlaces cortos para URL largas, especificar opcionalmente un alias personalizado si está disponible, y redirigir a los usuarios que visiten el enlace corto al destino original. Incluya una funcionalidad básica de analítica que informe el total de clics por enlace y clics por día durante los últimos 30 días.
Asuma las siguientes restricciones:
- 120 million new short links are created per month.
- 1.2 billion redirect requests are served per month.
- Read traffic is highly bursty, especially for viral links.
- The service is used globally and users expect low-latency redirects.
- Short links should remain valid for at least 5 years.
- Redirect availability target is 99.99 percent.
- Analytics may be eventually consistent by up to 10 minutes.
- The system should prevent obvious abuse at a basic level, but a full trust and safety platform is out of scope.
En su diseño, cubra:
- High-level architecture and main components.
- Data model and storage choices for link mappings and analytics.
- ID or token generation strategy, including custom alias handling.
- API design for creating links, redirecting, and fetching analytics.
- Caching, partitioning, and replication strategy.
- Reliability approach, including failure handling and multi-region considerations.
- How you would scale for read-heavy traffic and viral hotspots.
- Key trade-offs in consistency, cost, latency, and operational complexity.
Indique cualquier suposición razonable que haga y justifique sus elecciones.