CSI System Design & Architecture 2 — Questions and Answers
Question 1: In a distributed system, which consistency model allows reads to return stale data but guarantees that all replicas eventually converge to the same value?
- Strong consistency
- Eventual consistency (Correct answer)
- Linearizability
- Sequential consistency
Correct answer: Eventual consistency
Eventual consistency guarantees that all replicas will converge to the same value over time, but reads may temporarily return stale data.
Question 2: Which architectural pattern separates the data modification (command) path from the data retrieval (query) path into distinct models?
- Event Sourcing
- CQRS (Command Query Responsibility Segregation) (Correct answer)
- Saga Pattern
- Strangler Fig Pattern
Correct answer: CQRS (Command Query Responsibility Segregation)
CQRS segregates commands (writes) and queries (reads) into separate models, optimizing each independently.
Question 3: A system integrator needs to connect a legacy COBOL mainframe to a modern REST API. Which integration approach is most appropriate?
- Complete system replacement
- API Gateway with adapter layer (Correct answer)
- Direct database coupling
- File-based batch transfer only
Correct answer: API Gateway with adapter layer
An API Gateway with an adapter layer translates between legacy protocols and modern REST, enabling integration without full replacement.
Question 4: In microservices architecture, which pattern prevents cascading failures by stopping requests to a failing service after a threshold is exceeded?
- Retry Pattern
- Bulkhead Pattern
- Circuit Breaker Pattern (Correct answer)
- Throttling Pattern
Correct answer: Circuit Breaker Pattern
The Circuit Breaker pattern monitors failures and opens the circuit to stop requests to a failing service, preventing cascading failures.
Question 5: Which load balancing algorithm routes each new request to the server with the fewest active connections?
- Round Robin
- Least Connections (Correct answer)
- IP Hash
- Weighted Round Robin
Correct answer: Least Connections
Least Connections routing directs traffic to the server currently handling the fewest active connections, balancing load dynamically.
Question 6: What is the primary purpose of a service mesh in a microservices architecture?
- Replacing the API gateway
- Managing inter-service communication, observability, and security (Correct answer)
- Storing shared configuration data
- Providing a centralized logging database
Correct answer: Managing inter-service communication, observability, and security
A service mesh handles service-to-service communication concerns like load balancing, mTLS, retries, and observability via sidecar proxies.
Question 7: In the context of system integration, what does 'idempotency' mean for an API endpoint?
- The endpoint processes requests faster on repeated calls
- Multiple identical requests produce the same result as a single request (Correct answer)
- The endpoint caches responses for all callers
- The endpoint rejects duplicate requests with an error
Correct answer: Multiple identical requests produce the same result as a single request
An idempotent endpoint produces the same result regardless of how many times the same request is made, enabling safe retries.
In a distributed system, which consistency model allows reads to return stale data but guarantees that all replicas eventually converge to the same value?