KCNA Cloud Native Patterns 2 — Questions and Answers
Question 1: Which cloud native pattern ensures that a service remains available even when one of its dependencies is experiencing failures?
- Circuit Breaker (Correct answer)
- Bulkhead
- Retry
- Timeout
Correct answer: Circuit Breaker
The Circuit Breaker pattern prevents cascading failures by stopping requests to a failing dependency and allowing it time to recover.
Question 2: In the Sidecar pattern, what is the relationship between the sidecar container and the main application container?
- They share the same Pod and network namespace (Correct answer)
- They run in separate Pods but the same namespace
- They share only storage volumes but not networking
- They communicate only through Kubernetes Services
Correct answer: They share the same Pod and network namespace
Sidecar containers in a Pod share the same network namespace and can communicate over localhost with the main container.
Question 3: What problem does the Strangler Fig pattern primarily address in cloud native migrations?
- Incrementally replacing a legacy monolith with microservices (Correct answer)
- Scaling stateful workloads horizontally
- Routing traffic between multiple service versions
- Encrypting inter-service communication
Correct answer: Incrementally replacing a legacy monolith with microservices
Strangler Fig allows teams to gradually migrate a monolith by routing new features to microservices while the legacy system remains operational.
Question 4: Which pattern uses a single entry point to handle cross-cutting concerns like authentication and rate limiting before forwarding requests to backend services?
- API Gateway (Correct answer)
- Service Mesh
- Ambassador
- Adapter
Correct answer: API Gateway
An API Gateway acts as a single entry point that enforces cross-cutting concerns such as authentication, logging, and rate limiting.
Question 5: In event-driven architecture, what is the role of an event broker like Apache Kafka?
- Decouples producers and consumers by persisting and distributing events (Correct answer)
- Converts synchronous REST calls into asynchronous operations
- Provides service discovery for event-driven services
- Manages secrets used by event producers
Correct answer: Decouples producers and consumers by persisting and distributing events
An event broker like Kafka decouples producers from consumers by durably storing events and allowing consumers to process them independently.
Question 6: What is the primary benefit of using the CQRS (Command Query Responsibility Segregation) pattern?
- Separates read and write models to optimize each independently (Correct answer)
- Ensures exactly-once delivery of messages between services
- Eliminates the need for a database in read-heavy applications
- Provides automatic failover for stateful services
Correct answer: Separates read and write models to optimize each independently
CQRS separates the read and write sides of a system, allowing each to be independently scaled, optimized, and evolved.
Question 7: Which pattern helps prevent a slow or failing service from consuming all resources and degrading other services in the system?
- Bulkhead (Correct answer)
- Circuit Breaker
- Retry with backoff
- Health endpoint monitoring
Correct answer: Bulkhead
The Bulkhead pattern isolates failures by partitioning resources (e.g., thread pools, connection pools) so one service's failure cannot exhaust shared resources.
Which cloud native pattern ensures that a service remains available even when one of its dependencies is experiencing failures?