Spring Boot Interview Questions (2026): By Level, With Model Answers

How to use this

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?

What a strong answer covers

The container creates and injects dependencies rather than objects creating their own, enabling loose coupling and testability.

Red flag

News up dependencies instead of injecting them.

What is a Spring bean?

What a strong answer covers

An object managed by the Spring container, created and wired according to configuration/annotations.

Red flag

Cannot say what makes an object a bean.

What does Spring Boot auto-configuration do?

What a strong answer covers

Configures sensible defaults based on the classpath and properties, reducing boilerplate.

Red flag

Thinks it’s magic with no way to override.

What are the common stereotype annotations?

What a strong answer covers

@Component, @Service, @Repository, @Controller mark beans by role.

Red flag

Uses them interchangeably with no understanding.

What is the difference between @Controller and @RestController?

What a strong answer covers

@RestController combines @Controller and @ResponseBody, returning data instead of views.

Red flag

Adds @ResponseBody everywhere manually, confused why.

How does application.properties/YAML work?

What a strong answer covers

Externalised configuration bound to beans, with profiles for per-environment values.

Red flag

Hardcodes configuration in code.

What is a REST endpoint mapping?

What a strong answer covers

@GetMapping/@PostMapping etc. map HTTP requests to handler methods.

Red flag

Confuses HTTP verbs and their semantics.

What is the difference between JAR and WAR deployment?

What a strong answer covers

Spring Boot favours executable JARs with an embedded server; WARs deploy to an external container.

Red flag

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?

What a strong answer covers

Singleton by default (one per container), plus prototype, request and session scopes; misusing them causes shared-state bugs.

Red flag

Stores request state in a singleton bean.

How does @Transactional work?

What a strong answer covers

It wraps a method in a transaction via a proxy; self-invocation bypasses the proxy so the annotation is ignored.

Red flag

Puts @Transactional on a self-called or private method.

What is Spring Data JPA?

What a strong answer covers

A repository abstraction generating queries from method names and reducing boilerplate over JPA/Hibernate.

Red flag

Writes all DAO boilerplate by hand.

How do you avoid N+1 queries with JPA?

What a strong answer covers

Fetch joins or entity graphs instead of lazy loading in a loop; be deliberate about fetch types.

Red flag

Lazy-loads associations in a loop.

What is the difference between @Component scanning and explicit @Bean?

What a strong answer covers

Component scanning auto-detects annotated classes; @Bean methods define beans explicitly, useful for third-party classes.

Red flag

Cannot register a bean for a class it doesn’t own.

How does exception handling work in Spring MVC?

What a strong answer covers

@ExceptionHandler and @ControllerAdvice centralise error handling into consistent responses.

Red flag

Handles exceptions ad hoc in each controller.

What is dependency injection by constructor vs field?

What a strong answer covers

Constructor injection is preferred for immutability, testability and clear required dependencies; field injection hides them.

Red flag

Uses field injection everywhere.

How does validation work?

What a strong answer covers

Bean Validation annotations (@Valid, @NotNull) validate request bodies automatically.

Red flag

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?

What a strong answer covers

Metrics via Actuator/Micrometer, JVM and GC profiling, connection-pool tuning, and fixing slow queries.

Red flag

Guesses at bottlenecks without metrics.

How do you manage transactions across service boundaries?

What a strong answer covers

Keep transactions local; across services use sagas or the outbox pattern rather than distributed transactions.

Red flag

Tries to span a DB transaction across microservices.

How do you design resilient service-to-service calls?

What a strong answer covers

Timeouts, retries with backoff, circuit breakers (Resilience4j) and bulkheads to contain failures.

Red flag

Calls downstream services with no timeout.

How does Spring’s proxy-based AOP affect behaviour?

What a strong answer covers

Aspects (transactions, caching, security) work via proxies, so self-invocation and final methods can bypass them.

Red flag

Baffled why @Cacheable doesn’t fire on internal calls.

How do you structure a large Spring Boot application?

What a strong answer covers

Layered or hexagonal architecture separating web, domain and persistence, with clear module boundaries.

Red flag

Business logic in controllers, no layering.

How do you handle configuration and secrets across environments?

What a strong answer covers

Profiles, externalised config and a secrets manager/vault rather than committed properties.

Red flag

Commits environment secrets to the repo.

How do you tune JPA/Hibernate for performance?

What a strong answer covers

Right fetch strategies, batch sizes, second-level cache where appropriate, DTO projections, and watching generated SQL.

Red flag

Loads full entity graphs and ignores the SQL.

How do you make a Spring Boot app observable and production-ready?

What a strong answer covers

Actuator health/metrics, structured logging, distributed tracing, and readiness/liveness probes.

Red flag

Ships with no health checks or metrics.

Skip the screening entirely.We vet Spring Boot engineers so you don’t have to — embed one in your team, or have us build it.

Hire Spring Boot developersCompare us

Build and score a full interview with our free interview scorecard tool, browse the full question hub, or see how we interview engineers.

Share