TCS WINGS 1 T4 SPRING BOOT SET 7
Rahul Vijayan
Follow for more updates
TCS WINGS 1 T4 SPRING BOOT SET 7
You want to configure a custom bean in your Spring Boot application. What method would you use?
Options:
A) @Bean
B) @Component
C) @Configuration
D) All of the above
Answer:
D) All of the aboveYou need to handle errors in a global manner in your Spring Boot application. What annotation would you use?
Options:
A) @ExceptionHandler
B) @ControllerAdvice
C) Both A and B
D) Spring Boot does not support global error handling
Answer:
C) Both A and BYou want to implement JWT authentication in your Spring Boot application. Which dependency would you add?
Options:
A) jjwt
B) Spring Security
C) Both A and B
D) JWT is not supported in Spring Boot
Answer:
C) Both A and BYou want to secure REST endpoints in your Spring Boot application. What approach would you take?
Options:
A) Use Spring Security
B) Use basic authentication
C) Both A and B
D) Spring Boot does not support securing REST endpoints
Answer:
C) Both A and BYou need to manage configuration properties for different profiles in Spring Boot. What file naming convention should you follow?
Options:
A) application-{profile}.properties
B) config-{profile}.properties
C) application.yml
D) All of the above
Answer:
A) application-{profile}.propertiesYou want to use Spring Data JPA to access a database. Which annotation would you use on your repository interface?
Options:
A) @Repository
B) @Service
C) @Component
D) @Entity
Answer:
A) @RepositoryYou want to implement API documentation for your REST API. Which tool would you use?
Options:
A) Swagger
B) Springfox
C) Both A and B
D) API documentation is not supported in Spring Boot
Answer:
C) Both A and BYou want to test a Spring Boot application using JUnit. What annotation would you use?
Options:
A) @RunWith(SpringRunner.class)
B) @SpringBootTest
C) Both A and B
D) JUnit does not support Spring Boot testing
Answer:
C) Both A and BYou need to implement a load balancer for your microservices. Which component would you use?
Options:
A) Ribbon
B) Zuul
C) Eureka
D) All of the above
Answer:
D) All of the aboveYou want to enable Spring Security in your application. Which class should you extend?
Options:
A) WebSecurityConfigurerAdapter
B) SecurityFilterChain
C) Both A and B
D) Spring Security is automatically enabled
Answer:
A) WebSecurityConfigurerAdapter

Comments
Post a Comment