Ques 1: What is the CAP theorem, and how does it impact distributed systems? π€
Answer: The CAP theorem states that a distributed system cannot simultaneously guarantee Consistency, Availability, and Partition Tolerance. It can provide at most two out of the three guarantees. Consistency ensures that all nodes see the same data, Availability ensures that every request receives a response, and Partition Tolerance allows the system to operate despite network partitions. Different databases prioritise different aspects of the CAP theorem based on their design and use cases

CAP
Ques 2: Explain the difference between horizontal scaling and vertical scaling. π
Answer:
Horizontal Scaling:
- It means increasing the number of nodes/servers that run the application. More instances are added to support higher loads.
- It provides linear scalability and is more reliable. If one node fails, the application still runs on other instances.
- It is more complex to distribute requests and manage data synchronization across nodes. Often a load balancer is used to handle distributed traffic.
Vertical Scaling:
- It means increasing the computational power of an existing node/server. For example upgrading RAM, CPU, storage etc. on a machine.
- It has hardware limitations and cannot be easily scaled as higher workloads arrive. There is maximum capacity.
- It avoids the complexity of distributing across nodes. Only one machine needs to be upgraded to powerful hardware.
- There is no redundancy. If the lone beefed up node crashes, the application goes down. Reliability takes a hit.
In summary, horizontal scaling handles variability in traffic more gracefully by distributing load across many smaller commodity machines. Vertical scaling provides simplicity of a single node but may not sustain growth and offers less reliability.
Ques 3: What is load balancing, and why is it important in system design? βοΈ
Answer: Load Balancing is the distribution of incoming traffic efficiently across a group of backend servers or server pools.
Importance:
- Prevents overloading of resources.
- Enhances fault tolerance by redirecting traffic when a server goes down.
- Ensures consistent response times and optimal resource utilization.
Ques 4: What is sharding, and how does it contribute to system scalability? π
Answer: Sharding is the process of splitting a large logical dataset into multiple databases or horizontal partitioning. It enhances scalability by distributing data across multiple machines, allowing the system to handle increased loads.

Sharding
Ques 5: Differentiate between SQL and NoSQL databases? π€
Answer:
SQL
- Follows a relationship Model
- Deals with structured data.
- Follows ACID Properties (Atomicity, Consistency, Isolation and Durability)
NoSQL
- Follows a non-relational model.
- Deals with semi-structured data.
- Follows BASE properties (Basic Availability, Soft-state, Eventual consistency)
Ques 6: What is caching, and what are various cache update strategies? πΆ
Answer: Caching refers to storing file copies in a temporary location (cache) to enhance data access speed.
Below are the cache update strategies:
Cache-aside:
- In this strategy, applications are responsible for managing the cache.
- Data is manually read from or written to the cache as needed.
- It provides flexibility but requires careful management to ensure efficiency.
Write-through:
- In this approach, data is written simultaneously to both the cache and the underlying storage.
- Ensures that the cache and the storage remain synchronized.
- It provides data consistency but may result in higher write latency.
Write-behind (write-back):
- Data is initially written to the cache, and the update to the underlying storage is deferred.
- This strategy improves write performance as it minimizes disk I/O.
- However, there is a risk of data loss in case of a system failure before the write to storage occurs.
Refresh-ahead:
- This strategy involves proactively updating or refreshing the cache with anticipated data before it is explicitly requested.
- Helps in minimizing latency by preloading data that is likely to be accessed soon.
- Requires predictive algorithms to determine which data to refresh ahead of time.
Ques 7: Explain weak consistency, eventual consistency, and strong consistency. π§
Answer:
Weak Consistency:
- Data is replicated asynchronously without any synchronization guarantees
- Copies of data on different nodes might hold different values at the same time
- Reading data might return an old/stale value that has been updated elsewhere
Eventual Consistency:
- Data is replicated asynchronously but guarantees that copies will converge to a consistent state eventually
- Reads may return a stale value to begin with, but will eventually reflect the latest update
- Popular in distributed systems - simpler to implement but risk of temporarily inconsistent reads
Strong Consistency:
- Data is replicated synchronously guaranteeing reads always return the latest/most fresh data
- Changes are atomic and transactional - performs all or nothing updates
- Provides highest accuracy but slower performance due to sync overhead
- Harder to scale and not commonly used in eventually consistent distributed systems
Ques 8: What is a Content Delivery Network, and how does it improve system performance? π
Answer: CDN is a globally distributed proxy server network serving content from locations close to end-users.
Below are the CDN benefits:
- Reduces latency by serving data from nearby locations.
- Shares the server load, improving overall performance.

CDN
Ques 9: Explain leader election in a distributed system. π»
Answer: Leader Election is the process of choosing a primary server in a distributed environment to handle updates to third-party APIs. It Detect leader failures and appoint a new leader. It is essential in high availability and strong consistency applications using a consensus algorithm.
Ques 10: What is the difference between microservice and monolithic architecture? π
Answer:
Monolithic Architecture:
- Single, tightly coupled application.
- All components and modules are interconnected.
- Scaling involves replicating the entire application.
- Easier to develop and test but may become complex and less scalable over time.
Microservices Architecture:
- Decomposes the application into small, independent services.
- Each service focuses on a specific business capability.
- Scalable and flexible, allowing independent deployment of services.
- More complex to develop and test, but offers better scalability and maintainability.
Ques 11: What is Service-Oriented Architecture (SOA)? π§
Answer: SOA is an architectural pattern where software components, known as services, communicate and interact with each other over a network.
Its key Principles include:
- Services are loosely coupled and independent.
- Services can be reused for different applications.
- Services communicate via standardized protocols.
Q12: Explain Event-Driven Architecture (EDA) π€
Answer: Event-Driven Architecture (EDA) fosters dynamic communication within a system, featuring three core components: events representing state changes, event producers generating events, and event consumers responding intelligently.
This design promotes loose coupling between components, enhancing flexibility, and scalability. EDAβs distributed nature ensures systems remain responsive and adaptable to changing workloads, making it a valuable paradigm for building robust systems.

EDA
Ques 13: What is GraphQL, and how does it differ from REST? π
Answer: GraphQL is a query language for APIs, allowing clients to request only the data they need.
The ways it differs from REST:
- Single endpoint for multiple queries.
- Clients define the structure of the response.
- Reduced over-fetching or under-fetching of data.
Ques 14: What is containerization, and how does Docker work? π§
Answer: Containerization is a lightweight, portable, and consistent way to package and run applications.
Docker provides a platform for developing, shipping, and running applications in containers, Ensures consistency across different environments and Facilitates easy deployment and scaling.
Ques 15: What is DevOps, and why is it important in system design? π²
Answer: DevOps is a set of practices that combines software development (Dev) and IT operations (Ops), aiming to shorten the system development life cycle.
It enables faster development and deployment cycles. Improves collaboration between development and operations teams and enhances system reliability and scalability.
Conclusion: π
Mastering these must-know system design concepts provides a solid foundation for tackling complex engineering challenges. Whether youβre preparing for interviews or enhancing your skills in designing scalable systems, understanding these concepts is crucial. Keep practicing and applying these principles to build robust and efficient software systems.
If I missed any important concept, please feel free to drop it in comment section and incase you have any particular query, please donβt hesitate to contact me on twitter or linkedIn. π€
Wishing you a joyful learning journey!!! π