Day 5/15 — Spring Professional Certification 2025
Welcome to Day 5 of the Spring Professional Certification journey.
If you missed Day 4 , you can find the previous article here.
The first article in this series covers all the essential details about the exam.
Here is the series:


Why Should I Get Certified:
✔ To prove my Spring expertise to employers
✔ To boost my job opportunities in backend & enterprise application development
✔ To deepen my understanding of Spring’s core concepts
✔ To stand out in interviews
But even if you do not wish to get certified, practicing MCQs is one of the best ways to reinforce core Spring concepts.
Even if you’re not actively preparing for the certification, this series can still be a great way to refresh your knowledge (if you are doing interview prep), challenge your thinking, and train your brain — especially since some questions have multiple correct answers.
By following along, you will get a fun and engaging daily dose of revision of Spring and Spring Boot concepts without feeling overwhelmed.
Each day, we’ll go through 10–15 multiple-choice questions, covering key topics like Spring Core, Spring Boot, AOP, Transactions, Security, and so much more.
Let’s dive into today’s questions! 🚀
Let’s begin.
Question 1
Which of the following are valid Bean Scopes? (Select 2)
A) prototype
B) factory
C) response
D) request
Question 2
Which of the following ‘database initialization’ statements is true? (Select 2)
A) Spring Boot initializes the database whether it is an in-memory database or a ‘real’ database.
B) Spring Boot will load the schema-${platform}.sql
and data-${platform}.sql
files (if present), where platform
is the value of spring.datasource.platform
.
C) Spring Boot loads SQL from the standard locations schema.sql
(for DDL) and data.sql
(for DML).
D) If the scripts cause exceptions, the application will still start.
Question 3:
Which of the following isolation levels is the MOST protective?
A) READ_COMMITTED
B) SERIALIZABLE
C) REPEATABLE_READ
D) READ_UNCOMMITTED
Question 4:
Which is NOT a Spring Boot Actuator endpoint?
A) /off
B) /info
C) /health
D) /configprops
Question 5
Which of the following statements about Spring MVC are true? (select 2)
A) Spring MVC supports a wide range of view technologies such as JSP, Thymeleaf, and Freemarker.
B) Spring MVC follows the Model-View-Controller architectural pattern to separate concerns between the data model, presentation logic, and user interface.
C) Spring MVC is a standalone framework and cannot be integrated with other frameworks.
D) Spring MVC only supports handling GET requests and not POST requests.
Question 6
Which Spring bean scope is described as “Scopes a single bean definition to the lifecycle of a ServletContext. Only valid in the context of a web-aware Spring ApplicationContext.”?
A) session
B) request
C) application
D) singleton
Question 7
Which term corresponds to “User, device, or system that performs an action”?
A) Secured Resource
B) Authorization
C) Principal
D) Authority
Question 8:
Which of the following statements are true about the DataSource
interface? (Select 2)
A) The DataSource
interface is implemented by a driver vendor.
B) The DataSource
interface is intended for use with relational databases and is not suitable for NoSQL databases.
C) DataSource
is a Spring framework interface.
D) All of the above.
Question 9:
Which of the following is commonly NOT required to be specified for DataSource configuration in Spring Boot?
A) driver-class-name
B) url
C) username
D) password
(Choose the best answer.)
Question 10:
Which of the following database isolation levels prevent phantom reads?
A) READ_COMMITTED
B) READ_UNCOMMITTED
C) REPEATABLE_READ
D) SERIALIZABLE
(Select the correct answer.)
Well,
You have made it this far — great job!
But truth be told beyond certification prep, real learning comes from hands-on projects.
But I know that picking the right projects can be tough, especially when most ideas are overused — even in paid courses.
That’s exactly why I created this structured eBook — so you don’t have to figure it all out alone.
It’s packed with real-world Spring Boot projects designed to bridge the gap between theory and practical application.
You’ll work on high-impact topics like:
✅ Database transactions
✅ Caching
✅ API integrations
✅ Security
✅ Async processing …and more!
No more random projects.
No more confusion.
🔥 Get your copy now: Spring Boot Project Ideas
Answers:
Question 1
Correct Answers:
✅ A) prototype
✅ D) request
Explanation:
Spring provides different bean scopes that determine how long a bean instance is maintained in the application context. The main scopes are:
✔ singleton — A single shared instance of the bean is created and maintained across the entire Spring container.
✔ prototype — A new bean instance is created every time it is requested.
✔ request — A new bean instance is created for each HTTP request. This scope is only available in web-aware Spring applications.
✔ session — A single bean instance is maintained for an HTTP session.
✔ global session — Similar to session scope but applies in a Portlet context instead of an HTTP session.
Example Usage:
✔ Defining a Prototype Bean:
@Bean
@Scope("prototype")
public MyService myService() {
return new MyService();
}
✔ Defining a Request-Scoped Bean:
@Bean
@Scope("request")
public MyController myController() {
return new MyController();
}
References:
🔗 Spring Bean Scopes Documentation
Question 2
Correct Answers:
✅ B) Spring Boot will load the schema-${platform}.sql
and data-${platform}.sql
files (if present), where platform
is the value of spring.datasource.platform
.
✅ C) Spring Boot loads SQL from the standard locations schema.sql
(for DDL) and data.sql
(for DML).
Explanation:
Spring Boot provides automatic database initialization by leveraging Spring JDBC’s DataSource initializer feature.
Example Configuration:
To enable database initialization for a specific platform:
spring.datasource.platform=postgres
Spring Boot will look for schema-postgres.sql
and data-postgres.sql
.
References:
🔗 Spring Boot Database Initialization
Question 3:
Correct Answer:
✅ B) SERIALIZABLE
Explanation:
Isolation is one of the common ACID properties: Atomicity, Consistency, Isolation, and Durability. Isolation describes how changes applied by concurrent transactions are visible to each other.
Each isolation level prevents zero or more concurrency side effects on a transaction:
- Dirty read: read the uncommitted change of a concurrent transaction
- Nonrepeatable read: get different value on re-read of a row if a concurrent transaction updates the same row and commits
- Phantom read: get different rows after re-execution of a range query if another transaction adds or removes some rows in the range and commits
We can set the isolation level of a transaction by @Transactional::isolation. It has these five enumerations in Spring: DEFAULT, READ_UNCOMMITTED, READ_COMMITTED, REPEATABLE_READ, SERIALIZABLE.
SERIALIZABLE is the highest level of isolation. It prevents all mentioned concurrency side effects, but can lead to the lowest concurrent access rate because it executes concurrent calls sequentially.
In other words, concurrent execution of a group of serializable transactions has the same result as executing them in serial.
Question 4:
Correct Answer:
✅ A) /off
Complete List of Actuator Endpoints
Common Endpoints:
- /health → Provides application health status.
- /info → Displays arbitrary application metadata.
- /metrics → Exposes runtime metrics (CPU, memory, etc.).
- /env → Shows all environment properties.
- /configprops → Lists
@ConfigurationProperties
beans. - /beans → Lists all Spring beans in the application.
- /mappings → Shows URL path mappings.
- /loggers → View/modify log levels dynamically.
- /threaddump → Displays a thread dump of the application.
- /heapdump → Generates a heap dump file.
- /scheduledtasks → Shows all scheduled tasks.
Security & Tracing:
- /auditevents → Shows security audit logs.
- /httptrace → Displays recent HTTP request traces.
- /trace → Provides request traces (deprecated).
- /caches → Lists cache configurations.
Management & Shutdown:
- /shutdown → Gracefully shuts down the application (disabled by default).
To enable all endpoints, use:
management.endpoints.web.exposure.include=*
Reference: Spring Boot Actuator Docs
Question 5
Correct Answer:
✅ A) Spring MVC supports a wide range of view technologies such as JSP, Thymeleaf, and Freemarker.
✅ B) Spring MVC follows the Model-View-Controller architectural pattern to separate concerns between the data model, presentation logic, and user interface.
Question 6
Correct Answer:
✅ C) application
Overall Explanation:
Spring provides several built-in bean scopes that define how and when beans are created in an application.
- application → The bean is shared across the entire ServletContext and is available for all requests and sessions.
- singleton → A single instance is created per Spring IoC container (default scope).
- prototype → A new instance is created every time the bean is requested.
- request → A new instance is created for each HTTP request. (Only valid in web applications.)
- session → A new instance is created per HTTP session. (Only valid in web applications.)
- websocket → A new instance is created per WebSocket session.
📌 Reference: Spring Bean Scopes Documentation
Question 7
Correct Answer:
✅ C) Principal
Overall Explanation:
In Spring Security, different terms describe authentication and access control:
- Principal → The user, device, or system performing an action.
- Authentication → Verifies if a principal’s credentials are valid.
- Authorization → Determines if a principal is allowed to access a secured resource.
- Authority → A permission or credential (e.g., a role like
"ROLE_ADMIN"
). - Secured Resource → A resource that is protected by security mechanisms.
Question 8:
Correct Answer
✅ A) The DataSource
interface is implemented by a driver vendor.
- JDBC driver vendors (like MySQL, PostgreSQL, and Oracle) provide implementations of the
DataSource
interface. These implementations allow applications to interact with databases in a standardized way.
✅ B) The DataSource
interface is intended for use with relational databases and is not suitable for NoSQL databases.
- The
DataSource
interface is specifically designed for relational databases and does not support NoSQL databases like MongoDB or Cassandra. NoSQL databases use their own APIs and drivers for data access.
Overall Explanation:
The DataSource
interface is part of javax.sql
and is used in JDBC (Java Database Connectivity) to manage connections to relational databases. It provides a standard way to obtain database connections without requiring applications to hardcode database connection details like URLs, usernames, or passwords.
Question 9:
Correct Answer:
✅ driver-class-name
is commonly NOT required to be specified.
- Reason: Spring Boot automatically detects the driver class from the database URL (
spring.datasource.url
). For most databases, you do not need to manually setdriver-class-name
.
Overall Explanation:
In Spring Boot, DataSource
configuration is typically done through external properties in application.properties
or application.yml
using spring.datasource.*
settings.
For example:
spring.datasource.url=jdbc:mysql://localhost/test
spring.datasource.username=dbuser
spring.datasource.password=dbpass
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
Question 10:
Correct Answer:
✅ D) SERIALIZABLE prevents phantom reads.
Reason:
Phantom reads occur when a transaction re-executes a query, and new rows appear because another transaction has inserted or deleted records in the meantime.
- READ_UNCOMMITTED & READ_COMMITTED: Do not prevent phantom reads.
- REPEATABLE_READ: Prevents non-repeatable reads but does not prevent phantom reads.
- SERIALIZABLE: Prevents phantom reads by applying range locks, blocking inserts and deletes within the transaction scope.