Spring Boot does a lot by magic, and candidates who don’t understand that magic get stuck fast. These questions probe how well they know what’s under the auto-configuration.
Hiring a Spring Boot developer is easy. Telling a real one from a convincing résumé is the hard part — and it’s most of what we do. These are grouped by level, because the same question that stretches a junior is a warm-up for a senior.
Junior Spring Boot interview questions
0–2 years
Core Spring concepts.
What is dependency injection and IoC in Spring?
The container creates and injects dependencies rather than objects creating their own, enabling loose coupling and testability.
News up dependencies instead of injecting them.
What is a Spring bean?
An object managed by the Spring container, created and wired according to configuration/annotations.
Cannot say what makes an object a bean.
What does Spring Boot auto-configuration do?
Configures sensible defaults based on the classpath and properties, reducing boilerplate.
Thinks it’s magic with no way to override.
What are the common stereotype annotations?
@Component, @Service, @Repository, @Controller mark beans by role.
Uses them interchangeably with no understanding.
What is the difference between @Controller and @RestController?
@RestController combines @Controller and @ResponseBody, returning data instead of views.
Adds @ResponseBody everywhere manually, confused why.
How does application.properties/YAML work?
Externalised configuration bound to beans, with profiles for per-environment values.
Hardcodes configuration in code.
What is a REST endpoint mapping?
@GetMapping/@PostMapping etc. map HTTP requests to handler methods.
Confuses HTTP verbs and their semantics.
What is the difference between JAR and WAR deployment?
Spring Boot favours executable JARs with an embedded server; WARs deploy to an external container.
Assumes an external app server is always required.
Mid-level Spring Boot interview questions
2–5 years
Data, transactions and scopes.
How do bean scopes work?
Singleton by default (one per container), plus prototype, request and session scopes; misusing them causes shared-state bugs.
Stores request state in a singleton bean.
How does @Transactional work?
It wraps a method in a transaction via a proxy; self-invocation bypasses the proxy so the annotation is ignored.
Puts @Transactional on a self-called or private method.
What is Spring Data JPA?
A repository abstraction generating queries from method names and reducing boilerplate over JPA/Hibernate.
Writes all DAO boilerplate by hand.
How do you avoid N+1 queries with JPA?
Fetch joins or entity graphs instead of lazy loading in a loop; be deliberate about fetch types.
Lazy-loads associations in a loop.
What is the difference between @Component scanning and explicit @Bean?
Component scanning auto-detects annotated classes; @Bean methods define beans explicitly, useful for third-party classes.
Cannot register a bean for a class it doesn’t own.
How does exception handling work in Spring MVC?
@ExceptionHandler and @ControllerAdvice centralise error handling into consistent responses.
Handles exceptions ad hoc in each controller.
What is dependency injection by constructor vs field?
Constructor injection is preferred for immutability, testability and clear required dependencies; field injection hides them.
Uses field injection everywhere.
How does validation work?
Bean Validation annotations (@Valid, @NotNull) validate request bodies automatically.
Validates manually and inconsistently.
Senior Spring Boot interview questions
5+ years
Performance, architecture and reliability.
How do you profile and tune a Spring Boot service?
Metrics via Actuator/Micrometer, JVM and GC profiling, connection-pool tuning, and fixing slow queries.
Guesses at bottlenecks without metrics.
How do you manage transactions across service boundaries?
Keep transactions local; across services use sagas or the outbox pattern rather than distributed transactions.
Tries to span a DB transaction across microservices.
How do you design resilient service-to-service calls?
Timeouts, retries with backoff, circuit breakers (Resilience4j) and bulkheads to contain failures.
Calls downstream services with no timeout.
How does Spring’s proxy-based AOP affect behaviour?
Aspects (transactions, caching, security) work via proxies, so self-invocation and final methods can bypass them.
Baffled why @Cacheable doesn’t fire on internal calls.
How do you structure a large Spring Boot application?
Layered or hexagonal architecture separating web, domain and persistence, with clear module boundaries.
Business logic in controllers, no layering.
How do you handle configuration and secrets across environments?
Profiles, externalised config and a secrets manager/vault rather than committed properties.
Commits environment secrets to the repo.
How do you tune JPA/Hibernate for performance?
Right fetch strategies, batch sizes, second-level cache where appropriate, DTO projections, and watching generated SQL.
Loads full entity graphs and ignores the SQL.
How do you make a Spring Boot app observable and production-ready?
Actuator health/metrics, structured logging, distributed tracing, and readiness/liveness probes.
Ships with no health checks or metrics.
Build and score a full interview with our free interview scorecard tool, browse the full question hub, or see how we interview engineers.