Spring Framework & Spring Boot Interview Questions & Answers — Cracked Java
Cracked Java console
0
S
Modules/Spring Framework & Spring Boot
// MODULE · 16 TOPICS · 142 QUESTIONS

Spring Framework & Spring Boot

Spring Core, Boot, Data, Security, and internals — from middle to senior interview depth.

0%
Reviewed
0 / 142
Topics done
0 / 16
Est. time left
~50h
Next up
IoC, Dependency Injection, ApplicationContext
16 topics · tap to expand
01

IoC, Dependency Injection, ApplicationContext

MidNot started

Inversion of Control and the three injection styles, BeanFactory vs ApplicationContext, the stereotype annotations, and what @Configuration actually does at runtime.

01What is Inversion of Control? What is Dependency Injection?Mid02Three types of DI: constructor, setter, field. Which is recommended and why?Mid03Difference between BeanFactory and ApplicationContext.Mid
02

Bean Scopes & Lifecycle

MidNot started
03

@Autowired, @Qualifier, @Primary, Injection Resolution

MidNot started

How @Autowired resolves dependencies, handling optional and ambiguous beans, collection injection, circular dependencies, and why ObjectProvider is the modern recommendation.

01How does @Autowired resolve dependencies? By type, by name, by qualifier.Mid02@Autowired(required = false) vs Optional<T> vs nullable injection.Mid03What happens if two beans of the same type exist?Mid
04

Spring Boot Auto-Configuration

MidNot started

How auto-configuration decides what to wire, decomposing @SpringBootApplication, properties vs YAML and override order, profiles, starters, and writing your own auto-config.

01What is auto-configuration? How does Spring Boot decide what to configure?Mid02What does @SpringBootApplication do? Decompose it.Mid03application.properties vs application.yml. Property hierarchy and override order.Mid
05

Spring MVC & REST

MidNot started

The DispatcherServlet request flow, controller annotations and argument binding, ResponseEntity, validation, exception handling, content negotiation, and interceptors vs filters.

01Walk through the request flow: DispatcherServlet → HandlerMapping → HandlerAdapter → controller → view/message converter → response.Mid02@RestController vs @Controller.Mid03@RequestMapping, @GetMapping, @PostMapping, etc.Mid
06

Spring Data JPA

MidNot started

JPA/Hibernate/Spring Data layering, repository hierarchy, derived and @Query methods, relationships and fetch types, the N+1 problem, the persistence context, and propagation.

01What is JPA? What is Hibernate? What is Spring Data JPA?Mid02JpaRepository vs CrudRepository vs PagingAndSortingRepository.Mid03Derived query methods: findByEmailAndStatus(...).Mid
07

Transactions Deep Dive

MidNot started

What @Transactional does and where to put it, propagation and isolation, the default rollback rule, the AOP-proxy implementation, the self-invocation trap, and TransactionTemplate.

01What does @Transactional do? Where do you put it?Mid02Propagation levels — explain each.Mid03Isolation levels — map to PostgreSQL behavior.Mid
08

Spring Security Basics

MidNot started

The SecurityFilterChain and lambda DSL, authentication vs authorization, the core abstractions, password encoders, method security, CSRF/CORS, and JWT/OAuth2 flows.

01What is the SecurityFilterChain? How is it built (modern lambda DSL)?Mid02Authentication vs authorization.Mid03UserDetailsService, UserDetails, Authentication, SecurityContext, SecurityContextHolder.Mid
09

AOP & Proxies

SeniorNot started

Cross-cutting concerns, Spring AOP vs AspectJ, JDK vs CGLIB proxies, pointcut and advice types, the full self-invocation mechanics, and the Spring features built on AOP.

01What is AOP? Cross-cutting concerns examples.Senior02Spring AOP vs AspectJ — what are the differences?Senior03JDK dynamic proxy vs CGLIB proxy — when does Spring use each?Senior
10

Spring Events

SeniorNot started

ApplicationEvent and @EventListener, sync vs async events, transactional event listeners and their phases, when to use events vs a message broker, and Spring Modulith.

01ApplicationEvent and ApplicationListener. What is @EventListener?Senior02Synchronous vs asynchronous events. @Async @EventListener.Senior03Transactional events: @TransactionalEventListener and phases.Senior
11

Caching

SeniorNot started

The caching annotations and how they compose, key generation, cache providers and their trade-offs, cache stampede, conditional caching, the self-invocation trap, and consistency strategies.

01@Cacheable, @CachePut, @CacheEvict, @Caching. How are they composed?Senior02Cache key generation — default key generator and custom KeyGenerator.Senior03Cache providers: Caffeine, Redis, Hazelcast, Ehcache. Trade-offs.Senior
12

Async, Scheduling, Virtual Threads

SeniorNot started

@Async and its executor, async return types, @Scheduled with fixedRate/fixedDelay/cron, distributed scheduling, virtual threads in Boot 3.2+, and when they help.

01@Async — how does it work? What is the default executor?Senior02Return types: void, Future<T>, CompletableFuture<T>.Senior03@EnableAsync — and the self-invocation problem again.Senior
13

Reactive — WebFlux, Reactor

SeniorNot started

The Reactive Streams contract, Mono and Flux, backpressure, hot vs cold publishers, the core operators, WebFlux vs MVC, reactive security, R2DBC, and the virtual-thread question.

01Reactive Streams specification — Publisher, Subscriber, Subscription, Processor.Senior02Mono<T> vs Flux<T>.Senior03Backpressure — what is it and how does Reactor handle it?Senior
14

Spring Boot Actuator, Observability

SeniorNot started
15

Testing — Unit, Slice, Integration

SeniorNot started

@SpringBootTest vs slice tests, the test clients, mocking beans, Testcontainers and @DynamicPropertySource, context caching, and the common causes of flaky Spring tests.

01@SpringBootTest — what does it do and when is it the right choice?Mid02Slice tests: @WebMvcTest, @DataJpaTest, @JsonTest, @RestClientTest. When to use each.Mid03MockMvc vs WebTestClient vs TestRestTemplate.Mid
16

Spring Boot 3 Features & Modern Stack

SeniorNot started

The Boot 3 baseline and jakarta namespace, GraalVM native images and AOT, Spring Modulith, Problem Details, HTTP Interface clients and RestClient, observability rework, and removed APIs.

01Spring Boot 3 baseline: Java 17+, Jakarta EE 9+ (javax.* → jakarta.*).Senior02Native image with GraalVM — what is AOT compilation? What are the limits?Senior03Spring Modulith — what problem does it solve between monolith and microservices?Senior