Golden Rules/Gotchas for System Design Interview
3 min readJul 18, 2024
--
The system design is complex and one design doesn’t fits all. Below are a a bunch of useful rules to get you better off a system design interview.
- For a Read-Heavy System — Consider using a Cache.
2. For a Write-Heavy System — Use Message Queues for async processing
3. For a Low Latency Requirement — Consider using a Cache and CDN.
4. Need 𝐀tomicity, 𝐂onsistency, 𝐈solation, 𝐃urability Compliant DB — Go for RDBMS/SQL Database.
5. Have unstructured data — Go for NoSQL Database.
6. Have Complex Data (Videos, Images, Files) — Go for Blob/Object storage.
7. Complex Pre-computation — Use Message Queue & Cache.
8. High-Volume Data Search — Consider search index, tries or search engine.
9. Scaling SQL Database — Implement Database Sharding.
10. High Availability, Performance, & Throughput — Use a Load Balancer.
11. Global Data Delivery — Consider using a CDN.
12. Graph Data (data with nodes, edges, and relationships) — Utilize Graph Database.
13. Scaling Various Components — Implement Horizontal Scaling.
14. High-Performing Database Queries — Use Database Indexes.
15. Bulk Job Processing — Consider Batch Processing & Message Queues.
16. Server Load Management & Preventing DOS Attacks- Use a Rate Limiter.
17. Microservices Architecture — Use an API Gateway.
18. For Single Point of Failure — Implement Redundancy.
19. For Fault-Tolerance and Durability — Implement Data Replication.
20. For User-to-User fast communication — Use Websockets.
21. Failure Detection in Distributed Systems — Implement a Heartbeat.
22. Data Integrity — Use Checksum Algorithm.
23. Efficient Server Scaling — Implement Consistent Hashing.
24. Decentralized Data Transfer — Consider Gossip Protocol.
25. Location-Based Functionality — Use Quadtree, Geohash, etc.
26. Avoid Specific Technology Names — Use generic terms.
27. High Availability and Consistency Trade-Off — Eventual Consistency.
28. For IP resolution & Domain Name Query — Mention DNS.
29. Handling Large Data in Network Requests — Implement Pagination.
30. Cache Eviction Policy — Preferred is LRU (Least Recently Used) Cache.
31. To handle traffic spikes: Implement Autoscaling to manage resources dynamically
32. Need analytics and audit trails — Consider using data lakes or append-only databases
33. Handling Large-Scale Simultaneous Connections — Use Connection Pooling and consider using Protobuf to minimize data payload … continues
Learn these 30 System Design interview tips.
- Understand the functional and non-functional requirements before designing.
2. Clearly define the use cases and constraints of the system.
3. There is no perfect solution. It’s all about tradeoffs.
4. Assume requirements will change and design the system to be flexible.
5. Assume everything can and will fail. Make it fault-tolerant.
6. Don’t add functionality until it’s necessary. Avoid over-engineering.
7. Design your system for scalability from the ground up.
8. Prefer horizontal scaling over vertical scaling for scalability.
9. Add Load Balancers to ensure high availability and distribute traffic.
10. Consider using SQL Databases for structured data and ACID transactions.
11. Opt for NoSQL Databases when dealing with unstructured data.
12. Use Database Sharding to scale SQL databases horizontally.
13. Use Database Indexing and search engines for efficient data retrievals.
14. Use Rate Limiting to prevent system overload and DOS attacks.
15. Use WebSockets for real-time communication.
16. Employ Heartbeat Mechanisms for failure detection.
17. Consider using a message queue for asynchronous communication.
18. Implement data partitioning and sharding for large datasets.
19. Consider denormalizing databases for read-heavy workloads.
20. Consider using event-driven architecture for decoupled systems.
21. Use CDNs to reduce latency for a global user base.
22. Use a write-through cache for write-heavy applications.
23. Use a read-through cache for read-heavy applications.
24. Use blob/object storage for storing media files like files, videos, etc.
25. Implement Data Replication and Redundancy to avoid a single point of failure.
26. Implement Autoscaling to handle traffic spikes smoothly.
27. Use Asynchronous processing to run background tasks.
28. Make operations idempotent where possible to simplify retry logic and error handling.
29. When appropriate, use microservices for flexibility, scalability, and maintainability.
30. Consider using a data lake or data warehouse for analytics and reporting.
#systemdesign #interview #softwaredesign