Spring Boot Cheat Sheet 2026
The 30 highest-yield Spring Boot facts, distilled from real exam questions. Print it, save it as a PDF, or study it here — free, no sign-up.
60 questions
130 min time limit
76.00% to pass
- What does the `@Cacheable` annotation do when applied to a Spring service method? → Caches the method return value using the method arguments as the key
- Which annotation triggers Bean Validation on a method parameter in a Spring MVC controller? → @Valid
- What HTTP status code should a well-designed REST API return when a request body fails Bean Validation? → 400 Bad Request
- What annotation is used to designate a method as a Kafka message consumer in Spring Boot? → @KafkaListener
- A developer needs to create a new instance of a `ShoppingCart` bean every time a user starts a new HTTP session. Which bean scope should be used? → session
- A table's primary key must be annotated. → @Id
- In spring boot, what is the default HTML template engine? → Thymeleaf
- What Spring Boot caching annotation would you use to conditionally cache results based on a SpEL expression? → @Cacheable with the `condition` attribute
- What is the default `CacheManager` Spring Boot auto-configures when no cache provider dependency is on the classpath? → ConcurrentMapCacheManager
- Which of the following is the recommended `PasswordEncoder` implementation in modern Spring Security for securely hashing and storing user passwords? → `BCryptPasswordEncoder`
- How can you suppress the stack trace from appearing in Spring Boot's /error JSON response in production? → Set server.error.include-stacktrace=never in application.properties
- In Spring Boot's Kafka auto-configuration, what property sets the address of the Kafka broker? → spring.kafka.bootstrap-servers
- What exactly is an ORM? → Object Relational Mapper
- Which Spring AMQP class is used to declare and bind a RabbitMQ queue to an exchange programmatically? → RabbitAdmin
- Which Spring Boot property enables the inclusion of binding errors in the /error response body for validation failures? → server.error.include-binding-errors=always
- When validation fails on a @PathVariable or @RequestParam (not @RequestBody), which exception is thrown? → ConstraintViolationException
- Which Spring Boot property sets the default Time-To-Live for entries in a Redis cache? → spring.cache.redis.time-to-live
- What property in `application.properties` switches the Spring Boot web application type to reactive? → spring.main.web-application-type=reactive
- Which Reactor operator blocks the reactive pipeline until the Mono or Flux completes, returning the result synchronously? → block()
- Maven utilizes which of the following? → pom.xml
- What is the most recent Spring Boot version? → Spring Boot 2.5.0
- In spring boot, which of the following can be used to manage dependencies? → Gradle
- Which annotation enables Spring's annotation-driven caching infrastructure in a Spring Boot application? → @EnableCaching
- What are the many types of IDEs that may be used for Spring Boot development? → All the Above
- What is the reactive equivalent of Spring MVC's RestTemplate in Spring WebFlux? → WebClient
- What is the purpose of the @ResponseStatus annotation when placed on a custom exception class? → It maps the exception to a specific HTTP status code returned when the exception is thrown
- How do you enable reactive repository support for MongoDB in Spring Boot? → Add spring-boot-starter-data-mongodb-reactive
- What does the `@EnableWebFlux` annotation do when added to a configuration class? → Imports the WebFlux configuration from DelegatingWebFluxConfiguration
- In Spring WebFlux, what is the purpose of `WebTestClient`? → A tool for testing reactive WebFlux controllers and endpoints
- What is the best way to include a dependency in a project? → Add dependency inside pom.xml file
Turn these facts into recall: