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) 8080You 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 aboveIn 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) EurekaYou 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) RuntimeExceptionYou 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 BYou 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) @EnableCachingYou 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 ActuatorTo 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 BYou 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 aboveYou 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
Post a Comment