Common Patterns
Just like with DSA problems, system design is just about learning patterns. Once you can identify a recurring challenge and know which patterns to apply to the given challenge, you become unstoppable in system design interviews.
7 system design patterns you should know 💡
🔄 𝗣𝘂𝘀𝗵𝗶𝗻𝗴 𝗥𝗲𝗮𝗹𝘁𝗶𝗺𝗲 𝗨𝗽𝗱𝗮𝘁𝗲𝘀
- Your chat app needs instant message delivery to millions of users. You should start with HTTP polling, then upgrade to websockets at scale. Pub/Sub services decouple publishers from subscribers for heavy processing loads.
⏳ 𝗠𝗮𝗻𝗮𝗴𝗶𝗻𝗴 𝗟𝗼𝗻𝗴-𝗥𝘂𝗻𝗻𝗶𝗻𝗴 𝗧𝗮𝘀𝗸𝘀
- When a user uploads a 4K video expecting instant feedback, you should return "Upload successful!" immediately, then queue encoding and CDN distribution. Workers process jobs independently while users stay engaged.
🔄 𝗠𝘂𝗹𝘁𝗶-𝘀𝘁𝗲𝗽 𝗣𝗿𝗼𝗰𝗲𝘀𝘀𝗲𝘀
- When a user places an order requiring payment, inventory check, shipping, and email confirmation, any step can fail, requiring compensation like refunds or inventory release. You should use workflow systems like Temporal or AWS Step Functions to orchestrate steps with automatic retries and state persistence across failures.
🔒 𝗗𝗲𝗮𝗹𝗶𝗻𝗴 𝘄𝗶𝘁𝗵 𝗖𝗼𝗻𝘁𝗲𝗻𝘁𝗶𝗼𝗻
- When two users try booking the last concert ticket simultaneously, you need database locks, optimistic concurrency, or distributed coordination to prevent race conditions. You should start with single-database solutions before adding distributed complexity.
📖 𝗦𝗰𝗮𝗹𝗶𝗻𝗴 𝗥𝗲𝗮𝗱𝘀
- Instagram users scroll through hundreds of photos but post once daily, so read traffic grows 10x-100x faster than writes. You should progress from database indexing to read replicas to caching layers like Redis and CDNs.
✍️ 𝗦𝗰𝗮𝗹𝗶𝗻𝗴 𝗪𝗿𝗶𝘁𝗲𝘀
- When your payment system processes millions of transactions per second, horizontal sharding distributes load across servers while batching reduces overhead. You should choose partition keys that distribute evenly.
📁 𝗛𝗮𝗻𝗱𝗹𝗶𝗻𝗴 𝗟𝗮𝗿𝗴𝗲 𝗕𝗹𝗼𝗯𝘀
- When users upload gigabyte video files that would crush your servers, you should generate presigned URLs for direct client-to-storage uploads and serve through CDNs. Keep servers out of the data path.
These patterns often work together. A video platform uses Large Blobs (uploads), Long-Running Tasks (transcoding), and Realtime Updates (progress notifications).