Spring Cloud Professional Standards & Competencies 4 — Questions and Answers
Question 1: A team lead reviews code and finds hardcoded service URLs in Feign clients. What professional standard is violated?
- Single Responsibility Principle
- Service discovery and externalized configuration best practices (Correct answer)
- Test-driven development
- Continuous integration guidelines
Correct answer: Service discovery and externalized configuration best practices
Hardcoding URLs bypasses service discovery and externalized config, making the system brittle and difficult to scale or reconfigure across environments.
Question 2: What is the professional role of health indicators in Spring Cloud services exposed via Spring Actuator?
- They generate revenue reports for stakeholders
- They report service and dependency health to orchestration platforms for routing and restart decisions (Correct answer)
- They replace unit tests for service correctness
- They configure circuit breaker thresholds automatically
Correct answer: They report service and dependency health to orchestration platforms for routing and restart decisions
Health indicators expose service readiness and liveness, allowing platforms like Kubernetes or Eureka to make informed decisions about routing traffic and restarting unhealthy instances.
Question 3: When implementing a Saga pattern in a Spring Cloud microservices architecture, what is the key professional concern?
- Ensuring all services share a single database transaction
- Managing distributed transaction compensations to maintain data consistency across services (Correct answer)
- Preventing all asynchronous communication
- Using only synchronous REST calls between services
Correct answer: Managing distributed transaction compensations to maintain data consistency across services
The Saga pattern manages distributed consistency by defining compensating transactions that undo completed steps if a later step fails, avoiding distributed ACID transactions.
Question 4: A Spring Cloud Config Client fails to start because the config server is unavailable. How should a professional configure fail-safe behavior?
- Set spring.cloud.config.fail-fast=false and provide local fallback configuration (Correct answer)
- Remove the Config Client dependency entirely
- Hardcode all properties in the application JAR
- Disable all actuator endpoints
Correct answer: Set spring.cloud.config.fail-fast=false and provide local fallback configuration
Setting fail-fast=false with local property fallbacks allows the service to start even if the config server is temporarily unavailable, improving resilience.
Question 5: Which observability pillar is specifically addressed by integrating Spring Cloud Sleuth with Zipkin?
- Metrics collection for CPU and memory
- Distributed tracing to visualize request flows across microservices (Correct answer)
- Log aggregation into a central data store
- Alert management for SLA breaches
Correct answer: Distributed tracing to visualize request flows across microservices
Zipkin integration with Sleuth provides a UI for visualizing trace timelines, identifying latency bottlenecks across the entire distributed call chain.
Question 6: What professional justification supports using Spring Cloud Kubernetes over Eureka in a Kubernetes-native deployment?
- Kubernetes has no service discovery mechanism
- Spring Cloud Kubernetes leverages native Kubernetes Services and ConfigMaps, eliminating a redundant discovery layer (Correct answer)
- Eureka provides better performance in all cloud environments
- Kubernetes cannot run Spring Boot applications
Correct answer: Spring Cloud Kubernetes leverages native Kubernetes Services and ConfigMaps, eliminating a redundant discovery layer
In Kubernetes environments, native service discovery and config management already exist; Spring Cloud Kubernetes integrates with them directly, reducing architectural complexity.
Question 7: A Spring Cloud Gateway route is configured with a RateLimiter filter. What professional goal does this achieve?
- It prevents unauthorized configuration changes
- It protects backend services from traffic spikes by controlling request throughput per client (Correct answer)
- It encrypts all request payloads at the gateway
- It performs schema validation on request bodies
Correct answer: It protects backend services from traffic spikes by controlling request throughput per client
The RateLimiter filter (backed by Redis) enforces per-client request quotas at the gateway, protecting downstream services from being overwhelmed by traffic bursts.
A team lead reviews code and finds hardcoded service URLs in Feign clients.
What professional standard is violated?