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 above

  • You 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 B

  • You 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 B

  • You 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 B

  • You 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}.properties

  • You 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) @Repository

  • You 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 B

  • You 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 B

  • You 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 above

  • You 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

Popular posts from this blog

T4 Spring boot wings 1

TCS WINGS 1 T4 SPRING BOOT SET 10

TCS WINGS 1 T4 SPRING BOOT SET 4