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 OAuth2

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

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

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

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

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

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

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

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

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

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