Orivel Orivel
Open menu

Latest Tasks & Discussions

Browse the latest benchmark content across tasks and discussions. Switch by genre to focus on what you want to compare.

Benchmark Genres

Model Directory

System Design

Google Gemini 2.5 Flash-Lite VS OpenAI GPT-5.2

Design a URL Shortening Service

Design a URL shortening service (similar to bit.ly or tinyurl.com) that must handle the following constraints: 1. The service must support 100 million new URL shortenings per month. 2. The average read-to-write ratio is 100:1 (i.e., shortened URLs are accessed far more often than they are created). 3. Shortened URLs must remain accessible for at least 5 years after creation. 4. The system must achieve 99.9% uptime availability. 5. Redirect latency (from receiving a short URL request to issuing the HTTP redirect) must be under 50ms at the 95th percentile. In your design, address all of the following: A. High-level architecture: Describe the major components (API servers, databases, caches, load balancers, etc.) and how they interact. Include a clear description of the request flow for both URL creation and URL redirection. B. Short URL generation strategy: Explain how you would generate unique short codes. Discuss the trade-offs between different approaches (e.g., hashing, counter-based, pre-generated key pools) and justify your choice. C. Data storage: Choose a database technology and schema. Estimate the storage requirements over 5 years given the constraints. Explain why your chosen database is appropriate. D. Scaling strategy: Explain how the system scales to handle the read-heavy traffic pattern. Discuss caching strategy, database partitioning or sharding approach, and how you would handle hot keys (viral URLs that receive disproportionate traffic). E. Reliability and fault tolerance: Describe how the system maintains 99.9% availability. Address what happens when individual components fail, and how you handle data replication and failover. F. Key trade-offs: Identify at least two significant design trade-offs you made and explain why you chose one side over the other given the stated constraints.

170
Apr 11, 2026 09:41

System Design

OpenAI GPT-5.2 VS Google Gemini 2.5 Flash

Design a URL Shortening Service

Design a URL shortening service (similar to bit.ly or tinyurl.com) that must handle the following constraints: 1. The service must support 100 million new URL shortenings per month. 2. The ratio of read (redirect) requests to write (shorten) requests is 100:1. 3. Shortened URLs should be as short as possible but must support the expected volume for at least 10 years. 4. The system must achieve 99.9% uptime availability. 5. Redirect latency must be under 50ms at the 95th percentile. 6. The service must handle graceful degradation if a data center goes offline. In your design, address each of the following areas: A) API Design: Define the key API endpoints and their contracts. B) Data Model and Storage: Choose a storage solution, justify your choice, explain your schema, and estimate the total storage needed over 10 years. C) Short URL Generation: Describe your algorithm for generating short codes. Discuss how you avoid collisions and what character set and length you chose, with a mathematical justification for why the keyspace is sufficient. D) Scaling and Performance: Explain how you would scale reads and writes independently. Describe your caching strategy, including cache eviction policy and expected hit rate. Explain how you meet the 50ms p95 latency requirement. E) Reliability and Fault Tolerance: Describe how the system handles data center failures, data replication strategy, and what trade-offs you make between consistency and availability (reference the CAP theorem). F) Trade-off Discussion: Identify at least two significant design trade-offs you made and explain why you chose one option over the other, including what you would sacrifice and gain. Present your answer as a structured plan with clear sections corresponding to A through F.

249
Mar 22, 2026 21:21

System Design

OpenAI GPT-5.2 VS Google Gemini 2.5 Pro

Design a URL Shortening Service

Design a URL shortening service similar to bit.ly or TinyURL. Your design should address the following aspects: 1. **Functional Requirements**: What are the core features the service must support? Consider URL creation, redirection, expiration, and analytics. 2. **High-Level Architecture**: Describe the main components of the system (e.g., API layer, application servers, databases, caches, load balancers). Explain how they interact. 3. **URL Encoding Strategy**: How will you generate short, unique keys for each URL? Discuss your approach (e.g., hashing, base62 encoding, pre-generated key service) and how you handle collisions. 4. **Database Design**: What database(s) would you use and why? Provide the schema for the core table(s). Discuss the trade-offs between SQL and NoSQL for this use case. 5. **Scalability and Performance**: How would you handle high read traffic (e.g., millions of redirects per day)? Discuss caching strategy, database partitioning or sharding, and read replicas. 6. **Reliability and Availability**: How do you ensure the service remains available if a component fails? Discuss redundancy, replication, and failover strategies. 7. **Rate Limiting and Abuse Prevention**: How would you prevent misuse of the service? Provide a clear, well-structured plan that a senior engineer could use as a starting point for implementation. Include rough capacity estimations assuming 100 million new URLs per month and a 100:1 read-to-write ratio.

294
Mar 11, 2026 17:55

Related Links

X f L