The System Design is complex and one design doesnt fits all. Below are useful pointers to get unstuck in an interview -

  1. For a Read-Heavy System - Consider using a Cache.
  2. For a Write-Heavy System - Use Message Queues for async processing
  3. For alow_latency Requirement - Consider using a Cache and CDN. Why? latency is delay in network communication, having CDN will load content from nearestgeographic_location and this reduce load time.
  4. Need ACID 𝐀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, Trie 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 - Implementhorizontal_scalability .
  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 (Domain Name System).
  29. Handling Large Data in Network Requests - Implement Pagination.
  30. Cache Eviction Policy - Preferred is LRU cache .
  31. To handle traffic spikes: Implement auto scaling to manage resources dynamically.
  32. Need analytics and audit trails: Consider using Datalake orappend_only_databases
  33. Handling large scale simultaneous connections: Useconnection_pooling and try using protobuff to minimise payload.

Heuristic by Ashish Pratap

  1. 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 write-through cache for write-heavy applications.
  23. Use 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 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.