TCS WINGS 1 T4 SPRING BOOT SET 6

Rahul Vijayan
Follow for more updates

TCS WINGS 1 T4 SPRING BOOT SET 6

  • You want to define a default error response structure for your REST API. What class would you create?
    Options:
    A) CustomError
    B) ErrorResponse
    C) ExceptionHandler
    D) Both A and B
    Answer:
    D) Both A and B

  • You want to use Spring Cloud Config for external configuration management. What dependency should you add?
    Options:
    A) Spring Cloud Starter Config
    B) Spring Boot Starter Web
    C) Spring Boot Starter Security
    D) Spring Boot Starter Data JPA
    Answer:
    A) Spring Cloud Starter Config

  • You need to implement a distributed transaction across multiple microservices. Which pattern would you use?
    Options:
    A) Two-Phase Commit
    B) Saga Pattern
    C) Eventual Consistency
    D) Both B and C
    Answer:
    D) Both B and C

  • You want to allow cross-origin requests in your Spring Boot application. What property would you set?
    Options:
    A) spring.web.cors.allow-credentials
    B) spring.web.cors.allowed-origins
    C) Both A and B
    D) CORS is automatically enabled
    Answer:
    C) Both A and B

  • You want to validate that an email address is in a correct format in your Spring Boot application. What annotation would you use?
    Options:
    A) @Email
    B) @Pattern
    C) Both A and B
    D) Validation is not supported in Spring Boot
    Answer:
    A) @Email

  • You need to configure logging in your Spring Boot application. What file would you modify?
    Options:
    A) logback.xml
    B) application.properties
    C) Both A and B
    D) Spring Boot does not support logging configuration
    Answer:
    C) Both A and B

  • You want to implement a custom user details service in your Spring Security configuration. Which interface should you implement?
    Options:
    A) UserDetailsService
    B) AuthenticationManager
    C) UserDetails
    D) CustomUserDetailsService
    Answer:
    A) UserDetailsService

  • You need to set up a message broker in your Spring Boot application. Which technology could you use?
    Options:
    A) RabbitMQ
    B) Apache Kafka
    C) Both A and B
    D) Spring Boot does not support message brokers
    Answer:
    C) Both A and B

  • You want to enable health checks for your microservices. What actuator endpoint would you use?
    Options:
    A) /health
    B) /info
    C) /metrics
    D) /env
    Answer:
    A) /health

  • You want to restrict access to a specific role in your Spring Security configuration. What annotation would you use?
    Options:
    A) @RolesAllowed
    B) @Secured
    C) @PreAuthorize
    D) All of the above
    Answer:
    D) All of the above


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