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 121–130 of 192

Q121

Which service does Spring Cloud provide for distributed configuration management?

  • A Config Server
  • B Service Registry
  • C Eureka Server
  • D API Gateway
Explanation Config Server allows external configuration management, while the others serve different purposes.
Q122

You are configuring a REST API with Spring. Which annotation is essential for mapping GET requests?

  • A @PostMapping
  • B @GetMapping
  • C @ResponseBody
  • D @PathVariable
Explanation @GetMapping specifically maps HTTP GET requests, unlike the other options.
Q123

What happens when a Spring Bean is marked as @Scope("prototype")?

  • A Singleton instances are shared
  • B New instances are created each time
  • C Only one instance exists
  • D Same instance across sessions
Explanation Prototype scope means a new bean instance is created on each request, unlike the singleton scope.
Q124

Which service enables cloud-native application development in Spring?

  • A Spring Cloud
  • B Spring Boot
  • C Spring Data
  • D Spring AOP
Explanation Spring Cloud provides tools for building distributed systems, whereas others focus on specific development aspects.
Q125

A company needs to handle asynchronous processing in a Spring application. Which component should they use?

  • A @Scheduled
  • B ExecutorService
  • C Spring Batch
  • D @Async
Explanation @Async allows methods to run asynchronously while others are blocking.
Q126

You are configuring Spring Security with JWT. What happens when the token is expired?

  • A Access is denied immediately
  • B Refresh token is issued
  • C New access token is generated
  • D User sessions are invalidated
Explanation Expired tokens typically result in access denial; no automatic token refresh occurs.
Q127

Which Spring feature allows for easy REST API creation?

  • A Spring Web
  • B Spring Batch
  • C Spring Data
  • D Spring Security
Explanation Spring Web provides the tools for creating REST APIs, while others serve different purposes.
Q128

A company needs to manage multiple versions of their microservices. What Spring Cloud feature should they use?

  • A Service Discovery
  • B API Gateway
  • C Circuit Breaker
  • D Config Server
Explanation Config Server manages application configurations, including multiple versions.
Q129

You are configuring Spring Security. What happens if you disable CSRF protection?

  • A Increases security risk
  • B Enables AJAX requests
  • C Disables API access
  • D Improves session management
Explanation Disabling CSRF protection makes the application vulnerable to cross-site request forgery attacks.
Q130

Which service manages the dependency injection?

  • A Spring Framework
  • B Spring Boot
  • C Spring Cloud
  • D Spring Data
Explanation The Spring Framework provides core dependency injection features, while the others focus on different aspects.