System Design Challenges: 10 Practice Problems
Ten system design challenges you can practice online or on paper, ordered from a URL shortener to a distributed cache. Each one names the objective, the concepts it tests and the trade-offs an interviewer will push on. Work through them after the system design roadmap, or use them alone as practice problems before an interview.
Challenge 1: URL Shortener Design
Objective: Design a system that converts long URLs into short, unique URLs.
Key Learning Areas:
- Database design for URL mappings
- Hashing algorithms for generating short URLs
- Caching strategies for frequently accessed URLs
- Load balancing for high traffic scenarios
Requirements:
- Convert URLs like
https://www.example.com/very/long/pathtohttps://short.ly/abc123 - Handle 100 million URLs
- Support 1000 requests per second
- 99.9% uptime
Implementation Steps:
- Design the database schema
- Choose a hashing algorithm (MD5, SHA-1, or custom)
- Implement caching with Redis
- Add load balancing with multiple servers
- Handle URL expiration and analytics
Resources: Coudo AI Blog: URL Shortener Design
Challenge 2: Rate Limiter System
Objective: Build a rate limiting system to prevent API abuse.
Key Learning Areas:
- Rate limiting algorithms (Token Bucket, Leaky Bucket, Fixed Window)
- Distributed rate limiting across multiple servers
- Caching for request counting
- API security and abuse prevention
Requirements:
- Support 1000 requests per minute per user
- Work across multiple servers
- Handle burst traffic gracefully
- Provide real-time rate limit status
Implementation Steps:
- Implement Token Bucket algorithm
- Use Redis for distributed rate limiting
- Add rate limit headers to responses
- Handle rate limit violations gracefully
- Monitor and alert on abuse patterns
Resources: Coudo AI Blog: Rate Limiter Design
Challenge 3: Real-time Chat Application
Objective: Design a messaging system supporting real-time communication.
Key Learning Areas:
- WebSocket connections for real-time communication
- Message queues for reliable message delivery
- Database design for messages and user data
- Scalability for concurrent users
Requirements:
- Support 10,000 concurrent users
- Message delivery within 100ms
- Support group chats and private messages
- Message persistence and history
- Online/offline status
Implementation Steps:
- Design WebSocket connection management
- Implement message queuing with RabbitMQ/Kafka
- Design database schema for messages and users
- Add message encryption and security
- Implement push notifications for offline users
Resources: Coudo AI Blog: Chat Application Design
Challenge 4: Movie Ticket Booking System
Objective: Create a system for booking movie tickets with seat management.
Key Learning Areas:
- Concurrency control for seat reservations
- Database transactions and ACID properties
- Payment gateway integration
- Handling high demand for popular movies
Requirements:
- Support 1000 concurrent bookings
- Prevent double booking of seats
- Integrate with payment systems
- Handle seat selection and cancellation
- Support multiple theaters and showtimes
Implementation Steps:
- Design database with proper constraints
- Implement optimistic locking for seat reservations
- Add payment gateway integration
- Handle booking timeouts and cancellations
- Implement seat selection UI and logic
Resources: Coudo AI Blog: Movie Ticket Booking Design
Challenge 5: Expense Sharing App (Splitwise Clone)
Objective: Build an application for managing group expenses and settlements.
Key Learning Areas:
- Graph theory for user relationships
- Complex algorithms for optimal payment calculations
- Notification systems
- Data consistency in distributed scenarios
Requirements:
- Support groups of up to 50 people
- Calculate optimal payment settlements
- Send notifications for expenses and settlements
- Support multiple currencies
- Generate expense reports
Implementation Steps:
- Design graph-based data model for user relationships
- Implement settlement algorithms (minimum transactions)
- Add notification system with email/push
- Design multi-currency support
- Create reporting and analytics features
Resources: Coudo AI Blog: Expense Sharing App Design
Challenge 6: Social Media News Feed
Objective: Design a news feed system similar to Facebook or Twitter.
Key Learning Areas:
- Feed generation algorithms
- Content ranking and personalization
- Caching strategies for feed data
- Handling high read-to-write ratios
Requirements:
- Support 1 million users
- Generate personalized feeds
- Handle 10,000 posts per second
- Support real-time updates
- Implement content moderation
Implementation Steps:
- Design feed generation algorithms
- Implement content ranking with ML
- Use caching for feed data
- Add real-time updates with WebSockets
- Implement content moderation pipeline
Challenge 7: Video Streaming Platform
Objective: Build a Netflix-like video streaming service.
Key Learning Areas:
- CDN integration for global content delivery
- Video encoding and transcoding
- Recommendation systems
- Handling high bandwidth requirements
Requirements:
- Support 4K video streaming
- Global content delivery
- Personalized recommendations
- Handle 100,000 concurrent streams
- Support multiple devices
Implementation Steps:
- Design video storage and CDN architecture
- Implement video transcoding pipeline
- Build recommendation engine
- Add adaptive bitrate streaming
- Implement DRM and content protection
Challenge 8: E-commerce Platform
Objective: Design a scalable e-commerce system.
Key Learning Areas:
- Inventory management
- Order processing workflows
- Payment processing
- Search and recommendation systems
Requirements:
- Support 1 million products
- Handle 10,000 orders per day
- Real-time inventory updates
- Product search and filtering
- Secure payment processing
Implementation Steps:
- Design product catalog and inventory system
- Implement order processing workflow
- Add search with Elasticsearch
- Integrate payment gateways
- Build recommendation system
Challenge 9: Ride-Sharing Service
Objective: Create a system similar to Uber or Lyft.
Key Learning Areas:
- Real-time location tracking
- Matching algorithms
- Payment processing
- Driver and rider management
Requirements:
- Real-time driver-rider matching
- Location tracking and routing
- Payment processing and splitting
- Driver and rider ratings
- Support multiple cities
Implementation Steps:
- Design location tracking system
- Implement matching algorithms
- Add real-time communication
- Build payment and rating systems
- Implement surge pricing logic
Challenge 10: Distributed Cache System
Objective: Build a distributed caching system like Redis.
Key Learning Areas:
- Distributed systems
- Consistency models
- Partitioning and replication
- Cache eviction strategies
Requirements:
- Support 1 million key-value pairs
- Handle 100,000 requests per second
- Implement LRU eviction
- Support replication across nodes
- Handle node failures gracefully
Implementation Steps:
- Design distributed hash table
- Implement cache eviction algorithms
- Add replication and consistency
- Handle node failures and recovery
- Add monitoring and metrics
How to Approach These Challenges
1. Planning Phase
- Requirements Analysis: Understand functional and non-functional requirements
- Capacity Planning: Estimate traffic, storage, and compute needs
- Component Design: Break down the system into logical components
- Technology Selection: Choose appropriate technologies and tools
2. Design Phase
- High-Level Architecture: Create system diagrams
- Database Design: Design schemas and relationships
- API Design: Define interfaces and contracts
- Security Considerations: Plan authentication, authorization, and data protection
3. Implementation Phase
- Start Small: Begin with a minimal viable product
- Iterate: Add features incrementally
- Test: Implement comprehensive testing
- Monitor: Add logging and monitoring
4. Optimization Phase
- Performance Tuning: Optimize bottlenecks
- Scalability: Add horizontal scaling
- Reliability: Implement fault tolerance
- Security: Conduct security audits
Tools for Implementation
Development Tools
- Backend: Node.js, Python, Java, Go
- Databases: PostgreSQL, MongoDB, Redis
- Message Queues: RabbitMQ, Apache Kafka
- Cloud Platforms: AWS, Google Cloud, Azure
Design Tools
- Diagrams: Draw.io, Lucidchart, Excalidraw
- API Design: Postman, Swagger
- Monitoring: Prometheus, Grafana, ELK Stack
Testing Tools
- Load Testing: Apache JMeter, Artillery
- API Testing: Postman, Insomnia
- Database Testing: Database testing frameworks
Success Metrics
Track your progress with these metrics:
- Functional Requirements: All features working correctly
- Performance: Response times under acceptable thresholds
- Scalability: System handles expected load
- Reliability: High uptime and fault tolerance
- Security: No critical vulnerabilities
- Maintainability: Clean, well-documented code
Next Steps
- Choose a Challenge: Start with the URL shortener or rate limiter
- Set Up Environment: Prepare your development environment
- Create Timeline: Set realistic deadlines for each phase
- Document Progress: Keep a design journal
- Share Work: Get feedback from the community
- Iterate: Continuously improve your designs
Additional Resources
Practice Platforms
- SystemDesignPrep.com - Practice questions
- Grokking the System Design Interview - Interactive course
- LeetCode System Design - Community discussions
Design Tools
- Excalidraw - Free, collaborative diagramming
- Draw.io - Professional diagramming
- Lucidchart - Enterprise diagramming
Learning Resources
- Books: "Designing Data-Intensive Applications", "System Design Interview" series
- YouTube: Gaurav Sen, Hussein Nasser, Tech Dummies
- Blogs: High Scalability, Martin Fowler's blog
- Podcasts: Software Engineering Daily, The Changelog
Remember: The goal is not just to build working systems, but to understand the trade-offs and design decisions that go into creating scalable, reliable, and maintainable software systems.