A company needs to securely expose REST APIs. Which tool should they use?
ASpring Security
BSpring AOP
CSpring Batch
DSpring Test
Explanation
Spring Security is specifically designed for securing applications and APIs.
Q132
What happens when a bean is annotated with @Lazy?
ALoaded eagerly on startup
BLoaded when first accessed
CNot loaded at all
DLoaded in parallel thread
Explanation
@Lazy ensures the bean is only created when first referenced, saving resources.
Q133
Which service is primarily used for cloud native application management in Spring?
ASpring Cloud
BSpring Data
CSpring Boot
DSpring Security
Explanation
Spring Cloud provides tools for cloud native applications, while others focus on data access, rapid application setup, and security.
Q134
A company needs to implement microservices architecture. Which feature is crucial for handling inter-service communication?
ALoad Balancer
BService Discovery
CDatabase Sharding
DMonolithic Deployment
Explanation
Service Discovery is essential for locating service instances, unlike the other options, which support different architectures or functionalities.
Q135
What happens when you set a bean scope to 'prototype' in Spring?
ASingle instance per application
BNew instance on each request
CShared instance across sessions
DSame instance for all threads
Explanation
Prototype scope ensures a new instance for each request, unlike single instance or shared cases.
Q136
Which service is used for cloud configuration automation in Spring Cloud?
ASpring Cloud Config
BSpring Data
CSpring Security
DSpring Batch
Explanation
Spring Cloud Config is the correct service for configuration management, while the others serve different purposes.
Q137
A company needs to communicate between two microservices securely. What Spring feature should they utilize?
ASpring Security
BSpring MVC
CSpring Session
DSpring Boot
Explanation
Spring Security is essential for secure communication, while the others are not focused on security specifically.
Q138
What happens when you set an endpoint in Spring Boot to 'hidden'?
AIt's visible to all users
BIt's logged improperly
CIt's accessible only to admins
DIt's not exposed in the API
Explanation
Setting an endpoint as 'hidden' prevents it from being publicly exposed, unlike the other options.
Q139
Which service in Spring Boot automatically configures beans based on dependencies?
ASpring Auto-Configuration
BSpring Data
CSpring Actuator
DSpring MVC
Explanation
Spring Auto-Configuration configures beans based on classpath presence and dependencies, while others serve different purposes.
Q140
A company needs to persist large amounts of JSON data efficiently. Which Spring Data feature should they use?
ASpring JPA
BSpring Batch
CSpring Redis
DSpring Data MongoDB
Explanation
Spring Data MongoDB is optimized for JSON data, while the others are designed for different data types or methods.