TCS WINGS 1 T4 SPRING BOOT - SET 2

Rahul Vijayan
Follow for more updates


TCS WINGS 1 T4 SPRING BOOT - SET 2

  • What is the default port on which a Spring Boot application runs?
    Options:
    A) 8080
    B) 8000
    C) 80
    D) 8888
    Answer:
    A) 8080

  • You want to implement role-based access control in your Spring Boot application. Which annotation would you use?
    Options:
    A) @RolesAllowed
    B) @PreAuthorize
    C) @Secured
    D) All of the above
    Answer:
    D) All of the above

  • In a Spring Boot microservices architecture, which component is responsible for service discovery?
    Options:
    A) Eureka
    B) Zuul
    C) Ribbon
    D) Spring Cloud Config
    Answer:
    A) Eureka

  • You want to create a custom exception in your Spring Boot application. What should you extend?
    Options:
    A) Exception
    B) RuntimeException
    C) Throwable
    D) Both A and B
    Answer:
    B) RuntimeException

  • You need to handle global exceptions in a Spring Boot REST API. Which class should you use?
    Options:
    A) @ControllerAdvice
    B) ResponseEntityExceptionHandler
    C) @RestController
    D) Both A and B
    Answer:
    D) Both A and B

  • You want to implement caching in your Spring Boot application. Which annotation would you use to enable it?
    Options:
    A) @EnableCaching
    B) @Cacheable
    C) @CacheEvict
    D) Both A and B
    Answer:
    A) @EnableCaching

  • You want to use Spring Boot Actuator to monitor your application. Which dependency do you need to add?
    Options:
    A) Spring Boot Starter Actuator
    B) Spring Boot Starter Web
    C) Spring Boot Starter Security
    D) Spring Boot Starter Data JPA
    Answer:
    A) Spring Boot Starter Actuator

  • To read values from the application.properties file, which annotation would you use?
    Options:
    A) @Value
    B) @ConfigurationProperties
    C) Both A and B
    D) @PropertySource
    Answer:
    C) Both A and B

  • You want to implement API versioning in your Spring Boot application. What is a common approach?
    Options:
    A) URL versioning
    B) Header versioning
    C) Parameter versioning
    D) All of the above
    Answer:
    D) All of the above

  • You need to ensure that a method in your Spring Boot application is executed only once every minute. What would you use?
    Options:
    A) @Scheduled(fixedRate = 60000)
    B) @Timed
    C) @Lock
    D) @Scheduled(cron = "0 * * * * ?")
    Answer:
    D) @Scheduled(cron = "0 * * * * ?")

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