CPSA Cross-cutting Concepts 3 — Questions and Answers
Question 1: Which pattern provides a single, reusable implementation of a cross-cutting concern (e.g., retry logic) that is injected into multiple services without code duplication?
- Sidecar / proxy pattern (Correct answer)
- Saga pattern
- CQRS pattern
- Strangler fig pattern
Correct answer: Sidecar / proxy pattern
The sidecar pattern deploys a co-located proxy that transparently handles cross-cutting concerns like retries, mTLS, and circuit breaking for the main service.
Question 2: In CPSA terms, which quality attribute is directly addressed by implementing a circuit breaker as a cross-cutting mechanism?
- Resilience / fault tolerance (Correct answer)
- Scalability
- Maintainability
- Usability
Correct answer: Resilience / fault tolerance
A circuit breaker prevents cascading failures by stopping calls to a failing dependency, directly improving fault tolerance and system resilience.
Question 3: Which approach best handles idempotency as a cross-cutting concern for HTTP POST endpoints?
- Accepting a client-generated idempotency key and deduplicating on the server (Correct answer)
- Using HTTP GET instead of POST
- Disabling retries in the client
- Requiring synchronous confirmation from all replicas
Correct answer: Accepting a client-generated idempotency key and deduplicating on the server
An idempotency key lets the server detect and suppress duplicate requests, ensuring retried POSTs do not create duplicate effects.
Question 4: A CPSA candidate is reviewing an architecture where transaction boundaries span multiple services. Which cross-cutting pattern manages eventual consistency without distributed locking?
- Saga pattern with compensating transactions (Correct answer)
- Two-phase commit (2PC)
- Optimistic locking with version columns
- Pessimistic row-level locking
Correct answer: Saga pattern with compensating transactions
The Saga pattern decomposes a distributed transaction into a sequence of local transactions with compensating actions, achieving eventual consistency without 2PC overhead.
Question 5: Which cross-cutting technique allows teams to release new features to a subset of users without changing code between deployments?
- Feature toggles (feature flags) (Correct answer)
- Blue-green deployment
- Rolling deployment
- Canary analysis
Correct answer: Feature toggles (feature flags)
Feature toggles let you switch functionality on or off at runtime for specific user segments without deploying new code.
Question 6: When securing inter-service communication in a microservices system, which cross-cutting mechanism provides mutual authentication at the transport layer?
- Mutual TLS (mTLS) (Correct answer)
- API key rotation
- OAuth 2.0 authorization code flow
- HMAC request signing
Correct answer: Mutual TLS (mTLS)
mTLS requires both client and server to present certificates, ensuring that only authenticated services can communicate with each other.
Question 7: Which architectural decision treats caching as a cross-cutting concern rather than embedding cache logic in each service?
- Using a shared caching layer (e.g., Redis) accessed via a common library or proxy (Correct answer)
- Adding in-memory maps to each service independently
- Storing cache entries in the primary relational database
- Disabling caching and relying on horizontal scaling alone
Correct answer: Using a shared caching layer (e.g., Redis) accessed via a common library or proxy
A shared caching layer with a common access abstraction centralizes cache management and prevents duplicated, inconsistent caching logic across services.
Which pattern provides a single, reusable implementation of a cross-cutting concern (e.g., retry logic) that is injected into multiple services without code duplication?