VMware

Spring Professional Develop

2V0-72.22

Prepare for the 2V0-72.22 exam to validate your skills in Spring Professional development.

192 questions 0 views Free
Start Mock Test Timed · Full-length · Scored

Questions 151–160 of 192

Q151

Which service would you use for deploying microservices in Spring?

  • A Spring Cloud
  • B Spring Boot
  • C Spring Data
  • D Spring MVC
Explanation Spring Cloud provides tools specifically for building distributed systems with microservices. Spring Boot focuses on rapid application development, while Spring Data and Spring MVC serve different purposes.
Q152

A company needs to manage API versioning effectively; which approach should they choose?

  • A URL Versioning
  • B Query Parameter Versioning
  • C Header Versioning
  • D All of the above
Explanation All options are valid methods for versioning APIs and can be used based on specific requirements.
Q153

You are configuring security for a Spring application; what happens when `@EnableGlobalMethodSecurity(prePostEnabled = true)` is set?

  • A Enables role-based method security
  • B Disables security for repositories
  • C Allows method-level security annotations
  • D Automatically secures all endpoints
Explanation This annotation allows the use of method-level security annotations like @PreAuthorize. Other options do not fully reflect the functionality of the annotation.
Q154

Which service provides Spring Cloud's centralized configuration management?

  • A Spring Cloud Config
  • B Spring Boot Actuator
  • C Spring Data Source
  • D Spring RestTemplate
Explanation Spring Cloud Config allows centralized management of application configurations while the others serve different purposes.
Q155

A company needs to deploy multiple instances of a Spring Boot application behind a load balancer. Which Spring Cloud feature is best suited for this?

  • A Eureka Service Discovery
  • B Spring WebFlux
  • C Spring Batch
  • D Spring Data JPA
Explanation Eureka Service Discovery enables client-side load balancing, while others do not directly assist in this scenario.
Q156

You are configuring a Spring Boot application with external properties. What happens when both application.properties and application.yml files are present?

  • A Only application.properties is used
  • B Only application.yml is used
  • C application.yml overrides application.properties
  • D Both files are ignored
Explanation When both files exist, the properties in application.yml take precedence over those in application.properties.
Q157

Which service manages dependencies in Spring applications?

  • A Spring Framework
  • B Spring Boot
  • C Spring MVC
  • D Spring Cloud
Explanation Spring Boot simplifies dependency management and auto-configuration, while the others serve different purposes.
Q158

A company needs to expose a REST API. What is the best choice?

  • A Use Spring MVC
  • B Use JSP
  • C Use Spring Security
  • D Use Spring Batch
Explanation Spring MVC is specifically designed for creating web applications, including REST APIs, whereas the others focus on different aspects.
Q159

You are configuring a bean in Spring. What happens if you omit the @Component annotation?

  • A Bean will not be created
  • B Bean will be a singleton
  • C Bean will be lazily loaded
  • D Bean will be prototype
Explanation Omitting @Component means Spring will not manage the bean, thus it won't be created.
Q160

Which service provides a solution for simplifying Spring boot application configuration?

  • A Spring Cloud Config
  • B Spring Data
  • C Spring Security
  • D Spring REST
Explanation Spring Cloud Config provides externalized configuration support, while others focus on different functionalities.