Posts

Showing posts from October, 2024

TCS WINGS 1 T4 SPRING BOOT SET 10

Image
Rahul Vijayan Follow for more updates TCS WINGS 1 T4 SPRING BOOT SET 10  You need to enable Spring Boot DevTools for faster development. What dependency should you add? Options: A) spring-boot-devtools B) spring-boot-starter-web C) Both A and B D) DevTools is not supported in Spring Boot Answer: A) spring-boot-devtools You want to configure 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 monitor your application metrics. What endpoint would you enable in Spring Boot Actuator? Options: A) /metrics B) /health C) /info D) All of the above Answer: D) All of the above 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 want to configure your Spring Boot...

TCS WINGS 1 T4 SPRING BOOT SET 9

Image
Rahul Vijayan Follow for more updates   TCS WINGS 1 T4 SPRING BOOT SET 9 You want to implement logging at different levels in your Spring Boot application. Which configuration file would you modify? Options: A) application.properties B) logback.xml 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 authentication entry point in your Spring Security configuration. What class should you implement? Options: A) AuthenticationEntryPoint B) AuthenticationProvider C) UserDetailsService D) SecurityConfigurer Answer: A) AuthenticationEntryPoint You want to set up an embedded database for testing in your Spring Boot application. Which database could you use? Options: A) H2 B) HSQLDB C) Both A and B D) Spring Boot does not support embedded databases Answer: C) Both A and B You need to implement a centralized configuration for multiple microservices. What would you typically use? Options: A) Spring Cloud Config B) Eureka...

TCS WINGS 1 T4 SPRING BOOT SET 8

Image
Rahul Vijayan Follow for more updates TCS WINGS 1 T4 SPRING BOOT SET 8 You want to define a RESTful API endpoint in your Spring Boot application. What annotation would you use? Options: A) @RestController B) @Controller C) @Service D) @Component Answer: A) @RestController You want to enable asynchronous processing in your Spring Boot application. What annotation would you use? Options: A) @EnableAsync B) @Async C) Both A and B D) Spring Boot does not support asynchronous processing Answer: C) Both A and B You need to configure your Spring Boot application to connect to an Oracle database. What dependency would you add? Options: A) oracle.jdbc B) spring-boot-starter-data-jpa C) Both A and B D) Spring Boot does not support Oracle Answer: C) Both A and B You want to manage distributed configuration in your microservices. Which tool would you typically use? Options: A) Spring Cloud Config B) Consul C) Both A and B D) Distributed configuration is not supported in Spring Boot Answer: A) Spri...

TCS WINGS 1 T4 SPRING BOOT SET 7

Image
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 nee...

TCS WINGS 1 T4 SPRING BOOT SET 6

Image
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 ...

TCS WINGS 1 T4 SPRING BOOT SET 5

Image
Rahul Vijayan Follow for more updates TCS WINGS 1 T4 SPRING BOOT SET 5 You want to add custom properties to your Spring Boot application. What would you do? Options: A) Create a custom properties file B) Use @ConfigurationProperties C) Both A and B D) Spring Boot does not support custom properties Answer: C) Both A and B You want to implement rate limiting in your Spring Boot application. What library would you typically use? Options: A) Resilience4j B) Spring Cloud Gateway C) Both A and B D) Rate limiting is not supported in Spring Boot Answer: C) Both A and B You want to deploy your Spring Boot application as a Docker container. What should you create? Options: A) Dockerfile B) docker-compose.yml C) Both A and B D) Spring Boot applications cannot be containerized Answer: A) Dockerfile You want to connect to a MySQL database using Spring Boot. Which dependency would you add? Options: A) MySQL Driver B) Spring Boot Starter Data JPA C) Both A and B D) Spring Boot does not support MySQL ...

TCS WINGS 1 T4 SPRING BOOT SET 4

Image
  Rahul Vijayan Follow for more updates TCS WINGS 1 T4 SPRING BOOT SET 4 You want to configure a custom error page in your Spring Boot application. What file should you create? Options: A) error.html in resources/templates B) error.json in resources C) error.jsp in webapp D) error.xml in resources Answer: A) error.html in resources/templates You need to implement pagination in your Spring Data JPA repository. What method would you use? Options: A) findAll(Pageable pageable) B) findAll(Sort sort) C) findAll() D) find(PageRequest pageRequest) Answer: A) findAll(Pageable pageable) You want to retrieve the current user from Spring Security's context. What would you do? Options: A) SecurityContextHolder.getContext().getAuthentication().getPrincipal() B) @AuthenticationPrincipal C) Both A and B D) Spring Security does not provide user details Answer: C) Both A and B You want to enable HTTPS in your Spring Boot application. What is the first step? Options: A) Generate a self-signed certif...

TCS WINGS 1 T4 SPRING BOOT SET 3

Image
  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 multipl...

TCS WINGS 1 T4 SPRING BOOT - SET 2

Image
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 ...

TCS WINGS 1 T4 SPRING BOOT SET 1

Image
Rahul Vijayan Follow for more updates TCS WINGS 1 T4 SPRING BOOT SET 1 You need to expose a REST API using Spring Boot. Which annotation do you use on your controller method? Options: A) @GetMapping B) @RequestMapping C) @PostMapping D) All of the above Answer: D) All of the above In a Spring Boot application, which annotation is used to define a configuration class? Options: A) @SpringBootApplication B) @Configuration C) @EnableAutoConfiguration D) @Component Answer: B) @Configuration You want to secure your Spring Boot application with basic authentication. Which dependency would you include? Options: A) Spring Security Starter B) Spring Boot Starter Web C) Spring Boot Starter Actuator D) Spring Boot Starter Data JPA Answer: A) Spring Security Starter In Spring Boot, which annotation is used to create a bean? Options: A) @Bean B) @Component C) @Service D) All of the above Answer: D) All of the above You want to validate user inputs in your Spring Boot application. Which library would...