Which service is used for container orchestration in Spring applications?
ASpring Cloud Kubernetes
BSpring Data JPA
CSpring Security
DSpring Boot Actuator
Explanation
Spring Cloud Kubernetes facilitates running Spring applications in Kubernetes environments, unlike the other options which serve different purposes.
Q62
A company needs to secure REST APIs in their application. What is the recommended approach?
AUse Spring Security
BAdd manual authentication checks
CUse plain HTTP
DIgnore security, focus on performance
Explanation
Spring Security is designed for securing RESTful APIs, while the other options disregard security best practices.
Q63
You are configuring a Spring Boot application for multi-tenancy. What happens when you set up a Single Database Schema per Tenant?
AEach tenant has its own schema
BAll tenants share one schema
CNo database is used
DTenants get limited to read-only
Explanation
Setting up a Single Database Schema per Tenant allows isolated storage per tenant, whereas the other options are functionally incorrect.
Q64
Which service enables monitoring of microservices in Spring Cloud?
ASpring Cloud Sleuth
BSpring Boot Actuator
CSpring Data JPA
DSpring Security
Explanation
Spring Cloud Sleuth provides tracing and monitoring for microservices, while the others serve different purposes.
Q65
A company needs to manage different configurations for multiple environments. What should you use in Spring Boot?
A@Profile annotations
B@ConfigurationProperties
C@ComponentScan
D@RestController
Explanation
@Profile annotations are specifically designed to activate different configurations based on the environment.
Q66
You are configuring a Spring Boot application with an embedded database. What happens if you set 'spring.datasource.url' to an incorrect value?
AApplication connects to default database
BApplication starts without connection
CApplication fails to start
DApplication warns but continues
Explanation
Setting an incorrect datasource URL prevents the application from establishing a connection, causing startup failure.
Q67
Which service is used in Spring to manage state between sessions?
ASpring Session
BSpring Batch
CSpring Security
DSpring MVC
Explanation
Spring Session manages user session states, while others serve different purposes.
Q68
A company needs to ensure data is processed in a non-blocking manner. What should they consider using?
ASpring AOP
BSpring WebFlux
CSpring Data JPA
DSpring Boot Starter
Explanation
Spring WebFlux supports reactive programming, while others do not focus on non-blocking I/O.
Q69
You are configuring error handling in a Spring Boot application. What happens when an Exception is thrown?
AApplication crashes immediately
BAn HTTP status 500 is returned
CThe user is logged out
DA custom error page is rendered
Explanation
By default, a 500 status is returned unless otherwise configured.
Q70
Which component is responsible for routing HTTP requests in Spring?
ADispatcherServlet
BApplicationContext
CRestController
DServiceLocator
Explanation
DispatcherServlet routes requests to appropriate handlers; others are not primarily for HTTP routing.