In a three-tier web application, which component is primarily responsible for enforcing business logic and processing rules?
- A. The presentation/UI tier
- B. The application/logic tier ✓
- C. The data/storage tier
- D. The load balancer
Correct answer: B. The application (middle) tier is where business logic and processing rules are executed, separating it from presentation and data storage.
A client requires that no single server failure causes downtime for their payment API. Which architectural approach directly addresses this?
- A. Vertical scaling of a single instance
- B. Deploying redundant instances across multiple availability zones behind a load balancer ✓
- C. Adding a larger CDN cache
- D. Increasing the database connection pool size
Correct answer: B. Redundant instances across multiple availability zones behind a load balancer eliminate single points of failure, providing high availability.
Which statement best describes the difference between horizontal and vertical scaling?
- A. Horizontal scaling adds more machines; vertical scaling adds more power to an existing machine ✓
- B. Horizontal scaling adds CPU/RAM to a server; vertical scaling adds more servers
- C. Both refer to adding more storage only
- D. Horizontal scaling only applies to databases
Correct answer: A. Horizontal scaling (scale-out) adds more nodes, while vertical scaling (scale-up) increases resources on a single node.
In the CAP theorem, a distributed system experiencing a network partition must choose between which two properties?
- A. Concurrency and Availability
- B. Consistency and Availability ✓
- C. Caching and Performance
- D. Capacity and Partitioning
Correct answer: B. During a network partition, CAP dictates a system can guarantee either Consistency or Availability, but not both simultaneously.
A microservices system needs a single entry point for clients to handle routing, authentication, and rate limiting. Which pattern fits best?
- A. Sidecar pattern
- B. API Gateway pattern ✓
- C. Circuit Breaker pattern
- D. Bulkhead pattern
Correct answer: B. The API Gateway pattern provides a unified entry point that centralizes cross-cutting concerns like routing, authentication, and rate limiting.
Which mechanism prevents cascading failures by stopping calls to a service that is repeatedly failing?
- A. Retry with exponential backoff
- B. Circuit breaker ✓
- C. Connection pooling
- D. Blue-green deployment
Correct answer: B. A circuit breaker trips open after repeated failures, halting further calls to the failing service and preventing cascading failures.
For an application requiring flexible, schema-less storage of large volumes of semi-structured JSON documents, which database type is most appropriate?
- A. A relational (SQL) database
- B. A document-oriented NoSQL database ✓
- C. A graph database
- D. An in-memory key-value cache only
Correct answer: B. Document-oriented NoSQL databases (e.g., MongoDB) are designed for flexible, schema-less storage of semi-structured JSON documents.
What is the primary purpose of a message queue (e.g., RabbitMQ, Kafka) in a distributed architecture?
- A. To synchronously return results faster
- B. To decouple producers and consumers and enable asynchronous processing ✓
- C. To replace the need for a database
- D. To encrypt data in transit
Correct answer: B. Message queues decouple producers from consumers, allowing asynchronous, resilient communication and load leveling between services.
Which deployment strategy routes a small percentage of live traffic to a new version to validate it before a full rollout?
- A. Big-bang deployment
- B. Canary deployment ✓
- C. Recreate deployment
- D. Cold standby deployment
Correct answer: B. Canary deployment gradually exposes a new version to a small subset of traffic to validate it before full rollout, limiting blast radius.
When designing for data encryption, which combination correctly protects data both at rest and in transit?
- A. TLS for transit and disk/database encryption for rest ✓
- B. TLS for both transit and rest
- C. Hashing for transit and TLS for rest
- D. No encryption needed if inside a VPC
Correct answer: A. TLS secures data in transit while disk or database-level encryption (e.g., AES) protects data at rest, covering both states.