Q121
Q121 How does Spring Cloud support distributed tracing?
Using tracing annotations
Using Sleuth
Using AOP
Using HttpSecurity
Q122
Q122 Which component of Spring Cloud handles service registration and discovery?
Spring Cloud Gateway
Spring Boot Actuator
Eureka Server
Config Server
Q123
Q123 How can you centralize configuration in Spring Cloud?
Using Spring Cloud Gateway
Using Config Server
Using RestTemplate
Using HttpSecurity
Q124
Q124 How can you enable a Spring Boot application to act as a Eureka client?
Use @EnableEurekaClient annotation
Use @EnableDiscoveryClient annotation
Use @EnableConfigClient annotation
Use @EnableCloudConfig annotation
Q125
Q125 How do you create a custom Zuul filter in Spring Cloud?
Extend ZuulFilter class
Use @ZuulFilter annotation
Implement Filter interface
Use @EnableZuulProxy annotation
Q126
Q126 How do you implement circuit breaker functionality in Spring Cloud?
Use @CircuitBreaker annotation
Use @HystrixCommand annotation
Use @EnableCircuitBreaker annotation
Use @Fallback annotation
Q127
Q127 Why does a Spring Cloud Config client fail to fetch configurations?
Incorrect configuration location
Invalid credentials
Config server down
All of the above
Q128
Q128 Why does a "RibbonLoadBalancerClientException" occur in Spring Cloud?
Missing Eureka registration
Invalid load balancing rules
Service down
Any of the above
Q129
Q129 What is the primary use of @Configuration in Spring?
To define a Bean
To enable auto-configuration
To manage dependency injection
To create application context
Q130
Q130 How can you define multiple Beans in a single Java configuration file?
Use @Bean methods
Use multiple @Configuration classes
Use @Import annotation
Any of the above
Q131
Q131 What is the role of the @Import annotation in Spring configuration?
To import properties
To import XML configuration
To import another configuration class
To import Beans
Q132
Q132 Which annotation is used to customize the initialization and destruction of a Bean?
@Bean
@Scope
@PostConstruct and @PreDestroy
@Lifecycle
Q133
Q133 How do you define a prototype Bean in Spring Java configuration?
Use scope="prototype" in XML
Use @Scope("prototype") annotation
Use @Prototype annotation
Use @Bean with scope
Q134
Q134 How do you load properties in a Spring Java configuration class?
Use @ConfigurationProperties annotation
Use @Value annotation
Use Environment API
All of the above
Q135
Q135 Why does a "BeanDefinitionOverrideException" occur in Spring?
Circular dependency
Duplicate Bean definition
Invalid Bean scope
Improper initialization
Q136
Q136 Why does a "NoSuchBeanDefinitionException" occur during runtime?
Missing @Bean annotation
Improper configuration class
Invalid Bean scope
Any of the above
Q137
Q137 Which Spring feature can optimize Bean initialization?
Lazy initialization
Prototype scope
Singleton scope
ApplicationContext
Q138
Q138 How can you minimize memory usage in a Spring application?
Use prototype-scoped Beans
Use @Lazy annotation
Use singleton Beans with lazy initialization
Use all these methods
Q139
Q139 What is the purpose of the @Profile annotation in Spring?
To create Bean profiles
To define application profiles
To manage environment properties
To enable caching
Q140
Q140 How can you enable caching in a Spring application?
Use @EnableCaching annotation
Use @Cacheable annotation
Use CacheManager configuration
Use all these methods
Q141
Q141 How can you implement a custom cache in Spring?
Extend CacheManager
Use @CustomCache annotation
Implement Cache interface
Use @CacheConfig annotation
Q142
Q142 Why does a "CacheLookupException" occur in Spring?
Cache miss
Cache configuration error
Improper cache initialization
Invalid cache key
Q143
Q143 Why does a "BeanCurrentlyInCreationException" occur in Spring?
Circular dependency
Improper Bean initialization
Missing configuration
Invalid @Lazy usage
Q144
Q144 What is the primary benefit of using Spring in enterprise applications?
Simplified configuration
Improved modularity
Enhanced security
All of these
Q145
Q145 How does Spring support multi-threaded application development?
Using @Async annotation
Using ThreadPoolTaskExecutor
Using AOP
All of these
Q146
Q146 What is the role of Spring Boot in microservices architecture?
Dependency management
Centralized configuration
Simplified application startup
All of these
Q147
Q147 How can you implement logging in a Spring application?
Use Log4j
Use SLF4J
Use Spring Logging Framework
All of these
Q148
Q148 How do you test REST endpoints in a Spring application?
Use MockMvc
Use RestTemplate
Use Postman
Use JUnit
Q149
Q149 Why does a "LazyInitializationException" occur in Hibernate with Spring?
Session closed before use
Incorrect Bean scope
Invalid ORM mapping
Improper transaction configuration
Q150
Q150 An application fails with "TransactionRollbackException" in a Spring transaction. What is the likely cause?
Database constraint violation
Improper transaction boundary
Incorrect Bean configuration
All of these