Online Exam Quiz

questionQuestion  1 to 30

What is the default scope of a Spring Bean?

  • Prototype
  • Singleton
  • Request
  • Session
Mark for review

How can you configure a data source in Spring Boot?

  • Using application.properties
  • Using application.yml
  • Using DataSourceConfig class
  • All of the above
Mark for review

Which Spring Boot annotation is used to handle RESTful web services?

  • @RestController
  • @Controller
  • @Service
  • @Repository
Mark for review

How do you exclude a class from being scanned by Spring Boot?

  • Using @Exclude
  • Using @ComponentScan
  • Using @SpringBootApplication(exclude)
  • Using @SpringExclude
Mark for review

What is the use of the application.properties file in Spring Boot?

  • To configure database
  • To configure application settings
  • To configure server settings
  • All of the above
Mark for review

What is the purpose of Spring Boot Actuator?

  • To monitor applications
  • To manage applications
  • To expose operational endpoints
  • All of the above
Mark for review

What is the purpose of @RequestMapping in Spring Boot?

  • To map web requests
  • To map database requests
  • To configure security settings
  • To map application properties
Mark for review

Which class is the entry point of a Spring Boot application?

  • Main class
  • SpringApplication
  • ApplicationConfig
  • BootApplication
Mark for review

How do you create a Spring Boot project using the Spring Initializr?

  • By using the command line
  • By using a web interface
  • By using an IDE plugin
  • All of the above
Mark for review

Which annotation is used to define a repository in Spring Data JPA?

  • @Repository
  • @Component
  • @Service
  • @RestController
Mark for review

What is the default logging framework in Spring Boot?

  • Log4j
  • SLF4J
  • Logback
  • JUL
Mark for review

What is Spring Boot DevTools?

  • A development tool suite
  • A plugin
  • A testing tool
  • A monitoring tool
Mark for review

Which dependency is used for unit testing in Spring Boot?

  • spring-boot-starter-test
  • spring-boot-starter-data-jpa
  • spring-boot-starter-web
  • spring-boot-starter-security
Mark for review

Which file extension is used for Spring Boot application configuration in YAML format?

  • .yaml
  • .yml
  • .yaml and .yml
  • .properties
Mark for review

Which starter would you use for a Spring Boot web application?

  • spring-boot-starter-data-jpa
  • spring-boot-starter-web
  • spring-boot-starter-security
  • spring-boot-starter-test
Mark for review

What is the use of @Cacheable annotation in Spring Boot?

  • To cache method results
  • To configure caching
  • To handle cache eviction
  • To manage cache configuration
Mark for review

How do you enable asynchronous processing in Spring Boot?

  • Using @Async
  • Using @EnableAsync
  • Using @EnableAsynchronous
  • Both @Async and @EnableAsync
Mark for review

How can you define an in-memory database in Spring Boot?

  • Using application.properties
  • Using application.yml
  • Using H2 or HSQLDB dependency
  • All of the above
Mark for review

Which annotation is used to enable scheduling in Spring Boot?

  • @Scheduled
  • @EnableScheduling
  • @EnableSchedule
  • @Schedule
Mark for review

How can you run a Spring Boot application on a specific profile?

  • Using --profile
  • Using --spring.profile
  • Using --spring.profiles.active
  • Using --profiles.active
Mark for review

What is the use of @Transactional annotation in Spring Boot?

  • To manage transactions
  • To configure database
  • To handle security
  • To manage caching
Mark for review

What is Spring Boot?

  • A framework
  • A library
  • A programming language
  • A database
Mark for review

What does the @SpringBootApplication annotation do?

  • Combines @Configuration
  • Enables auto-configuration
  • Enables component scanning
  • All of the above
Mark for review

Which annotation is used to enable Spring Boot's auto-configuration feature?

  • @Configuration
  • @EnableAutoConfiguration
  • @ComponentScan
  • @SpringBootApplication
Mark for review

What is the use of @RequestParam in Spring Boot?

  • To extract query parameters
  • To map URI parameters
  • To configure request parameters
  • To inject beans
Mark for review

Which starter is used for testing Spring Boot applications?

  • spring-boot-starter-test
  • spring-boot-starter-web
  • spring-boot-starter-data-jpa
  • spring-boot-starter-security
Mark for review

What does the @RequestBody annotation do?

  • Binds the HTTP request body
  • Maps the HTTP request to a method
  • Binds a request parameter to a method argument
  • Binds a request header to a method argument
Mark for review

Which Spring Boot feature is used to externalize configuration?

  • Spring Boot CLI
  • Spring Cloud Config
  • Spring DevTools
  • Spring Boot Actuator
Mark for review

How can you include a dependency in a Spring Boot project?

  • By adding it to application.properties
  • By adding it to application.yml
  • By adding it to pom.xml or build.gradle
  • By adding it to application.conf
Mark for review

How do you specify the port for a Spring Boot application?

  • server.port
  • application.port
  • server.portnumber
  • server.connection.port
Mark for review

blinkerOnline

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • Answered
  • Not Answered
  • Marked for Review