Are you feeling nervous about your upcoming system design interview? You’re not alone. In the competitive landscape of Indian tech jobs, from startups in Bengaluru to established giants in Hyderabad and Pune, system design interviews have become a critical filter in the hiring process. For software engineers with 2+ years of experience, this is often the make-or-break round that determines whether you land that coveted role or see another rejection email.
The system design interview is unique because it tests not just your coding ability, but your capacity to think holistically about building scalable, reliable systems. While traditional coding interviews focus on algorithms and data structures, architecture interviews assess how you approach complex problems, make trade-offs, and communicate your thought process. According to a 2023 survey by GeeksforGeeks, system design questions appear in over 70% of interviews for senior software engineering roles at top tech companies in India.
This comprehensive guide is designed specifically for developers like you who are transitioning from writing code to designing systems. We’ll walk you through the fundamental concepts, explore common design patterns, dive into scalability principles that matter for Indian user bases (think millions of users in Tier 2 and Tier 3 cities), and provide you with a toolkit of resources to practice and excel.
By the end of this guide, you’ll have a clear roadmap for approaching any system design question, whether it’s designing a URL shortener like Bit.ly, building a scalable chat application, or architecting an e-commerce platform that can handle the traffic spikes during Diwali sales. Let’s transform your anxiety into confidence and your preparation into a clear strategy.
- Understand the core principles that govern system design interviews
- Learn essential design patterns and when to apply them
- Master scalability concepts for Indian market realities
- Get practice with real interview questions
- Access curated resources for continuous learning
1. Basics of System Design
Before diving into complex architectures, it’s crucial to establish a strong foundation. The system design interview is less about finding a “perfect” answer and more about demonstrating your ability to reason through trade-offs. In the Indian tech ecosystem, where companies like Zomato, Flipkart, and Ola handle massive scale, interviewers prioritize candidates who can articulate the “why” behind their decisions.
What is System Design?
System design is the process of defining the architecture, modules, interfaces, and data for a system to satisfy specified requirements. In the context of an architecture interview, you’re typically asked to design a system that meets certain functional and non-functional requirements. Functional requirements define what the system should do (e.g., “Users should be able to upload videos”), while non-functional requirements define how well the system should perform (e.g., “The system must handle 1 million requests per second with 99.99% uptime”).
Unlike coding interviews that test your ability to solve well-defined problems with optimal algorithms, system design interviews are open-ended. There’s rarely a single correct solution. Interviewers at companies like Amazon, Microsoft, or Infosys are evaluating:
- Your thought process: How do you break down a complex problem?
- Trade-off analysis: Why choose a NoSQL database over a relational one?
- Communication skills: Can you explain technical concepts clearly?
- Experience: Do you understand real-world constraints?
For Indian software engineers, this is particularly important because the market has unique challenges. You’re designing for users with varying internet speeds (from 4G in metros to 2G in rural areas), diverse device capabilities, and spikes in traffic during festivals or sales events. A system designed for Silicon Valley users might not work for Indian users without significant adjustments.
Key Components of Any System
Every system you design in an interview will involve several core components. Understanding these building blocks is essential before you can assemble them into a coherent architecture.
- Client Layer: The interface where users interact with your system. This could be a mobile app (think Android/iOS for Indian users), web browser, or API client. In India, where mobile-first usage dominates, designing for low-end devices and intermittent connectivity is crucial.
- Application Layer: This is where your business logic lives. It processes requests, applies rules, and coordinates between other components. Modern systems often split this into multiple services (microservices) for scalability.
- Data Layer: Where your data is stored and retrieved. This includes databases, caches, and file storage. Choosing the right data layer is critical for performance, especially when dealing with Indian regulatory requirements like data localization.
- Infrastructure Layer: The underlying platform that runs your application. This could be on-premise servers, cloud providers like AWS or Azure (both have significant presence in India), or hybrid setups.
Non-Functional Requirements (NFRs) – The Real Differentiator
While functional requirements are usually straightforward in interviews, NFRs are where candidates often struggle. These are the qualities that determine how well your system performs under various conditions. Let’s break down the most critical ones for Indian context:
| NFR Category | What It Means | Indian Context Consideration |
|---|---|---|
| Scalability | Ability to handle increased load | Design for 10x traffic spikes during IPL finals or Big Billion Days |
| Availability | System uptime percentage (e.g., 99.99%) | Consider power outages, network issues in Tier 2/3 cities |
| Latency | Response time for user requests | Target <200ms for mobile apps on 3G/4G networks |
| Consistency | Data accuracy across replicas | Balance with availability per CAP theorem |
| Cost | Infrastructure and operational costs | Crucial for Indian startups with limited funding |
When discussing NFRs in an interview, always quantify them. Instead of saying “the system should be fast,” say “the system should have a P99 latency of under 300ms for API responses.” This shows precision and helps guide your design decisions. For example, if you’re designing a payment system for an Indian e-commerce platform, you might need to handle 10,000 transactions per second during Diwali sales while maintaining 99.99% availability.
A common mistake is to list every NFR as critical. In reality, you must prioritize. For a chat application, latency might be more important than strong consistency. For a financial transaction system, consistency and availability are paramount. The key is to understand the problem domain and make conscious trade-offs—this is what interviewers are listening for.
2. Common Design Patterns
Design patterns provide reusable solutions to common problems. In system design interviews, knowing these patterns helps you quickly sketch out architectures and demonstrate experience. However, the goal isn’t to memorize patterns but to understand when and why to use them. For Indian engineers, many patterns are directly applicable to building cost-effective, scalable solutions that serve diverse user bases.
Microservices vs. Monolithic Architecture
The debate between microservices and monolithic architecture is a classic system design question. Understanding both patterns is essential because interviewers will ask you to justify your choice.
Monolithic Architecture is the traditional approach where all components of an application are built as a single unit. The entire system is deployed together, and all components share the same resources. This pattern is simpler to develop and test initially, making it a good starting point for many Indian startups.
Pros:
- Simple development and debugging—everything is in one codebase
- Performance is often better due to in-process calls
- Easier to test and deploy initially
- Lower operational complexity (fewer moving parts)
Cons:
- Difficult to scale specific components (must scale the entire app)
- Technology lock-in (hard to switch stacks for different modules)
- Single point of failure (entire app goes down if one module fails)
- Becomes unwieldy as the codebase grows
Microservices Architecture breaks the application into small, independent services that communicate over APIs. Each service has its own codebase, database, and deployment cycle. This is the pattern adopted by most large Indian tech companies (Flipkart, Ola, etc.) after they scaled beyond monolithic limitations.
Pros:
- Independent scaling: Scale only the services that need it (e.g., scale the payment service during checkout peaks)
- Technology diversity: Use the best tool for each job (Python for ML, Java for backend, Go for high-performance services)
- Fault isolation: A bug in the recommendation service doesn’t bring down the entire e-commerce platform
- Faster deployments: Teams can deploy their services independently
Cons:
- Increased complexity (network calls, service discovery, distributed tracing)
- Higher operational overhead (managing multiple services)
- Data consistency challenges across services
- Latency overhead from inter-service communication
When to choose which pattern:
- Choose Monolith for: Small teams, early-stage startups, MVPs, simple CRUD applications, when deployment simplicity is crucial
- Choose Microservices for: Large-scale applications, complex business domains, multiple teams working independently, when different parts have vastly different scaling needs
In interviews, a strong candidate would say: “For this photo-sharing app, I’d start with a monolithic architecture because the team is small and we need to move fast. However, I’d design it with clear module boundaries so that we can extract services later. Specifically, I’d separate the upload service, feed generation service, and user authentication service into distinct modules that could become microservices when needed.”
Event-Driven Architecture
Event-driven architecture is a pattern where components communicate through events (messages) rather than direct calls. This pattern is particularly valuable in the Indian context where systems need to be resilient to network failures and can process asynchronous workloads efficiently.
Key components of an event-driven system:
- Event Producers: Components that generate events (e.g., a user places an order)
- Event Brokers: Systems that route events (like Apache Kafka, RabbitMQ, or Amazon SQS)
- Event Consumers: Services that process events (e.g., inventory service, payment service, notification service)
Benefits in the Indian market:
- Resilience: If the payment service is down during a spike in orders (like during a flash sale), events can queue up and process later rather than losing transactions
- Scalability: You can scale consumers independently. For example, during festival seasons, add more consumers for the notification service to handle increased messaging
- Flexibility: Adding new consumers doesn’t affect existing producers. For instance, adding a fraud detection service to the order flow without changing the order placement logic
Real-world example: Zomato and Swiggy use event-driven architecture for order processing. When a restaurant confirms an order, it triggers an event that:
- Notifies the delivery partner system
- Updates inventory in the kitchen management system
- Sends confirmation to the customer app
- Updates the analytics dashboard
In interviews, use this pattern when you need to:
- Handle bursts of activity (e.g., ticket booking for cricket matches)
- Integrate multiple systems with different processing speeds
- Build loosely coupled services that can evolve independently
- Ensure reliable processing even when downstream services are temporarily unavailable
Cache-Aside Pattern
The cache-aside pattern (also known as lazy loading) is one of the most common and practical patterns you’ll use in system design. It’s essential for improving performance and reducing database load—critical considerations when serving millions of Indian users on limited infrastructure budgets.
How it works:
- Application checks the cache for data first
- If cache hit (data found), return directly to the caller
- If cache miss (data not found), query the database
- Store the result in cache with an expiration time
- Return data to caller
Key considerations for Indian context:
- Cache invalidation: When data changes, you must update or invalidate the cache. For example, if a user updates their profile picture, the old cached version should be invalidated. This is critical for systems like e-commerce where product prices change frequently during sales.
- Cache TTL (Time To Live): Choose appropriate expiration times. For user sessions, you might set 30 minutes. For product catalogs, it could be hours. For static content like app configurations, it could be days.
- Cache size and eviction: With limited memory in Indian data centers (compared to global averages), you need strategies like LRU (Least Recently Used) or LFU (Least Frequently Used) to manage cache.
- Popular data in Indian context: Cache cricket scores, festival sale offers, and trending content aggressively, as these generate massive, predictable traffic spikes.
Example implementation for an e-commerce product page:
- Cache product details with 1-hour TTL
- Cache user reviews with 10-minute TTL (reviews change less frequently)
- Don’t cache inventory/stock levels (need real-time accuracy)
- Use Redis (available in Mumbai and Bangalore AWS regions) for high-performance caching
- Implement cache warming before major sales events (pre-populate cache with top products)
Common interview question: “How do you handle cache stampede (thundering herd) when cache expires for a popular product during a sale?”
Answer: “Use a combination of techniques: 1) Add jitter to TTL (randomize expiration), 2) Implement cache locking so only one request computes and caches the value, 3) Pre-warm cache before the sale, 4) Use a secondary cache with longer TTL as a fallback.”
Load Balancing Pattern
Load balancing is the practice of distributing incoming traffic across multiple servers to ensure no single server is overwhelmed. In India, where internet traffic can spike unpredictably (think WhatsApp forwards during cricket matches), load balancing is not optional—it’s essential for maintaining service availability.
Types of Load Balancers:
- Hardware Load Balancers (F5 BIG-IP): Physical devices that offer high performance but are expensive. Rarely used by Indian startups due to cost, but common in enterprise setups (banks, telecom companies).
- Software Load Balancers (Nginx, HAProxy): Run on commodity hardware. Cost-effective and flexible—most Indian startups use these. Nginx is particularly popular because it’s lightweight and handles high concurrent connections.
- Cloud Load Balancers (AWS ELB, Google Cloud Load Balancer): Managed services that scale automatically. Ideal for Indian companies scaling globally. AWS Mumbai region’s ELB handles over 1 million requests per second.
Load Balancing Algorithms:
- Round Robin: Distributes requests sequentially (server1, server2, server3, then back to server1). Simple but doesn’t account for server load.
- Least Connections: Sends requests to the server with fewest active connections. Better for sessions with varying durations (e.g., video streaming on Hotstar).
- IP Hash: Routes requests based on client IP. Ensures a user always goes to the same server (useful for session stickiness).
- Weighted: Assigns weights to servers based on capacity (e.g., server with 16GB RAM gets more traffic than server with 8GB RAM).
Multi-layer Load Balancing:
For large-scale systems, you need multiple levels of load balancing:
- Global Load Balancing: Distributes traffic across regions (e.g., users from South India go to Bangalore data center, users from North India go to Delhi data center). Use DNS-based load balancing or services like AWS Route 53.
- Regional Load Balancing: Within a region, distribute across availability zones (AZs). For example, in AWS Mumbai region, traffic is distributed across three AZs.
- Application Load Balancing: Routes based on URL paths (e.g., /api/users to user-service, /api/products to product-service). AWS ALB or Nginx can do this.
Health Checks and Failover:
A good load balancer continuously checks server health and removes unhealthy instances. For example, if a server’s response time exceeds 500ms or returns 5xx errors, the load balancer routes traffic away. In Indian contexts, where power outages or network issues can cause servers to become unresponsive, robust health checks are crucial. Configure multiple health check endpoints (not just /health, but /health/db, /health/cache) to diagnose issues quickly.
Session Management:
For applications requiring user sessions (like e-commerce carts), you need “sticky sessions” where a user’s requests always go to the same server. However, this can create imbalance. Better approaches:
- Store sessions in a distributed cache (Redis) so any server can handle any request
- Use JWT tokens that contain session data, eliminating server-side session storage
- For Indian users with slow connections, consider longer session timeouts to avoid frequent re-authentication
In interviews, when discussing load balancing, always consider the Indian context: mention using multi-AZ deployments in Mumbai/Bangalore regions, handling traffic during IPL matches, and cost optimization (choosing the right instance types for your load balancers).
3. Scalability Concepts
Scalability is arguably the most important concept in system design interviews. Indian startups often scale from 10,000 users to 10 million users in a matter of months during viral growth. Understanding how to design systems that can handle this explosive growth is what separates good engineers from great ones.
Vertical vs. Horizontal Scaling
These are the two fundamental approaches to scaling, and understanding their trade-offs is crucial for any system design discussion.
Vertical Scaling (Scaling Up):
This involves adding more resources (CPU, RAM, storage) to an existing server. Think of it as upgrading your laptop to a better one with more RAM and a faster processor.
Advantages:
- Simplicity: No changes needed to application architecture—just upgrade the server
- No code changes: Existing applications work without modification
- Lower complexity: Single server means no distributed system complexity
- Consistent performance: No network latency between components
Disadvantages:
- Limited scalability: There’s a physical limit to how much you can scale up
- Single point of failure: If the server fails, everything goes down
- High cost escalation: Larger servers cost exponentially more. A server with 256GB RAM might cost 10x more than four servers with 64GB RAM each
- Upgrade downtime: Requires downtime to upgrade hardware
Best for: Early-stage startups, simple applications, legacy systems, when team lacks distributed systems expertise
Real-world Indian example: Early stage startups like Freshdesk initially used vertical scaling, upgrading from a single server to larger instances on AWS as their user base grew. This allowed them to focus on product-market fit rather than distributed systems complexity.
Horizontal Scaling (Scaling Out):
This involves adding more servers to distribute the load. Think of it as adding more cashiers at a supermarket instead of making one cashier faster.
Advantages:
- Near-infinite scalability: Can add servers as needed (theoretically unlimited)
- High availability: If one server fails, others can handle the load
- Better cost efficiency: Adding commodity servers is cheaper than buying a super-large server
- Geographic distribution: Can place servers closer to users (important for Indian users spread across the country)
- Incremental scaling: Add servers gradually based on demand
Disadvantages:
- Application complexity: Requires careful design for statelessness, session management, and distributed data
- Infrastructure overhead: Need load balancers, monitoring, deployment automation
- Data consistency challenges: Keeping data consistent across multiple servers
- Network dependencies: Performance depends on network between servers
Best for: High-traffic applications, need for high availability, large-scale systems, when you can invest in distributed systems expertise
Real-world Indian example: Flipkart’s journey from monolith to microservices involved horizontal scaling. During Big Billion Days, they scale from hundreds to thousands of servers across multiple AWS regions to handle 5-10x traffic spikes.
Hybrid Approach (Recommended for Most):
Many successful Indian companies use a hybrid strategy:
- Start with vertical scaling: Use a moderately sized server (e.g., AWS EC2 c5.2xlarge) for the initial launch
- Design for horizontal scalability: Build stateless services, use external caches (Redis), and implement proper session management
- Scale out when needed: Add servers behind a load balancer when load increases
- Keep databases vertical initially: Databases are harder to scale horizontally, so use vertical scaling (larger RDS instances) for longer
- Use read replicas: For databases, implement read replicas (horizontal read scaling) while keeping write masters vertical
Cost Comparison (AWS Mumbai pricing, approximate):
| Approach | Configuration | Monthly Cost (INR) | Handles |
|---|---|---|---|
| Vertical Only | 1x c5.9xlarge (36 vCPU, 72GB RAM) | ₹1,50,000 | ~10,000 concurrent users |
| Horizontal (4x) | 4x c5.2xlarge (8 vCPU, 16GB RAM) + LB | ₹1,80,000 | ~40,000 concurrent users |
| Hybrid | 1x c5.4xlarge + 2x read replicas | ₹1,20,000 | ~25,000 concurrent users |
In interviews, always discuss cost implications. Indian startups have limited budgets compared to global counterparts. A candidate who understands that horizontal scaling with 4 smaller servers often costs more than one large server but provides better availability shows maturity.
Database Scaling Strategies
Database scaling is often the bottleneck in system design. Indian e-commerce platforms during sales see 100x traffic spikes, and databases usually fail first. Understanding different strategies is crucial for interview success.
1. Vertical Scaling (First Line of Defense)
Start by upgrading your database server—larger CPU, more RAM, faster SSDs. This is the simplest approach but has limits.
When to use:
- Early-stage applications (up to ~1 million users)
- When your workload fits in memory (check cache hit ratio)
- When write load is moderate
Cost-effective tips for Indian startups:
- Use AWS RDS Reserved Instances for 3-year commitment (save 60-70%)
- Use GP3 volumes instead of IO1 for moderate workloads (cheaper, adequate performance)
- Consider moving cold data to S3/Glacier (costs 1/100th of database storage)
2. Read Replicas (Horizontal Scaling for Reads)
Create read-only copies of your database that handle SELECT queries while the primary handles writes. This is the most common and effective first step for scaling reads in Indian startups.
How it works:
- Master database handles all writes (INSERT, UPDATE, DELETE)
- Read replicas handle SELECT queries
- Data replicates from master to slaves with minimal lag (typically <1 second)
Implementation considerations:
- Replication lag: Users might see slightly stale data. For Indian e-commerce, show “Updated 2 mins ago” on product pages
- Read routing: Use middleware or connection poolers to route reads to replicas and writes to master
- Multiple replicas: Start with 2-3 replicas, scale as needed. Most Indian companies use 3-5 replicas for their primary product databases
- Regional replicas: For pan-India user base, place replicas closer to users (e.g., Mumbai for West India, Chennai for South India)
Cost (AWS RDS MySQL in Mumbai):
- Primary db.r5.2xlarge: ₹30,000/month
- Each read replica (same size): ₹30,000/month
- For 10x read scaling: Primary + 2 replicas = ₹90,000/month (vs. upgrading to db.r5.16xlarge at ₹4,00,000/month)
3. Sharding (Horizontal Partitioning)
Sharding is the most complex but most scalable approach. It involves splitting your database into smaller, independent databases (shards), each holding a subset of data.
Sharding strategies:
- Range-based sharding: Users with IDs 1-1M in shard1, 1M-2M in shard2. Easy to implement but can create hotspots (most active users might be in same shard)
- Hash-based sharding: Use hash(user_id) % num_shards to distribute evenly. Better load distribution but harder to scale (need to rehash when adding shards)
- Geographic sharding: Users from North India in Mumbai shard, South India in Bangalore shard. Good for Indian companies with regional user patterns
- Entity-based sharding: Separate databases for users, orders, products. Similar to microservices architecture
Indian context challenges:
- Hot partitions: During IPL auctions, all queries go to one shard (players being auctioned). Need hot cache + load distribution
- Complexity cost: Small Indian startups often lack DBAs. Sharding adds operational overhead
- Data locality: Indian data laws (like RBI’s data localization) might require certain data to stay in specific regions, affecting sharding strategy
When to shard (practical thresholds):
- Single database exceeds 2TB (backup/restore becomes painful)
- Write load > 10,000 writes/second on primary
- Read replicas > 5 and still can’t keep up
- Team size > 50 engineers and multiple teams fighting for schema changes
Real-world example: Myntra (owned by Flipkart) implemented sharding based on user geography. They have separate databases for different regions to comply with data regulations and improve latency. During their end-of-season sales, they also shard by product categories to distribute load.
4. Caching Layer (Beyond the Database)
Before scaling the database itself, add a caching layer. This is often the most cost-effective solution for Indian startups.
Strategy:
- L1 Cache (Application level): In-memory cache like Ehcache (Java) or Caffeine. Faster but per-application
- L2 Cache (Distributed): Redis or Memcached. Shared across applications, scales horizontally
- Cache placement: Redis clusters in Mumbai, Bangalore, Delhi for pan-India coverage
Cost comparison (1M daily active users):
| Approach | Infrastructure Cost (INR/month) | Performance (P99 Latency) | Complexity |
|---|---|---|---|
| No cache, single DB | ₹15,000 | 500-2000ms | Low |
| Vertical DB scaling | ₹60,000 | 100-500ms | Low |
| Read replicas (2) | ₹45,000 | 50-200ms | Medium |
| Redis + DB | ₹35,000 | 10-50ms | Medium |
| Full sharding | ₹2,00,000+ | 20-100ms | Very High |
Hybrid strategy for Indian startups:
- Phase 1 (0-100K users): Single vertical DB + Redis cache. Cost: ₹20,000/month
- Phase 2 (100K-1M users): Primary DB + 2 read replicas + Redis. Cost: ₹60,000/month
- Phase 3 (1M-10M users): Introduce sharding for high-growth tables (users, orders) + read replicas for other tables. Cost: ₹1,50,000/month
In system design interviews, always start with “First, I’d add a caching layer” before discussing database scaling. It shows you understand cost optimization and can solve problems without immediately jumping to complex solutions.
Content Delivery Networks (CDN) for Global Reach
CDNs are essential for serving static content (images, CSS, JS, videos) quickly to users worldwide. For Indian companies expanding globally or serving Indian diaspora, CDNs are non-negotiable.
How CDNs work:
- Content is cached in edge locations (POPs – Points of Presence) around the world
- Users fetch content from the nearest POP, not the origin server
- Reduces latency significantly (from 200ms to 20ms for users in US/EU)
Popular CDNs for Indian companies:
- CloudFront (AWS): Best for AWS users. Has 4 POPs in India (Mumbai, Delhi, Chennai, Hyderabad). Cost: $0.085/GB for first 10TB (≈ ₹6.3/GB)
- Akamai: Enterprise-grade, most POPs in India. Expensive but reliable
- Fastly: Developer-friendly, good for dynamic content. Used by companies like Flipkart
- Cloudflare: Cheaper (has free tier), includes DDoS protection. Great for startups
- BunnyCDN: Cost-effective (≈ ₹2/GB), good for Indian startups with global audience
Indian context considerations:
- Multiple CDNs: Use Cloudflare for API calls (cheap) + CloudFront for video (AWS integration)
- Edge computing: Use Lambda@Edge (CloudFront) or Cloudflare Workers to run code closer to users (e.g., user authentication at edge)
- Optimization for Indian networks: Compress images aggressively, use modern formats (WebP/AVIF), implement lazy loading. Indian users on 2G/3G will thank you
- Compliance: For Indian user data, ensure CDN provider has data centers in India and complies with local regulations
Cost savings example:
A video streaming app serving 10TB/month to Indian users:
- Without CDN: Server bandwidth (AWS) = ₹3,00,000/month
- With Cloudflare: ₹0 (free tier covers 10TB) or with BunnyCDN = ₹20,000/month
- Savings: 93-100% on bandwidth costs
When to discuss CDNs in interviews:
- When designing media-heavy applications (Instagram, YouTube, e-commerce with product images)
- For global user bases (even if starting in India, mention future expansion)
- When latency is critical (gaming, real-time applications)
- For cost optimization (bandwidth is expensive in India)
Remember: CDN is not just for static files. Modern CDNs can do:
- Image optimization on-the-fly (resize, compress, convert format)
- Video transcoding and streaming (HLS/DASH)
- API acceleration (caching dynamic API responses at edge)
- DDoS protection (crucial for Indian startups facing growth attacks)
- Start vertical: Use single large server for simplicity
- Add caching immediately: Redis/Memcached for reads, reduce DB load by 80%
- Scale reads horizontally: Add read replicas for 3x-5x read capacity
- Use CDN for static content: Offload 90% of bandwidth from your servers
- Shard only when necessary: When you have >5M users and 10TB+ data
- Monitor and iterate: Use tools like CloudWatch/Prometheus to identify bottlenecks
4. Popular System Design Questions
Here are the most frequently asked system design questions in Indian tech interviews, with detailed approaches and solutions tailored to Indian market conditions.
1. Design a URL Shortener (Like Bit.ly/ TinyURL)
Problem Statement: Design a service that takes long URLs and returns short, unique URLs. When someone visits the short URL, redirect to the original long URL. Must handle 100 million daily active users and 1 billion URL requests per day.
Functional Requirements:
- Generate short URL for given long URL (6-8 characters)
- Redirect short URL to original URL
- Track click analytics (geography, device, timestamp)
- Support custom short URLs (e.g., mycompany.in/diwali-sale)
- API-based URL generation (REST/gRPC)
Non-Functional Requirements:
- High availability (99.99%)
- Low latency (<100ms for redirect)
- Scalability: 1B requests/day ≈ 12,000 requests/second
- Data storage: 10B URLs in 3 years ≈ 500TB (assuming 50 bytes per URL)
- Cost-effective: Must run under ₹50 Lakhs/year for a startup
High-Level Design:
1. URL Generation Strategy:
Instead of database-generated IDs (which don’t scale), use hash functions:
- Base62 encoding: Convert incremental integer to base62 (a-z, A-Z, 0-9). For 8 chars, can generate 218 trillion unique URLs
- Consistent hashing: For distributed generation without coordination
- Collision handling: If hash already exists (rare), append character and retry
For Indian context: Include Unicode support for Hindi/vernacular custom URLs? No—stick to ASCII for URL safety and DNS compatibility.
2. Architecture Components:
-
- Load Balancer (Nginx/AWS ALB): Distributes incoming traffic
- API Gateway: Rate limiting, authentication for API requests
- URL Shortening Service (Microservice): Handles URL creation logic
- Redirect Service (Lightweight): Handles URL lookups (optimized for speed)
- Database Layer: For storing URL mappings
- Cache Layer: Redis for hot URLs (e.g., trending URLs during cricket matches)
Analytics Service: Async processing of click events (using Kafka/SQS)
3. Data Storage Design:
Primary Database (Write-heavy):
- Choose: Cassandra or DynamoDB (NoSQL) because writes >> reads for URL generation
- Why: Horizontal scalability, write-heavy workload, eventual consistency is OK (URLs don’t change after creation)
- Schema: (short_url: string, long_url: string, created_at: timestamp, expires_at: timestamp, owner_id: string)
- Sharding: Shard by short_url prefix (e.g., all ‘a’ URLs go to shard A). For India’s scale, 10 shards initially, 100 later
Analytics Database (Read-heavy):
- Choose: ClickHouse or Apache Druid (OLAP database)
- Why: Optimized for analytical queries (SUM, AVG, GROUP BY) on time-series data
- Alternative (cost-effective): PostgreSQL with TimescaleDB extension (if team has SQL expertise)
4. Caching Strategy:
- L1 Cache: In-memory cache in redirect service (Caffeine/Ehcache). Keep top 10% URLs (80% of traffic)
- L2 Cache: Redis cluster (shared). Keep top 50% URLs (95% of traffic)
- Cache warming: Pre-populate cache with viral URLs (e.g., festival offers, cricket highlights)
- Eviction policy: LRU (Least Recently Used) + TTL of 24 hours for hot URLs
5. Traffic Patterns (Indian Context):
URL shorteners have predictable spikes:
- Daily peaks: 8-10 AM, 6-9 PM (social media sharing)
- Event-based spikes: IPL matches, festival sales, political announcements (10-100x normal traffic)
- Regional distribution: Most traffic from Tier 1 cities (Delhi, Mumbai, Bangalore, Hyderabad)
6. Handling Spikes:
- Auto-scaling: Configure EC2 instances to scale from 10 to 100 based on CPU > 70%
- Queue-based processing: Offload analytics to SQS/Kafka to decouple from redirect flow
- Graceful degradation: If cache misses and DB is overloaded, serve a default long URL (fallback) or show “try again” message
7. Cost Optimization (Critical for Indian Startups):
- Compute: Use AWS Spot instances for URL generation service (70% cheaper). Regular instances for redirect service
- Storage: Use S3 + Glacier for analytics data older than 30 days
- CDN: Use Cloudflare (free tier) for static assets
- Database: Use DynamoDB on-demand pricing initially, switch to provisioned capacity later
- Estimated cost: 1M URLs/day = ₹15,000/month (EC2: 5K, DynamoDB: 8K, Redis: 2K)
8. API Design (RESTful):
- POST /api/shorten
- Request: { “long_url”: “https://example.com”, “custom_alias”: “diwali”, “expires_in_days”: 7 }
- Response: { “short_url”: “myapp.in/diwali”, “created_at”: “2024-10-01T12:00:00Z” }
- GET /{short_url} (redirect 301 to original URL)
- GET /api/analytics/{short_url} (for URL owner)
Common Interview Follow-up Questions:
- How to prevent abuse (spam URLs)?
- Rate limiting per IP (1000 URLs/day)
- Blacklist adult/gambling domains using external APIs
- Manual review for URLs with >1M clicks
- Require login for custom aliases
- What if someone creates a malicious custom alias?
- Block reserved words (admin, login, bank, etc.)
- Report/abuse mechanism for other users
- Takedown within 1 hour for legal complaints
- How to handle 10B URLs storage?
- Shard by first character (26*2 + 10 = 62 shards)
- Use TTL for temporary URLs (auto-delete after expiry)
- Archive inactive URLs (no clicks in 2 years) to cold storage
Expert Tip for Indian Interviews:
2. Design a Scalable Chat Application (Like WhatsApp)
Problem Statement: Design a real-time chat application that supports one-on-one and group messages, file sharing (images, videos), and works across iOS, Android, and Web. Must support 10 million concurrent users and 100 billion messages/day. Ensure low latency (<200ms) and 99.99% availability.
Functional Requirements:
- One-to-one messaging (text, images, videos, documents)
- Group chats (up to 100 participants)
- Real-time delivery (typing indicators, read receipts)
- Message persistence (history)
- User presence (online/offline status)
- Push notifications for offline users
- End-to-end encryption (optional but recommended)
Non-Functional Requirements:
- Latency: <200ms for message delivery (lower than global average due to better networks in Indian metros)
- Availability: 99.99% (max 4 minutes downtime per month)
- Scalability: 10M concurrent users, 100B messages/day ≈ 1.1M messages/second
- Consistency: Eventual consistency for messages (can accept slight delays for cost optimization)
- Cost: Must compete with free apps like WhatsApp, so ₹0.01 per user per month target
High-Level Design:
1. System Architecture (Chat Platform):
We need three main components working together:
- User Service: Manages user accounts, contacts, profiles
- Message Service: Handles message routing, delivery, storage
- Real-time Connection Service: Manages WebSocket connections (long-lived)
- File Storage Service: Handles media uploads/downloads
- Notification Service: Push notifications for offline users
2. Communication Protocols (Critical Decision):
WebSocket vs. HTTP Long Polling:
- WebSocket (Recommended): Full-duplex, real-time connection. Higher scalability (100K connections per server) but more complex to manage. Use for mobile apps.
- HTTP Long Polling: Simpler (standard HTTP), works through firewalls, but lower efficiency (1000 concurrent requests per server). Use fallback for web clients behind corporate firewalls.
- For Indian context: Start with WebSocket (most Indian users have good 4G/WiFi), implement long polling fallback for users in rural areas with proxy servers.
3. Message Flow Architecture:
Let’s trace the flow when User A sends message to User B:
- Client (User A): Sends message via WebSocket to Connection Server (CS-1)
- Connection Server (CS-1): Validates user, assigns message ID, forwards to Message Queue (Kafka)
- Message Queue: Buffers messages, ensures no message is lost during processing spikes
- Message Processor (Consumer): Processes messages, stores in database, identifies target users
- Routing Service: Finds which Connection Server (CS-2) User B is connected to
- Delivery Service: Pushes message to CS-2 via internal WebSocket or gRPC
- CS-2: Delivers message to User B’s device
- Acknowledgement: User B’s client sends ack back to CS-2 → Message Queue → CS-1 → User A
4. Connection Management (The Hardest Part):
Each Connection Server can handle ~100K WebSocket connections. For 10M users, you need 100 Connection Servers. But how do you know which user is on which server?
Connection Mapping Service:
- Use Redis Sorted Sets or Redis Hash to store user_id → connection_server mapping
- Store with TTL (1 hour) to auto-cleanup stale connections
- Update on every login/logout/connection drop
- For Indian users who switch between WiFi and 4G frequently, this must be very fast (10-20ms)
5. Data Storage Strategy (Hybrid Approach):
Chat apps need two types of data storage:
A. Recent Messages (Hot Data):
- Storage: Redis Streams or Apache Kafka (for message queue + recent history)
- Retention: Last 30 days for active chats, 7 days for inactive
- Why: Fast reads/writes, supports fan-out for group chats
- Cost: ~₹5 Lakhs/month for 100B messages (compressed)
B. Historical Messages (Cold Data):
- Storage: Cassandra or ScyllaDB (wide-column store)
- Partitioning: Partition by conversation_id + timestamp
- Compression: Use LZ4 compression (reduces storage by 70%)
- Retention: Indefinite (optional, user-deletable)
- Cost: ~₹10 Lakhs/month for 1PB of compressed data
C. Media Files (Images/Videos):
- Storage: S3 with S3 Intelligent-Tiering (moves old files to cheaper tiers)
- CDN: CloudFront with Edge caching in Mumbai, Bangalore, Delhi
- Optimization: Compress images to WebP (reduce by 30-50%), transcode videos to H.265 (reduce by 60%)
- Cost: ~₹2 Lakhs/month for 10TB (Indian users send less media due to data costs)
6. Handling Group Chats (The Scalability Challenge):
For a group of 100 users, sending 1 message means 100 deliveries. This is 100x load vs 1-1 chat.
Strategy 1: Fan-out on Write (Push)
- When message is sent, immediately push to all connected group members
- Good for small groups (<20 members)
- Low latency but high load on Connection Servers
Strategy 2: Fan-out on Read (Pull)
- Store message in queue, group members pull when online
- Good for large groups (>20 members)
- Higher latency but better scalability
Hybrid Strategy (Recommended):
- For groups <20: Fan-out on write
- For groups 20-100: Fan-out on write for online members, queue for offline
- For groups >100 (broadcast): Use read-based model (WhatsApp Business groups use this)
7. Message Delivery Guarantees:
Chat apps need exactly-once delivery semantics:
- Unique Message ID: Use UUID or combination of (sender_id + timestamp + sequence_number)
- Idempotency: Receiver deduplicates using message ID
- Retry mechanism: Exponential backoff (1s, 2s, 4s, 8s) with max 5 retries
- Offline queue: Store undelivered messages in Redis with TTL (7 days)
- Offline users in India: Users in metros with good networks receive real-time; users in rural areas receive in batch when they come online
8. Push Notifications (Mobile Apps):
When user is offline, send push notifications:
- Android: Firebase Cloud Messaging (FCM) – Free, reliable
- iOS: Apple Push Notification Service (APNS)
- Strategy: For <1000 unread messages, send summary push. For >1000, send “You have new messages”
- Cost: FCM is free, APNS is free. Only need notification servers (~₹20K/month)
- Indian context: Optimize for battery life (Android devices in India often have smaller batteries). Batch notifications every 15 minutes instead of real-time.
9. End-to-End Encryption (E2EE):
For privacy-conscious users (increasing in India post privacy concerns):
- Algorithm: Signal Protocol (industry standard)
- Implementation: Library depends on language. Use Signal’s libsignal for Java/Android
- Key management: Users exchange keys via Diffie-Hellman key exchange
- Trade-off: E2EE makes message search difficult (can’t search message content on server)
- Indian legal context: E2EE might face regulatory scrutiny (traceability requirements). Design with ability to disable for specific users if needed for legal compliance.
10. Scalability & Sharding Strategy:
Shard by User ID (Consistent Hashing):
- All data for users 1-1M → Shard 1, 1M-2M → Shard 2, etc.
- Each shard contains: User profiles, recent messages, connection mappings
- Redis cluster for connection mapping (separate from data shards)
Shard by Conversation ID (For Group Chats):
- Group messages stored in conversation_id shard (independent of user distribution)
- Reduces cross-shard queries for group message retrieval
11. Cost Analysis (10M Users):
| Component | Configuration | Monthly Cost (INR) | Percentage |
|---|---|---|---|
| Connection Servers | 100x c5.2xlarge (EC2 Spot) | ₹2,00,000 | 20% |
| Message Queue (Kafka) | 6-node cluster, m5.2xlarge | ₹1,50,000 | 15% |
| Redis (Caching/Connections) | Redis Enterprise 3-node cluster | ₹1,80,000 | 18% |
| Database (Cassandra) | 10-node cluster, r5.2xlarge | ₹2,50,000 | 25% |
| File Storage (S3 + CDN) | 100TB storage + 100TB transfer | ₹80,000 | 8% |
| Load Balancers & Network | ALB + Data Transfer | ₹60,000 | 6% |
| Monitoring & Logs | CloudWatch, Prometheus, Grafana | ₹30,000 | 3% |
| Total | ₹9,50,000 | 100% |
Per User Cost: ₹0.095 per user per month (₹0.01 = 10 paise) – 35% cheaper than WhatsApp’s estimated cost, thanks to Indian engineering talent and optimized infrastructure.
12. Indian Market Optimizations:
- Data Saver Mode: Compress messages by 70%, images by 50% for users on limited plans
- Offline First: Design apps to work offline (queue messages locally) since network drops are common
- Low-End Device Support: Optimize memory usage (Android Go devices have <2GB RAM)
- Multi-Language Support: UI in Hindi, Tamil, Bengali, etc. – Store in separate translation service
- Voice Messages: Highly popular in India (2-3x more than text in some demographics). Optimize voice compression (AMR-WB codec)
- UPI Payments Integration: Add “Pay via UPI” button in chat (like WhatsApp Pay). Use NPCI’s UPI API (UPI Lite for <₹200 transactions reduces load)
Common Interview Follow-ups:
- How to handle reconnections after network drop?
- Client stores unsent messages locally (SQLite/Realm)
- On reconnection, sync last 24 hours to avoid duplicates
- Use sequence numbers to detect missing messages
- How to prevent duplicate messages?
- Unique message ID (sender_id + timestamp + random)
- Idempotent message processor (check Redis for existing ID)
- Client deduplication (show only once in UI)
- How to handle 10M concurrent WebSocket connections?
- Each server handles 100K connections → 100 servers
- Use connection pooling at load balancer level
- Implement connection heartbeat (ping/pong every 30s) to detect dead connections
- What if Message Queue (Kafka) is overloaded?
- Implement backpressure: Slow down producers
- Add more Kafka brokers (horizontal scaling)
- Use Redis Streams as buffer for less critical messages
- How to comply with Indian IT Rules 2021 for traceability?
- Store message metadata (who sent, when, to whom) in audit logs
- E2EE messages content, but metadata must be traceable for legal requests
- Implement mechanism to reveal keys for specific users if court orders
- Start with WebSocket (but have HTTP long-polling fallback)
- Use Kafka for message queue (handles 1M+ messages/sec)
- Redis for connection mapping and caching recent messages
- Cassandra for long-term storage (partition by conversation_id)
- Design for offline-first (Indian users face frequent disconnections)
- Optimize for cost (use Spot instances, compress data heavily)
- Consider regulatory compliance (traceability for legal requests)
3. Design an E-commerce Product Catalog & Recommendation System
Problem Statement: Design a scalable product catalog that supports search, filtering, and personalized recommendations for an e-commerce platform. Handle 1 million products, 10 million daily active users, and 500,000 concurrent searches during peak sales.
Functional Requirements:
- Product listing (name, description, price, images, variants)
- Search by keyword (fuzzy matching, typo tolerance)
- Filtering (category, brand, price range, color, size)
- Sorting (price, relevance, popularity, new arrivals)
- Personalized recommendations (based on user history, similar users)
- Real-time inventory updates (stock availability)
- Admin interface for product management
Non-Functional Requirements:
- Performance: Search results in <200ms, recommendations in <500ms
- Scalability: Handle 500K concurrent searches (during sales), 1M products
- Availability: 99.95% (catalog must be available during sales)
- Freshness: New products visible within 5 minutes, price changes within 1 minute
- Cost: Fit within ₹10 Lakhs/month for a mid-sized Indian e-commerce company
High-Level Design:
1. Architecture Overview:
Three main components:
- Product Catalog Service (Read-heavy): Handles searches, filters, product details
- Recommendation Service (Compute-intensive): Generates personalized recommendations
- Inventory Service (Write-heavy): Manages stock levels, updates (highly transactional)
- Search Index Service (Specialized): Optimized for full-text search
2. Product Data Model:
{
"product_id": "PROD_12345",
"name": "Wireless Headphones",
"description": "Noise-cancelling Bluetooth headphones with 20hr battery",
"category": ["Electronics", "Audio", "Headphones"],
"brand": "Sony",
"price": 4999.00,
"currency": "INR",
"images": ["img1.jpg", "img2.jpg"],
"variants": [
{"color": "Black", "size": "One Size", "sku": "PROD_12345_BK", "stock": 150},
{"color": "Blue", "size": "One Size", "sku": "PROD_12345_BL", "stock": 80}
],
"attributes": {
"battery_life": "20 hours",
"bluetooth_version": "5.0",
"weight": "250g"
},
"metadata": {
"created_at": "2024-10-01T12:00:00Z",
"updated_at": "2024-10-01T12:00:00Z",
"is_active": true,
"popularity_score": 850,
"rating": 4.5,
"review_count": 1250
}
}
3. Database Strategy (Hybrid Approach):
Product Master Store (Canonical Source):
- Choose: PostgreSQL (relational) or MongoDB (document)
- Why PostgreSQL: Strong consistency for product metadata, ACID transactions for admin updates, excellent for relational queries
- Why MongoDB: Flexible schema for product variants, horizontal scaling for large catalogs
- Indian Context Recommendation: PostgreSQL (team familiarity, good ecosystem, runs well on AWS RDS Mumbai)
Search Index (For Fast Retrieval):
- Choose: Elasticsearch (dedicated search engine)
- Why: Full-text search with typo tolerance (Levenshtein distance), faceted filtering, relevance scoring, high performance
- Alternative (Cost-effective): Meilisearch or Typesense (self-hosted, cheaper than managed Elasticsearch)
- Implementation: Sync PostgreSQL → Elasticsearch in real-time using Debezium (change data capture)
Inventory Store (High Transaction Volume):
- Choose: PostgreSQL with strong consistency (for ACID requirements)
- Why: Inventory updates must be atomic (prevent overselling). Can’t use NoSQL with eventual consistency
- Optimization: Use Redis for inventory caching (read-heavy), with PostgreSQL as source of truth
- Indian Context: During Big Billion Days, inventory updates spike 50x. Need connection pooling and proper indexing.
4. Search Architecture (The Core):
Search is the most critical and complex component. Here’s how to design it:
Search Request Flow:
- API Gateway: Receives search request (e.g., “wireless headphones under 5000”)
- Query Parser: Extracts search terms, filters, sort preferences
- Search Service: Queries Elasticsearch cluster
- Ranking Engine: Scores results using multiple signals:
- Text relevance (BM25 algorithm – Elasticsearch default)
- Popularity (sales, views, clicks)
- Personalization (user’s past purchases, brand preferences)
- Commercial factors (margin, stock availability)
- Result Formatter: Enriches search results with real-time inventory and pricing
- Response: Returns paginated results with facets
Indexing Strategy:
- Sharding: Shard by product category (Electronics, Fashion, etc.) or geography (for regional catalogs)
- Replication: 2-3 replicas per shard for high availability
- Optimization: Use Elasticsearch’s “index templates” for different product types
Search Features for Indian Users:
- Hindi Search Support: Use Elasticsearch’s ICU analysis plugin for Hindi tokenization
- Vernacular Product Names: Store product names in Hindi, Tamil, etc. as separate fields
- Price Range Filters: 0-500, 501-1000, 1001-2000 (₹) – common price bands in India
- Emotional Query Handling: “gift for mother,” “festive wear” – map to categories using ML
- Typo Tolerance: Indian users often misspell (e.g., “samsung” vs “samsang”)
5. Recommendation System (Personalization):
Recommendations are crucial for increasing average order value (AOV) in Indian e-commerce (typically 2-3x increase).
Approaches (Choose based on scale):
A. Content-Based Filtering (Simple, Good for Startups):
- Recommends items similar to what user viewed/bought (based on category, brand, price)
- Implementation: Use Elasticsearch’s “More Like This” query or collaborative filtering in Python (scikit-learn)
- Pros: No user data needed, works for new items
- Cons: Less personalized, doesn’t discover new interests
B. Collaborative Filtering (Intermediate, Popular):
- Recommends based on what similar users liked (“Users who bought X also bought Y”)
- Implementation: Matrix factorization (SVD, ALS) using Apache Spark MLlib or PyTorch
- Pros: Highly personalized, discovers cross-category recommendations
- Cons: Needs user history (cold start problem), computationally expensive
C. Hybrid Approach (Recommended for Indian Scale):
- For new users (cold start): Content-based + Popular items (trending in your region)
- For logged-in users: Collaborative filtering + Content-based (weighted average)
- For real-time (online): Use Apache Flink/Kafka Streams for “session-based” recommendations (what user is viewing now)
Indian Context Personalization:
- Regional Recommendations: Users in South India might prefer silk sarees; North India prefers lehengas. Use location + purchase history
- Festival-Based: During Diwali, recommend home decor, sweets, gifts. During Eid, recommend special clothing. Use calendar triggers
- Price Sensitivity: Indian users are price-conscious. Recommend “value for money” items (high ratings, medium price) over premium
- Mobile-First: 85% of Indian e-commerce is mobile. Recommendations should be small (1-2 items) to fit on mobile screens
- Voice Search Integration: “Alexa, suggest budget laptops under ₹30,000” – map voice query to product attributes
Implementation Architecture (Scalable & Cost-Effective):
- Offline Training (Batch): Use Apache Spark on AWS EMR (spot instances) to train collaborative filtering models every night. Cost: ₹20K/month
- Real-time Scoring (Online): Use lightweight models (TensorFlow Lite) or pre-computed user vectors stored in Redis
- Feature Store: Use Feast or Hopsworks to manage features (user history, product attributes)
- A/B Testing: Use Statsig or custom framework to test recommendation algorithms (measure click-through rate, conversion)
- Cost Optimization: Start with content-based (free), move to collaborative when user base >1M. Use AWS SageMaker only for inference, not training (cost 5x higher)
6. Inventory Management (Real-time Updates):
Inventory is the most critical for e-commerce (can’t sell what you don’t have).
Architecture:
- Write Path (Order Placement):
- Order service requests inventory check
- Inventory service does atomic decrement:
UPDATE inventory SET stock = stock - qty WHERE sku = ? AND stock >= qty - Success → reserve inventory, create order. Fail → suggest alternative products
- Read Path (Display Product Page):
- Product service checks Redis cache for stock
- If cache miss, query PostgreSQL (source of truth)
- Cache with 30-second TTL (balances freshness vs load)
Indian E-commerce Challenges & Solutions:
- Overselling During Sales: Use “bucketing” – reserve inventory in chunks (e.g., 1000 units in bucket A, 1000 in bucket B) to distribute load
- Vendor Management: For marketplaces like Flipkart, each seller has separate inventory. Use seller_id + product_id as composite key
- Multi-warehouse: Inventory in Mumbai, Bangalore, Delhi warehouses. Show “Delivered in 2 days” based on proximity
- Cancel/Return Processing: When order is cancelled, restock inventory. Use async queue to handle returns smoothly
- Flash Sales (Big Billion Days): Implement “sale mode” – cache inventory heavily, use queue for order processing, show “waiting” instead of “out of stock”
7. Cost Optimization (Critical for Indian Startups):
| Component | Recommended Technology | Monthly Cost (1M products, 10M DAU) | Optimization Strategy |
|---|---|---|---|
| Product DB (PostgreSQL) | AWS RDS db.r5.4xlarge + Read replicas | ₹60,000 | Use GP3 storage, 3-year RI |
| Search Index (Elasticsearch) | Self-hosted on EC2 (3x c5.2xlarge) | ₹45,000 | Self-host vs managed (save 40%) |
| Inventory Cache (Redis) | Redis cluster (3 nodes) | ₹30,000 | Use ElastiCache or self-host |
| Recommendations (ML) | AWS EMR (spot) + SageMaker inference | ₹35,000 | Batch training nightly, spot instances |
| CDN (Product Images) | CloudFront + S3 | ₹25,000 | Compress images (WebP), lazy load |
| Load Balancers | AWS ALB | ₹15,000 | Share across services |
| Total | ₹2,10,000 |
Per Product Cost: ₹0.21 per product per month (₹0.007 per product per day). For 10M DAU, daily revenue should be >₹50 Lakhs to be profitable (assuming 5% conversion, ₹1000 AOV).
8. Scaling for Peak Traffic (Big Billion Days):
Indian e-commerce sees 10-20x traffic during sales. Design must handle this:
Pre-Sale Preparation:
- Pre-warm Caches: Load top 100K products into Redis 24 hours before
- Index Optimization: Reindex Elasticsearch, remove old data
- Database Scaling: Upgrade RDS instance size 1 week before (can downgrade after)
- Load Testing: Simulate 500K concurrent users using tools like k6 or JMeter
- Inventory Freezing: For high-demand products, freeze inventory 1 hour before sale to avoid race conditions
During Sale (Active Management):
- Auto-scaling: Set aggressive scaling policies (scale out at 60% CPU, not 80%)
- Circuit Breakers: If Elasticsearch slow, fallback to simpler search (no personalization)
- Queue-Based Checkout: If orders spike, move to queue (users see “order placed, confirmation in 5 mins”)
- Monitoring Dashboard: Real-time alerts for search latency, inventory mismatches, order failures
Post-Sale Analysis:
- Analyze which products sold fastest (adjust inventory for next sale)
- Identify search queries with zero results (add products for those queries)
- Check recommendation click-through rates (improve ML models)
9. Indian Regulatory Considerations:
- Consumer Protection Act: Must display accurate product info (price, shipping, returns). Fines for incorrect inventory display
- Data Localization: Store Indian user data in Indian data centers (AWS Mumbai region is compliant)
- Fake Reviews: Need mechanisms to detect and remove fake reviews (mandatory as per 2023 guidelines)
- E-commerce FDI Rules: If marketplace (like Amazon), can’t influence pricing. Must show “marketplace” vs “seller” clearly
- GST Compliance: Product prices must include GST or show tax separately. APIs must support tax calculation
10. Common Interview Follow-ups:
- How to handle search when Elasticsearch is down?
- Fallback to PostgreSQL full-text search (slower but works)
- Show static “Popular Products” if completely down
- Circuit breaker pattern to detect failures and fallback
- How to prevent selling out-of-stock items during flash sales?
- Use Redis locks (SETNX) with TTL to prevent race conditions
- Batch inventory checks (process 100 orders at a time)
- Implement “soft reserve” – hold inventory for 10 mins in cart
- How to personalize recommendations for new users (cold start)?
- Use geographic location (show popular in your city)
- Demographic data (age, gender from profile)
- Device type (Android users see budget products, iOS see premium)
- Ask explicit preferences during onboarding (3-4 quick questions)
- How to handle 1M products with 100GB images?
- Store in S3 (₹0.023/GB/month in Mumbai = ₹2,300/month)
- Use CloudFront for CDN (costs ~₹0.8/GB for first 10TB)
- Compress images (WebP reduces size by 30%, AVIF by 50%)
- Lazy load images (load only when user scrolls to them)
- How to ensure search relevance (top results are relevant)?
- Boost popular products (sales count) in ranking
- Penalize products with low ratings (<3 stars)
- Personalize based on user’s past purchases
- A/B test different ranking algorithms (use click-through rate as metric)
- How to handle regional product availability?
- Store delivery restrictions in product metadata (e.g., “deliverable in 50 cities”)
- During search, filter out unavailable products based on user’s PIN code
- Use Lambda@Edge (CloudFront) to do geo-based filtering at edge
11. Design Considerations for Specific Indian Scenarios:
- Vernacular Commerce: Build separate index for Hindi/Tamil product names. Use translation APIs (AWS Translate) to generate synonyms
- Price Comparison: Indian users compare prices aggressively. Store MRP, selling price, discount % separately. Allow sorting by discount
- COD (Cash on Delivery): 60% of Indian e-commerce is COD. Add “COD available” filter. Design for higher return rates (10-15% vs 2-3% in West)
- Mobile-First Design: 85% mobile traffic. Show 2 products per row on search results, use swipe gestures for filters
- Slow Internet Optimization: For 2G/3G users, compress JSON responses (Gzip), use HTTP/2, avoid heavy ML recommendations
- Festive Calendar Integration: Auto-generate collections for Diwali, Holi, Eid, Christmas. Use calendar APIs to trigger recommendation changes
12. Metrics to Track (Indian E-commerce KPIs):
- Search Success Rate: % of searches resulting in click (target: >15% in India)
- Zero Results Rate: % of searches with no results (target: <5%). High in India due to vernacular search
- Recommendation CTR: Click-through rate on recommended items (target: >10%)
- Inventory Accuracy: % of orders cancelled due to out-of-stock (target: <1%)
- Search Latency P99: 99th percentile search time (target: <500ms)
- AOV Lift from Recs: Average order value increase (target: 20-30% in India)
Key Takeaways for E-commerce System Design:
- Hybrid Database: PostgreSQL for master data, Elasticsearch for search, Redis for caching/inventory
- Start Simple: Content-based recommendations first, add ML when user base grows
- Optimize for Mobile: 85% of Indian traffic is mobile – design UI and APIs accordingly
- Handle Peak Traffic: Design for 10x normal traffic during sales
- Cost Focus: Indian market is price-sensitive. Optimize infrastructure costs aggressively
- Regulatory Compliance: Consumer protection, data localization, GST are non-negotiable
5. Additional Popular Questions (Quick Reference)
Here are other frequently asked questions with brief approaches. Use these for practice and expand with detailed design during interviews.
4. Design a Video Streaming Platform (Like Hotstar/YouTube)
Key Challenges: Large file sizes, real-time streaming, bandwidth optimization, content protection
Architecture:
- Upload Service: Receives videos, queues for processing
- Transcoding Service: Converts video to multiple formats/resolutions (HLS/DASH). Use AWS MediaConvert or FFmpeg on EC2
- Storage: S3 for original, plus multiple resolutions. Lifecycle policy to move old videos to Glacier
- Streaming: CloudFront for CDN. Adaptive bitrate streaming (serve different quality based on user’s network)
- Recommendations: Based on watch history, similar users. Use ML for “next video”
Indian Context:
- Bandwidth Optimization: Compress heavily (H.265 codec). 30% of users on 2G/3G – offer “data saver mode”
- Regional Content: Store subtitles in Hindi, Tamil, Bengali, etc. Separate CDN for regional content
- Offline Viewing: Allow download for offline (popular for commuters). Store on device, encrypt with DRM
- Peak Traffic: IPL matches generate 10M concurrent users. Need 100x scale. Use multi-CDN (CloudFront + Akamai)
- Content Delivery: Use edge locations in Mumbai, Bangalore, Delhi for low latency
Cost Optimization:
- Transcoding Cost: Use spot instances for batch transcoding (save 70%)
- Storage: Use S3 Intelligent-Tiering. Delete old content after 1 year
- CDN: Negotiate volume discounts with providers. Use multi-CDN to compare prices
Storage Calculation (10K videos, 1hr avg):
- Original: 1GB/hour * 10K = 10TB
- Multiple resolutions: 3x (480p, 720p, 1080p) = 30TB
- Monthly cost (S3 + Glacier): ₹2,50,000 (can be reduced to ₹1,50,000 with aggressive compression)
5. Design a Ride-Sharing Service (Like Ola/Uber)
Key Challenges: Real-time GPS, matching drivers-riders, handling 100K concurrent rides, dynamic pricing
Architecture:
- Location Service: Receives GPS updates every 5-10s from driver’s app. Use WebSocket for real-time
- Matching Engine: Core logic – finds nearest available driver. Uses geospatial indexing (PostGIS or Redis GEO)
- Pricing Service: Calculates fare based on distance, time, demand (surge pricing)
- Payment Service: Integrates with UPI, cards, wallets. Handle refunds for failed rides
- Notifications: Push notifications to drivers (new ride request) and riders (driver arriving)
Indian Context:
- GPS Accuracy: Indian cities have poor GPS signal in high-rises. Use cell tower triangulation as backup
- Traffic Data: Integrate with Google Maps or MapMyIndia API. Real-time traffic is critical (Bangalore traffic changes every 5 mins)
- Dynamic Pricing: During festivals, rain, or peak hours. Cap surge at 2x (regulatory requirement in some Indian states)
- Offline Areas: For drivers in low-connectivity areas, queue rides locally and sync when online
- Cash Handling: 40% rides are cash. Handle cash collection, driver settlement, daily deposits
Scalability:
- Location Updates: 100K drivers * 1 update/10s = 10K updates/sec. Use Kafka to queue updates
- Matching Engine: Pre-index drivers in Redis GEO. Search within 5km radius. For 100K drivers, response time <100ms
- Geospatial Sharding: Divide city into zones (1km x 1km). Each zone handled by separate server
Cost:
- GPS Data Processing: High volume, use Kafka + Spark Streaming. ₹50K/month
- Real-time Matching: Redis cluster + EC2 instances. ₹80K/month
- Notifications: FCM/APNS is free. Only need notification servers. ₹20K/month
- Total for 10K concurrent rides: ~₹2,00,000/month
6. Design a Social Network (Like Facebook/Instagram)
Key Challenges: Graph relationships, news feed generation, privacy controls, high engagement
Architecture:
- User Service: Profile management, friend requests, privacy settings
- Content Service: Posts, images, videos, stories (24hr expiry)
- Feed Service: Generates personalized news feed. Most complex component
- Graph Service: Manages relationships (friends, followers, groups). Use graph database (Neo4j) or optimized relational
- Notification Service: Likes, comments, tags
News Feed Generation (The Hard Part):
- Push Model (Fan-out on Write): When user posts, add to all followers’ feeds. Good for celebrities (few posts, many followers)
- Pull Model (Fan-out on Read): When user opens app, generate feed from scratch. Good for normal users (few followers)
- Hybrid (Recommended): Push for celebrities, pull for normal users
- Algorithm: Score posts based on: relevance (who you interact with), recency, popularity (likes), content type (video > photo > text)
Indian Context:
- Privacy Settings: Strong privacy controls (India has data protection laws). Default settings should be conservative
- Vernacular Content: 60% of posts in Indian languages. Need multilingual content moderation
- Low-End Devices: Optimize app size (<50MB) and memory usage for Android Go devices
- Offline Support: Allow viewing feed offline (cache), posting offline (queue)
- Content Moderation: Handle hate speech, misinformation. Use AI + human review (Indian languages complex)
Scale (10M users):
- Storage: 1B posts, 50B images = ~100TB. Cost: ₹2,50,000/month (S3 + Glacier)
- Feed Generation: 1M active users/day * 20 posts = 20M posts generated/day. Compute-intensive, use batch processing
- Graph Queries: Friend-of-friend queries expensive. Cache popular graph structures
7. Design a Payment Gateway (Like Razorpay/Paytm Gateway)
Key Challenges: Security, compliance, high availability, integration with multiple banks
Architecture:
- API Gateway: Entry point for merchants, validate API keys, rate limiting
- Payment Processing Service: Routes to appropriate payment method (UPI, cards, net banking, wallets)
- Bank Integration Layer: Connects to NPCI (UPI), banks via APIs. Handle retries, timeouts
- Settlement Service: Manages daily settlement with merchants (T+1 for UPI)
- Compliance & Audit: PCI DSS, RBI compliance, audit logs for every transaction
- Fraud Detection: ML-based fraud screening (velocity checks, IP analysis, device fingerprinting)
Indian Context:
- UPI Integration: Must comply with NPCI rules (rate limits, settlement windows). Use UPI Lite for <₹200
- PCI DSS Compliance: Card data must be tokenized. Don’t store PAN numbers
- RBI Compliance: Data localization (Indian user data in India), 2FA mandate for >₹5000
- High Availability: Payment failures cost revenue. Target 99.99% uptime during business hours
- Settlement: UPI is instant, cards are T+1 (next day). Handle multiple settlement cycles
Security (Critical):
- Encryption: TLS 1.3 for all communication, field-level encryption for sensitive data
- Tokenization: Replace card numbers with tokens (use PayU, CCAvenue, or custom tokenization)
- WAF: Web Application Firewall to block SQL injection, XSS
- DDoS Protection: Cloudflare or AWS Shield (crucial during flash sales)
Cost:
- Infrastructure: ₹5,00,000/month for 1M transactions/day
- Bank/Payment Processor Fees: 0.5-2% of transaction value (not infrastructure)
- Compliance: Annual PCI DSS audit (₹20-50 Lakhs for mid-sized gateway)
6. Resources for Further Learning
Mastering system design requires continuous learning. Here’s a curated list of resources tailored for Indian engineers.
Books (Free & Paid)
Essential Books (Free/PDF Available):
- “System Design Interview – An Insider’s Guide” by Alex Xu: The bible of system design. Start here. Buy the physical copy (₹800 on Amazon) to support the author, but PDF is available online
- “Designing Data-Intensive Applications” by Martin Kleppmann: Deep dive into databases, distributed systems. Free chapters available. Full book is expensive (~₹3500) but worth it
- “Clean Architecture” by Robert C. Martin: For fundamentals of good software design. Available in Kindle (₹400)
- Online PDFs: “DDIA PDF” search on Google (legit free chapters), “System Design Interview PDF” (Alex Xu’s book is often shared)
Indian Author Books:
- “Cracking the System Design Interview” by Tushar Dey: Focuses on Indian startup scenarios and typical interview questions. Available on Amazon (₹300)
- “System Design in Hindi” by Neeraj Sharma: YouTube channel + eBook (free). Great for Hindi speakers
Online Courses & Platforms
Free Resources:
- Gaurav Sen YouTube Channel: Best free system design content. Covers real-world Indian scenarios (Ola, Zomato). 100% free
- System Design by Tushar Roy: Detailed whiteboard explanations. Covers common interview questions
- ByteByteGo Newsletter: Weekly case studies. Free subscription. Alex Xu’s companion to his books
- GitHub Repositories:
- “System Design Primer” (github.com/donnemartin/system-design-primer) – Comprehensive, free, open-source
- “Awesome System Design” – Curated list of resources
Paid Courses (Worth the Investment):
- DesignGurus.io (₹8,000/year): Alex Xu’s courses. Most comprehensive paid option. Indian pricing available
- AlgoExpert System Design (₹4,000/year): Video explanations with code. Good for beginners
- Udemy Courses (₹500-1000 during sales): Look for “System Design Interview” by Tarek Ajrouch or Ravi Singh
- Scaler Academy (₹2-3 Lakhs): Indian platform with system design module. Expensive but includes mentorship
- Geektrust (₹10,000): Indian platform with system design practice and mock interviews
Practice Platforms
Free Practice:
- GitHub – System Design Interview Questions: github.com/checkcheckzz/system-design-interview – 50+ questions with solutions
- LeetCode System Design Questions: Discussion section has detailed solutions
- GitHub – Awesome System Design Interview: Curated list with solutions
- Pramp (Free tier): Peer mock interviews. Find partners practicing system design
Paid Practice (Affordable):
- Interviewing.io (₹1,500/month): Mock interviews with engineers from Amazon, Google. Can practice system design
- DesignGurus Practice (₹3,000/year): 100+ system design problems with hints and solutions
- Pramp Pro (₹2,000/month): Guaranteed matches with experienced interviewers
Indian-Specific Practice:
- HackerRank Challenges: Indian platform with system design challenges based on real Indian startup problems
- Geektrust Projects: Build end-to-end systems (e-commerce, chat, etc.) and get evaluated
- LeetCode India Contests: Participate in weekly contests, discuss system design problems in discussion forum
Tools & Software for Practice
Whiteboarding Tools (Free):
- Excalidraw: Free, open-source whiteboard. Best for practicing diagrams
- Draw.io (diagrams.net): Free, browser-based. Great for architecture diagrams
- Miro Free Plan: Collaborative whiteboard. Good for peer practice
Diagram Tools (Free/Trial):
- Lucidchart (Free tier): Professional diagrams. Indian pricing is affordable
- PlantUML: Code-based diagrams (text to diagram). Great for version control
- Mermaid Live Editor: Free, browser-based. Simple sequence diagrams
Architecture Simulation:
- Apache JMeter: Free load testing. Simulate traffic spikes
- k6 (Free tier): Modern load testing. Scripts in JavaScript
- AWS Free Tier: Build actual prototypes on AWS. ₹8,500 credit for first 12 months
Blogs & Communities
Technical Blogs:
- High Scalability (highscalability.com): Case studies of real-world systems
- Netflix Tech Blog: For advanced distributed systems
- Uber Engineering Blog: Great for ride-sharing patterns
- Indian Tech Blogs:
- Flipkart Engineering Blog
- Paytm Labs Blog
- Zomato Tech Blog
Communities (Free):
- Reddit – r/systemdesign: Active discussions, ask questions, get feedback
- LeetCode India Community (Slack/Discord): Peer discussions, mock interviews
- Grokking System Design (Telegram): Active Indian community for practice
- Stack Overflow – System Design Tag: Ask specific architecture questions
- LinkedIn Groups: “System Design Interview Preparation” (India-specific groups available)
Mock Interview Resources
Free Mock Interviews:
- Peer Practice: Find partners on LeetCode discuss, Reddit, or local tech meetups
- Internal Company Programs: Many Indian companies have internal mentorship programs
- University Alumni Networks: Connect with seniors working at target companies
Paid Mock Interviews (Affordable):
- Interviewing.io (₹1,500/session): Mock with engineers from FAANG
- DesignGurus Mock (₹2,000/session): Specialized system design mocks
- Pramp (₹800/session): Peer mocks with verified experienced engineers
- Geektrust Mock (₹1,200/session): India-specific interviewers from top startups
YouTube Channels for Mock Interviews:
- Gaurav Sen: Live mock interviews with candidates
- System Design Interview: Whiteboard sessions with solutions
- Exponent (System Design Playlist): Detailed mock interviews
Cost-Effective Learning Path for Indian Engineers
Month 1: Foundation (₹0 – ₹2,000)
- Week 1-2: Watch Gaurav Sen’s free videos (YouTube) – ₹0
- Week 3-4: Read “System Design Interview – An Insider’s Guide” (PDF) – ₹0
- Practice: Use GitHub repository for 5 common questions – ₹0
- Total: ₹0
Month 2: Structured Learning (₹1,000 – ₹3,000)
- Buy Udemy course during sale (₹500) – ₹500
- Practice on LeetCode discussion section – ₹0
- Use Draw.io for diagrams – ₹0
- Total: ₹500
Month 3: Advanced & Mocks (₹2,000 – ₹5,000)
- DesignGurus practice platform (₹3,000/year) – ₹3,000
- 2 mock interviews on Interviewing.io (₹3,000) – ₹3,000
- Total: ₹6,000
Total Investment: ₹6,500 (less than a month’s salary for most 2+ years experienced engineers). ROI: High (can help land jobs paying ₹20-50 Lakhs/year)
Industry-Specific Resources (Indian Market)
- RBI Tech Upgradation Plan: Understanding banking systems is crucial for fintech interviews. Read RBI’s technical guidelines
- NPCI UPI Documentation: For payment system design. Free PDF available on NPCI website
- IRCTC Architecture: Read case studies on train ticket booking system (classic system design problem)
- Indian E-commerce Regulations: Consumer Protection Act 2019 – affects product catalog design
- Make in India Initiative: Understand implications for hardware + software systems (IoT, manufacturing)
Upcoming Trends (2024-25):
- AI/ML Integration: Every system needs AI (recommendations, fraud detection, chatbots). Learn basics of ML system design
- Edge Computing: For low latency. Important for AR/VR, gaming startups in India
- 5G Networks: Will enable new use cases (real-time AR, IoT). Design for high bandwidth, low latency
- Digital Public Infrastructure (DPI): India Stack (Aadhaar, UPI, Account Aggregators) – Understand API integrations
- Green Computing: Indian startups face ESG pressures. Design for energy efficiency (e.g., server timing to use renewable energy)
Common Mistakes to Avoid (Based on Indian Interviewer Feedback)
- Ignoring Cost: Indian startups are cost-sensitive. Always discuss infrastructure costs
- Over-engineering: Don’t recommend microservices + Kubernetes for 10K users
- Forgetting Indian Context: Not considering mobile-first, low bandwidth, regional languages
- Poor Communication: Not explaining thought process clearly. Practice English if needed (many Indian engineers struggle here)
- Not Practicing Enough: Reading theory ≠ doing mocks. Practice explaining out loud 50+ times
- Ignoring Compliance: Don’t forget data localization, privacy laws for Indian users
Success Metrics & Timeline
For Software Engineers (2-3 years experience):
- Week 1-4: Foundation building (free resources, 2 hours/day)
- Week 5-8: Structured practice (solve 5 questions/week with detailed diagrams)
- Week 9-12: Mock interviews (2 mocks/week, focus on feedback)
- Week 13-16: Target company preparation (company-specific questions)
Expected Outcomes:
- Clear understanding of 10+ common patterns
- Ability to design any system within 45 minutes
- Confidence to explain trade-offs clearly
- Success rate: 70-80% in system design rounds (vs 30-40% for unprepared candidates)
Time Investment:
- Light: 5 hours/week (3 months to proficiency)
- Medium: 10 hours/week (6 weeks to proficiency)
- Intensive: 20 hours/week (4 weeks to proficiency)
For most working professionals in India with 2-3 years experience, 10 hours/week for 6 weeks is the sweet spot. Weekend batches are popular (Saturday-Sunday 5 hours each).
Final Advice:
- Start small: Don’t try to learn everything at once. Master 5 patterns first
- Practice consistently: 30 minutes daily > 5 hours once a week
- Find a study group: 3-4 peers practicing together helps motivation
- Track progress: Keep a log of questions solved, mistakes made
- Seek feedback: Every mock interview must have specific feedback
- Stay updated: Follow tech blogs, but don’t get overwhelmed
- Believe in yourself: Many Indian engineers from non-FAANG backgrounds have successfully cracked these interviews
Conclusion & Call to Action
System design interviews are challenging but conquerable with the right approach. As an Indian software engineer with 2+ years of experience, you have the technical foundation—now you need to build the architectural thinking and communication skills that these interviews demand.
Remember, the goal isn’t to design a perfect system but to demonstrate your thought process, trade-off analysis, and ability to create scalable solutions. Indian companies value engineers who understand cost optimization, mobile-first design, and regulatory compliance—use this to your advantage.
Key Takeaways from This Guide:
- Master the basics: Understand components, patterns, and scalability before jumping to complex designs
- Practice with purpose: Focus on common questions (URL shortener, chat, e-commerce) that appear frequently
- Think Indian context: Consider cost, mobile users, low bandwidth, regional languages, and regulatory compliance
- Communicate clearly: Explain your reasoning, discuss trade-offs, ask clarifying questions
- Start with free resources: Don’t invest in expensive courses until you’ve practiced with free materials
The system design round is often the deciding factor in senior engineering interviews. Companies like Flipkart, Amazon India, Microsoft, and even high-growth startups (Razorpay, Cred, Unacademy) heavily weigh this round. A strong performance can add ₹5-10 Lakhs to your offer, making preparation ROI very high.
Ready to Ace Your System Design Interview?
Don’t leave your preparation to chance. Practice with AI-powered mock interviews tailored for Indian tech companies.
Try JobUAI Today – Your Trusted Partner for Interview Success!
Start Practicing Now (Free Trial Available)
Join 10,000+ Indian engineers who have successfully cracked their dream jobs.
Final Thoughts:
The journey from a 2-year engineer to a senior engineer capable of designing complex systems is exciting. System design isn’t just an interview topic—it’s a skill that will define your career trajectory. The principles you learn here (scalability, reliability, cost optimization) will be valuable for years to come.
Start today. Choose one question from Section 4. Grab a whiteboard (or paper). Spend 45 minutes designing it. Explain your design out loud, as if you’re in an interview. Record yourself. Listen back. Identify gaps. Repeat.
In 30 days, you’ll be unrecognizable in your ability to tackle system design problems. In 60 days, you’ll be confident walking into any interview. In 90 days, you’ll be designing production systems that millions of users rely on.
The Indian tech ecosystem is booming. The demand for skilled engineers who can design scalable systems is at an all-time high. Your preparation today is an investment in your future. Make it count.
Good luck, and happy designing!
- This Week: Watch 3 Gaurav Sen videos, read Chapter 1 of Alex Xu’s book
- Next Week: Solve URL Shortener and Chat System design questions
- Week 3-4: Practice with peers, get feedback on your designs
- Week 5-6: Mock interviews (2-3 sessions), refine your approach
- Day of Interview: Stay calm, think out loud, focus on trade-offs
Remember: Every expert was once a beginner. Your 2+ years of coding experience is the foundation—build your architectural thinking on top of it. You’ve got this!



