So, you’ve got a Spring Framework interview coming up, and you need to brush up on everything from dependency injection to Spring Security? Or maybe you’re a Scala developer who’s heard about Spring but never really dug into it? Welcome!
Let me be clear: this is a subjective list of Spring topics that I think matter for modern Java interviews. Not every company will care about every item here—some shops live and breathe Spring Boot, others still maintain legacy XML configurations. But if you can confidently discuss these topics and answer the questions I’ve included, you’ll walk into that interview ready to demonstrate real expertise.
This guide is organized into Basic, Medium, and Advanced sections. Each topic includes a summary of what you need to know, and links to detailed blog posts (coming soon!) where we’ll dive deep with code examples and best practices.
Basic Level - The Foundation
These are the core Spring concepts that every developer should know cold. If you’re shaky on these, it’ll show. Master these first!
1. Inversion of Control (IoC) and Dependency Injection
What It Is: The fundamental principle behind Spring—let the framework manage your object dependencies instead of creating them yourself. Spring’s IoC container creates and wires your beans together.
Read the full post: Inversion of Control and Dependency Injection in Spring
What You’ll Learn: How Spring’s IoC container works, the difference between constructor and setter injection, why constructor injection is preferred, and how to use @Autowired, @Component, and @Configuration annotations. You’ll see practical examples of avoiding tight coupling and making your code testable.
Interview Questions You Might Face:
- “Explain dependency injection. How does Spring implement it?”
- “What’s the difference between constructor injection and setter injection? Which should you prefer?”
- “How does Spring’s IoC container work? What’s the lifecycle of a bean?”
- “What are the different ways to configure beans in Spring?”
- “How would you inject a List or Map of beans of the same type?”
2. Spring Bean Scopes and Lifecycle
What It Is: Understanding how Spring creates, manages, and destroys beans. Scopes determine how many instances of a bean exist and when they’re created.
Read the full post: Spring Bean Scopes and Lifecycle Management
What You’ll Learn: The difference between singleton, prototype, request, session, and application scopes. You’ll learn about lifecycle callbacks (@PostConstruct, @PreDestroy), InitializingBean and DisposableBean interfaces, and how to properly manage resources in Spring beans.
Interview Questions You Might Face:
- “What are the different bean scopes in Spring? Explain each one.”
- “What’s the default bean scope in Spring?”
- “How do you execute code when a bean is created or destroyed?”
- “What happens when you inject a prototype bean into a singleton? How do you handle this correctly?”
- “Explain the complete lifecycle of a Spring bean from creation to destruction.”
3. Spring Configuration: Annotations vs XML
What It Is: How to configure Spring applications using modern annotation-based configuration (@Configuration, @Bean) versus legacy XML configuration.
Read the full post: Spring Configuration Approaches: From XML to Java Config
What You’ll Learn: How to create beans using @Configuration and @Bean, component scanning with @ComponentScan, profile-specific configurations with @Profile, and when XML configuration might still be relevant. You’ll see how to mix different configuration approaches in the same application.
Interview Questions You Might Face:
- “What’s the difference between
@Componentand@Bean?” - “How do you create a configuration class in Spring? Walk me through an example.”
- “What is component scanning and how do you configure it?”
- “When would you use XML configuration over annotation-based configuration?”
- “How do you activate different configurations for different environments?”
4. Spring Boot Basics and Auto-Configuration
What It Is: Spring Boot takes the pain out of Spring configuration by providing sensible defaults and auto-configuration. It’s the modern way to build Spring applications.
Read the full post: Getting Started with Spring Boot and Auto-Configuration
What You’ll Learn: How Spring Boot auto-configuration works, what @SpringBootApplication does under the hood, how to customize auto-configuration, working with application.properties and application.yml, and how to create a production-ready Spring Boot application from scratch.
Interview Questions You Might Face:
- “What is Spring Boot and how does it differ from Spring Framework?”
- “Explain auto-configuration. How does Spring Boot know what beans to create?”
- “What does
@SpringBootApplicationdo? What annotations does it combine?” - “How do you exclude certain auto-configuration classes?”
- “How do you configure different properties for different environments in Spring Boot?”
5. Spring MVC and RESTful Web Services
What It Is: Building web applications and REST APIs with Spring MVC. This is the bread and butter of most Spring interviews.
Read the full post: Building RESTful APIs with Spring MVC
What You’ll Learn: How to create REST controllers with @RestController, handle HTTP methods with @GetMapping, @PostMapping, etc., request and response handling, path variables and request parameters, exception handling with @ExceptionHandler, and proper HTTP status codes.
Interview Questions You Might Face:
- “What’s the difference between
@Controllerand@RestController?” - “How do you handle path variables and query parameters?”
- “Explain request mapping annotations. What’s the difference between
@RequestMappingand@GetMapping?” - “How do you handle exceptions in Spring MVC? What’s
@ControllerAdvice?” - “How do you validate request bodies in Spring? What role does
@Validplay?”
Medium Level - Where It Gets Interesting
You know the basics. Now let’s talk about the features that show you’ve built real applications with Spring.
1. Spring Data JPA and Database Access
What It Is: Spring Data JPA simplifies database access by eliminating boilerplate code. Define repository interfaces and Spring generates the implementations.
Read the full post: Mastering Spring Data JPA for Database Access
What You’ll Learn: How to create repository interfaces, use query methods with naming conventions, write custom queries with @Query, implement pagination and sorting, use specifications for dynamic queries, and understand the N+1 query problem and how to avoid it with fetch joins.
Interview Questions You Might Face:
- “What is Spring Data JPA? How does it differ from plain JPA?”
- “Explain how query methods work. How does Spring know what query to generate from a method name?”
- “What’s the difference between
findById()andgetById()?” - “How do you handle pagination in Spring Data JPA?”
- “What’s the N+1 problem and how do you solve it?”
- “When would you use
@Queryinstead of query methods?”
2. Spring Transaction Management
What It Is: Managing database transactions declaratively using Spring’s @Transactional annotation. Understanding transaction propagation and isolation levels.
Read the full post: Spring Transaction Management Deep Dive
What You’ll Learn: How @Transactional works, transaction propagation levels (REQUIRED, REQUIRES_NEW, etc.), isolation levels, rollback rules for checked and unchecked exceptions, transaction boundaries and proxy limitations, and best practices for transaction management in service layers.
Interview Questions You Might Face:
- “Explain how
@Transactionalworks. What happens under the hood?” - “What are the different transaction propagation types? Give examples of when to use each.”
- “What’s the difference between isolation levels? When would you use SERIALIZABLE?”
- “By default, which exceptions trigger a rollback in Spring transactions?”
- “Why doesn’t
@Transactionalwork when called from within the same class?” - “How do you configure read-only transactions and why would you?”
3. Spring Security Fundamentals
What It Is: Securing your Spring applications with authentication and authorization. Spring Security is the de facto standard for Java application security.
Read the full post: Spring Security Fundamentals: Authentication and Authorization
What You’ll Learn: How Spring Security’s filter chain works, implementing authentication with username/password, authorization with role-based access control, securing REST endpoints with method security, JWT token authentication, and password encoding with BCrypt.
Interview Questions You Might Face:
- “How does Spring Security work? Explain the filter chain.”
- “What’s the difference between authentication and authorization?”
- “How do you secure specific endpoints in a Spring Boot application?”
- “Explain method-level security. What’s the difference between
@PreAuthorizeand@PostAuthorize?” - “How do you implement JWT authentication in Spring Security?”
- “Why should you never store passwords in plain text? How does BCrypt work?”
4. Spring AOP (Aspect-Oriented Programming)
What It Is: Cross-cutting concerns like logging, security, and transaction management handled elegantly using aspects rather than scattered throughout your code.
Read the full post: Spring AOP: Handling Cross-Cutting Concerns
What You’ll Learn: What aspects, join points, pointcuts, and advice are, how to create aspects with @Aspect and @Around, @Before, @After annotations, writing pointcut expressions, using AOP for logging and performance monitoring, and understanding Spring AOP vs AspectJ.
Interview Questions You Might Face:
- “What is Aspect-Oriented Programming? Why would you use it?”
- “Explain the key AOP concepts: aspect, join point, pointcut, advice.”
- “What’s the difference between
@Before,@After, and@Aroundadvice?” - “How do you write a pointcut expression to match all service methods?”
- “What’s the difference between Spring AOP and AspectJ?”
- “Give me a real-world example where you’d use AOP.”
5. Spring Boot Actuator and Production Readiness
What It Is: Monitor and manage your Spring Boot applications in production with built-in endpoints for health checks, metrics, and diagnostics.
Read the full post: Production-Ready Spring Boot with Actuator
What You’ll Learn: Enabling and configuring Actuator endpoints, health checks and custom health indicators, metrics with Micrometer, exposing endpoints securely, integrating with monitoring systems like Prometheus and Grafana, and best practices for production deployments.
Interview Questions You Might Face:
- “What is Spring Boot Actuator and why is it useful?”
- “How do you enable Actuator endpoints? Which endpoints are enabled by default?”
- “How would you create a custom health indicator?”
- “How do you secure Actuator endpoints in production?”
- “Explain how to expose metrics to Prometheus.”
- “What information does the
/infoendpoint provide and how do you customize it?”
Advanced Level - Spring Expert Territory
This is where you prove you’re not just using Spring, but mastering it. These topics show you understand the framework deeply and can handle complex scenarios.
1. Spring Boot Externalized Configuration and Profiles
What It Is: Managing configuration across different environments (dev, test, prod) using externalized configuration sources and profiles without code changes.
Read the full post: Advanced Spring Boot Configuration and Profile Management
What You’ll Learn: Configuration precedence in Spring Boot (property files, environment variables, command-line args), profile-specific configuration files, using @ConfigurationProperties for type-safe configuration, Spring Cloud Config for centralized configuration, encrypting sensitive properties, and reloading configuration without restarts.
Interview Questions You Might Face:
- “What’s the order of precedence for configuration sources in Spring Boot?”
- “How do you activate different profiles? Can you have multiple active profiles?”
- “What’s the difference between
@Valueand@ConfigurationProperties?” - “How do you externalize configuration for microservices? What’s Spring Cloud Config?”
- “How would you encrypt database passwords in configuration files?”
- “Explain how to reload configuration dynamically without restarting the application.”
2. Spring WebFlux and Reactive Programming
What It Is: Building non-blocking, reactive applications with Spring WebFlux using Project Reactor. This is essential for high-throughput, low-latency systems.
Read the full post: Reactive Programming with Spring WebFlux
What You’ll Learn: The difference between blocking and non-blocking I/O, Mono and Flux types from Project Reactor, creating reactive REST APIs, handling backpressure, reactive database access with R2DBC, error handling in reactive streams, and when to choose WebFlux over traditional Spring MVC.
Interview Questions You Might Face:
- “What is Spring WebFlux and when should you use it?”
- “Explain the difference between Mono and Flux.”
- “How does reactive programming differ from traditional imperative programming?”
- “What is backpressure and how does Spring WebFlux handle it?”
- “How do you access databases reactively? What’s R2DBC?”
- “When should you NOT use reactive programming?”
- “How do virtual threads (Java 21) affect the choice between MVC and WebFlux?”
3. Spring Cloud for Microservices
What It Is: Building distributed systems and microservices architectures with Spring Cloud components like service discovery, configuration management, and circuit breakers.
Read the full post: Building Microservices with Spring Cloud
What You’ll Learn: Service discovery with Eureka or Consul, client-side load balancing with Spring Cloud LoadBalancer, declarative REST clients with Feign, circuit breakers with Resilience4j, distributed tracing with Zipkin, and API gateway patterns with Spring Cloud Gateway.
Interview Questions You Might Face:
- “What is Spring Cloud? What problems does it solve in microservices?”
- “Explain service discovery. How does Eureka work?”
- “What’s a circuit breaker and why do you need it? How does Resilience4j work?”
- “How do you handle distributed configuration in microservices?”
- “What’s the difference between client-side and server-side load balancing?”
- “How do you implement distributed tracing across microservices?”
- “Explain the API Gateway pattern. How does Spring Cloud Gateway work?”
4. Spring Integration and Messaging
What It Is: Enterprise integration patterns implemented in Spring, including message-driven architectures with Kafka, RabbitMQ, and other messaging systems.
Read the full post: Spring Integration and Messaging Patterns
What You’ll Learn: Spring Integration basics and enterprise integration patterns, messaging with Spring JMS and AMQP, working with Apache Kafka using Spring Kafka, message-driven POJOs with @JmsListener and @KafkaListener, implementing event-driven architectures, handling message ordering and exactly-once delivery, and error handling and retry strategies.
Interview Questions You Might Face:
- “What is Spring Integration? What are enterprise integration patterns?”
- “Explain the difference between JMS and AMQP.”
- “How do you consume messages from Kafka in Spring? What’s
@KafkaListener?” - “What’s the difference between queue and topic in messaging?”
- “How do you handle message processing failures? Explain retry and dead letter queue patterns.”
- “What’s idempotency and why does it matter in message processing?”
- “How would you implement event sourcing with Spring and Kafka?”
5. Spring Native and GraalVM
What It Is: Compiling Spring Boot applications to native executables using GraalVM for faster startup times and lower memory footprint—critical for serverless and containerized deployments.
Read the full post: Spring Native and GraalVM: Next-Generation Performance
What You’ll Learn: What GraalVM native images are and their benefits, building Spring Boot native applications with Spring Native, AOT (Ahead-of-Time) compilation vs JIT compilation, limitations of native images (reflection, dynamic proxies), configuring reachability metadata, performance characteristics and trade-offs, and use cases for native images (AWS Lambda, Kubernetes, edge computing).
Interview Questions You Might Face:
- “What is GraalVM and how does it differ from standard JVM?”
- “What are the benefits of native images? What are the trade-offs?”
- “How do you build a Spring Boot application as a native image?”
- “Why do native images have restrictions around reflection? How do you handle it?”
- “What’s the difference between AOT and JIT compilation?”
- “When would you choose native images over traditional JVM deployment?”
- “How do startup time and memory usage compare between JVM and native images?”
Your Study Plan
Here’s how I’d approach this preparation:
Week 1-2: Core Spring Fundamentals
Master the Basic topics. Even if you’ve used Spring before, make sure you deeply understand IoC, bean lifecycles, and configuration. These are the foundation everything else builds on.
Week 3-4: Data and Security
Work through the Medium topics, focusing on Spring Data JPA, transactions, and Spring Security. These are the most common areas where interviews get technical.
Week 5-6: Modern Spring Features
Tackle the remaining Medium topics (AOP, Actuator) and start on Advanced topics. Spring Boot Actuator is quick to learn but impressive in interviews.
Week 7-8: Advanced & Specialized Topics
Dive into reactive programming, Spring Cloud, or Spring Native depending on the role you’re targeting. Not every interview will cover these, but they’re powerful differentiators.
Week 9: Integration & Practice
Build a small project that uses multiple Spring features together. Practice explaining your design decisions. Mock interviews help tremendously.
Additional Resources
- Spring Framework Documentation - The official reference
- Spring Boot Documentation - Comprehensive Boot guide
- Spring Guides - Step-by-step tutorials
- Baeldung Spring Tutorials - In-depth articles
- Spring Blog - Latest updates and best practices
- This Repository’s Code Examples - Runnable Spring examples
Final Thoughts
Spring Framework interviews can feel overwhelming because Spring is such a vast ecosystem. You don’t need to know everything—but you do need to show depth in the areas that matter for the role.
Focus on understanding why Spring does things the way it does. Why dependency injection? Why declarative transactions? Why reactive programming? When you understand the reasoning, you can apply the patterns to new situations, which is what senior developers do.
The interviewers aren’t looking for someone who’s memorized the documentation. They want someone who can solve real problems with Spring, who understands the trade-offs, and who can explain their thinking clearly.
Work through these topics systematically, build something real, and you’ll walk into that interview confident and prepared.
Good luck! You’ve got this. 🚀
P.S. - Found this guide helpful? Have suggestions for additional topics? Open an issue on the GitHub repo. This is a living document, and I’d love to make it better with your input.