Spring Boot is the default framework for Java backend roles, and its interviews test the Spring core (inversion of control, dependency injection), how auto-configuration works, building REST APIs, and data access with JPA. Here are the Spring Boot interview questions that actually get asked, with answers. (See also our Java guide.)
Spring core & DI
- What is inversion of control and dependency injection?
- The Spring IoC container and the bean lifecycle.
- @Component vs @Service vs @Repository vs @Controller.
- Constructor vs field vs setter injection — which is preferred and why?
- Bean scopes — singleton vs prototype.
Spring Boot specifics
- What does auto-configuration do, and how?
- What is @SpringBootApplication composed of?
- Spring Boot starters; application.properties / yml.
- What are Spring profiles?
REST, JPA & security
- Building a REST controller — @RestController, @GetMapping, @RequestBody.
- Exception handling — @ControllerAdvice and @ExceptionHandler.
- Spring Data JPA — repositories, entities, relationships.
- Spring Security basics — authentication vs authorization, JWT.
How to prepare
Spring rounds probe the "how" behind the magic. Practise explaining DI, auto-configuration, and request flow out loud. Greenroom runs spoken technical interviews that follow up on your reasoning. Pair it with our Java and backend guides.
Frequently asked questions
What are the most common Spring Boot interview questions?
Common Spring Boot questions cover inversion of control and dependency injection, the IoC container and bean lifecycle, stereotype annotations (@Component, @Service, @Repository, @Controller), injection types and bean scopes, auto-configuration, @SpringBootApplication, starters and profiles, building REST controllers, exception handling with @ControllerAdvice, Spring Data JPA, and Spring Security basics.
What is dependency injection in Spring?
Dependency injection is a form of inversion of control where the Spring IoC container creates objects (beans) and supplies their dependencies rather than the objects constructing them. You declare dependencies and Spring wires them in, typically via constructor injection (the preferred approach). This improves testability, loose coupling and modularity across your application.
What is auto-configuration in Spring Boot?
Auto-configuration automatically configures your Spring application based on the dependencies on the classpath and sensible defaults, removing most manual XML or Java configuration. For example, adding a database starter triggers automatic DataSource and JPA setup. It's driven by conditional annotations, and you can override or exclude specific auto-configurations when you need custom behavior.
How should I prepare for a Spring Boot interview?
Focus on the Spring container — inversion of control, dependency injection, the bean lifecycle — and how auto-configuration, REST controllers and JPA work, rather than memorizing annotations in isolation. Practise explaining how a request flows through controllers and services out loud with a voice-based mock interview that follows up, since Spring rounds probe the 'how' behind the framework.