TCS WINGS 1 T4 SPRING BOOT SET 3
Rahul Vijayan
Follow for more updates
TCS WINGS 1 T4 SPRING BOOT SET 3
You want to secure your Spring Boot REST API using OAuth2. Which dependency would you add?
Options:
A) Spring Security OAuth2
B) Spring Security
C) Spring Boot Starter Web
D) Spring Cloud Config
Answer:
A) Spring Security OAuth2You need to define a custom filter in your Spring Boot application. What class would you extend?
Options:
A) GenericFilterBean
B) OncePerRequestFilter
C) Filter
D) Both A and B
Answer:
D) Both A and BIn a Spring Boot application, how can you externalize configuration properties?
Options:
A) Using application.properties
B) Using application.yml
C) Using environment variables
D) All of the above
Answer:
D) All of the aboveYou want to validate that a String field is not empty in your entity class. What annotation would you use?
Options:
A) @NotEmpty
B) @NotNull
C) @Size(min = 1)
D) All of the above
Answer:
D) All of the aboveYou need to prevent the same method from being called multiple times concurrently. What would you use?
Options:
A) @Synchronized
B) @Lock
C) @Transactional
D) @Async
Answer:
B) @LockYou want to automatically create a database table for your entity class. What annotation would you use?
Options:
A) @Entity
B) @Table
C) @Document
D) Both A and B
Answer:
D) Both A and BYou need to configure Spring Security to allow access to a specific URL pattern. What would you modify?
Options:
A) WebSecurityConfigurerAdapter
B) application.properties
C) @EnableWebSecurity
D) @RestController
Answer:
A) WebSecurityConfigurerAdapterYou want to send asynchronous messages in a Spring Boot application. Which component would you typically use?
Options:
A) RabbitMQ
B) Kafka
C) Both A and B
D) Spring Boot does not support messaging
Answer:
C) Both A and BYou need to create a custom health indicator in Spring Boot Actuator. Which interface should you implement?
Options:
A) HealthIndicator
B) HealthCheck
C) ActuatorIndicator
D) CustomHealth
Answer:
A) HealthIndicatorYou want to log API requests and responses in your Spring Boot application. What would you implement?
Options:
A) Servlet Filter
B) Aspect Oriented Programming (AOP)
C) Both A and B
D) Spring Boot automatically logs API calls
Answer:
C) Both A and B

Comments
Post a Comment