Spring Boot MCQ Questions and Answers | Set 9


Welcome to Set 9 of our 100+ Spring Boot MCQ Questions and Answers series. This Set 9 continues from MCQs 81-90 and covers Spring Boot and Spring framework modules.

Complete Spring Boot MCQ Questions and Answers series:

Spring Boot MCQ Questions and Answers | Set 1

Spring Boot MCQ Questions and Answers | Set 2

Spring Boot MCQ Questions and Answers | Set 3

Spring Boot MCQ Questions and Answers | Set 4

Spring Boot MCQ Questions and Answers | Set 5

Spring Boot MCQ Questions and Answers | Set 6

Spring Boot MCQ Questions and Answers | Set 7

Spring Boot MCQ Questions and Answers | Set 8

Spring Boot MCQ Questions and Answers | Set 9

Spring Boot MCQ Questions and Answers | Set 10

81. Which Spring Boot starter is used for integrating the MongoDB NoSQL database?

a) spring-boot-starter-mongodb
b) spring-boot-starter-data-mongodb
c) spring-boot-starter-jdbc
d) spring-boot-starter-data-redis

82. In Spring Boot, how can you access the H2 database's web console in development?

a) By setting spring.h2.console.enabled to true
b) Through manual configuration in the application.properties
c) By including a dedicated H2 web console starter
d) By configuring the web console path in XML

83. In Spring Boot, which annotation is used to define SQL queries in repository interfaces?

a) @Query
b) @Select
c) @SqlQuery
d) @DatabaseQuery

84. How can you define a JPA repository in Spring Boot?

a) By creating a class that extends JpaRepository
b) By annotating a class with @Repository
c) By defining an interface that extends CrudRepository or JpaRepository
d) By using the @JpaRepository annotation

85. What is the role of the JpaRepository interface in Spring Boot?

a) To provide RESTful web service capabilities
b) To offer a central repository abstraction for JPA entities
c) To enable WebSocket functionality
d) To provide batch processing functionalities

86. Which Spring Boot starter is used for integrating the Elasticsearch NoSQL database?

a) spring-boot-starter-elasticsearch
b) spring-boot-starter-data-elasticsearch
c) spring-boot-starter-jdbc
d) spring-boot-starter-data-redis

87. What is the purpose of the @GeneratedValue annotation in a JPA entity?

a) To generate unique identifiers for RESTful endpoints
b) To automatically generate the primary key values
c) To configure generated SQL queries
d) To create scheduled tasks

88. How does Spring Boot support Redis caching?

a) By manual configuration of Redis clients
b) Through the spring-boot-starter-data-redis dependency
c) By embedding a Redis server within the application
d) Through XML-based configuration

89. What is the primary role of the MongoRepository interface in Spring Boot?

a) To provide support for MongoDB operations
b) To enable RESTful web services
c) To offer batch processing functionalities
d) To support WebSocket communication

90. In Spring Boot, how can you enable automatic schema generation for JPA entities?

a) By using the @AutoSchemaGeneration annotation
b) By setting spring.jpa.hibernate.ddl-auto property
c) Through XML configuration
d) By manual schema creation in the database


Comments

Spring Boot 3 Paid Course Published for Free
on my Java Guides YouTube Channel

Subscribe to my YouTube Channel (165K+ subscribers):
Java Guides Channel

Top 10 My Udemy Courses with Huge Discount:
Udemy Courses - Ramesh Fadatare