Spring Boot interview questions for 2026
Team InterviewPlan · November 3, 2026 · Updated November 3, 2026

Common Spring Boot interview questions cover how auto-configuration works, starters, dependency injection and bean scopes, profiles and configuration, Spring Data JPA and transactions, exception handling in REST APIs, Spring Security with JWT, Actuator, and microservice patterns. In 2026, expect questions on Spring Boot 3 or later, Java 17 or 21, and virtual threads.
Spring Boot is still the default choice for Java backend work in Indian IT, from service companies like TCS, Wipro and Infosys to fintech and SaaS product teams. That also means the interview questions have matured. "What is Spring Boot?" is a warm-up at best. Interviewers now want to know whether you understand what happens under the annotations.
This guide groups the questions you are most likely to face in 2026 by level, with short answers you can expand in your own words. For core Java, collections and multithreading, use our Java developer interview questions page alongside this one.
What has changed in Spring Boot interviews for 2026?
A few shifts show up again and again in recent rounds:
Spring Boot 3 is the baseline. It needs Java 17 or later and uses the jakarta namespace instead of javax. Many teams are also evaluating or moving to Spring Boot 4. Expect a question on migration pain points.
Virtual threads. With Java 21, Spring Boot can run request handling on virtual threads through a single property. Interviewers ask when that helps and when it does not.
Observability over logging. Micrometer, tracing and Actuator endpoints are now standard questions for experienced roles.
Less theory, more scenarios. "Your API is slow under load, what do you check?" has replaced many definition questions.
Which Spring Boot basics do interviewers still ask?
Even senior candidates get these in the first ten minutes. Answer crisply and move on.
Question | Short answer |
|---|---|
What does @SpringBootApplication do? | It combines @Configuration, @EnableAutoConfiguration and @ComponentScan on the main class. |
What is a starter? | A curated dependency bundle, such as spring-boot-starter-web, that brings compatible libraries and triggers matching auto-configuration. |
How is Spring Boot different from Spring? | Spring is the framework. Boot adds opinionated defaults, auto-configuration, embedded servers and production features so you write far less setup. |
What is an embedded server? | Tomcat, Jetty or Undertow packaged inside the JAR, so the app runs with java -jar without a separate server install. |
What are bean scopes? | Singleton by default, plus prototype, request, session and application in web apps. |
Constructor or field injection? | Constructor injection: it makes dependencies explicit, supports immutability and is easier to test. |
How does Spring Boot auto-configuration actually work?
This is the single most common deeper question, and a strong answer separates mid-level from junior candidates. Here is a version you can adapt:
When the app starts, @EnableAutoConfiguration tells Spring Boot to load a list of auto-configuration classes registered by the libraries on the classpath. Each class is guarded by conditions, like @ConditionalOnClass, @ConditionalOnMissingBean or @ConditionalOnProperty. So if a DataSource class is on the classpath and I have not defined my own DataSource bean, Boot creates one using my spring.datasource properties. If I define my own bean, Boot backs off. To see what was applied, I run the app with the debug flag and read the conditions report, or check the conditions endpoint in Actuator.
Follow-ups often include how to exclude an auto-configuration (the exclude attribute on @SpringBootApplication, or a property) and how you would write a custom starter for shared company code.
What Spring Data JPA and transaction questions should you expect?
Data access is where many real production bugs live, so interviewers dig in here.
What is the N+1 problem and how do you fix it? Loading a list of entities then lazily loading a relation for each one fires one extra query per row. Fix with fetch joins, entity graphs or batch fetching, and verify with SQL logging.
Lazy versus eager loading? Lazy loads related data only when accessed, eager loads it immediately. Default to lazy for collections and fetch what each use case needs.
How does @Transactional work? Spring wraps the bean in a proxy that opens and commits or rolls back a transaction around the method call.
Why does @Transactional sometimes not work? Self-invocation within the same class bypasses the proxy, private methods are not proxied, and checked exceptions do not trigger rollback by default.
What are propagation levels? REQUIRED joins an existing transaction or starts one. REQUIRES_NEW always starts a fresh one, useful for audit logs that must save even if the main work fails.
How do you handle optimistic locking? Add a @Version field. If two updates collide, the second fails with an exception you can catch and retry or report.
If you can describe a real time you fixed an N+1 query or a transaction bug, say so. A line like "in one service I cut a report endpoint from over a hundred queries to three with a fetch join" is worth more than any definition, as long as it is your own experience.
How should you answer REST API and security questions?
Exception handling and validation
Explain that you use @RestControllerAdvice with @ExceptionHandler methods to turn exceptions into consistent error responses, and Bean Validation annotations like @NotNull and @Size with @Valid on request bodies. Mention that Spring supports the standard problem details format for error bodies, which keeps APIs consistent across services.
Spring Security and JWT
Interviewers want the request flow, not just the dependency name. A request passes through the security filter chain. For token based APIs, a filter or the built-in resource server support validates the JWT signature and expiry, builds an authentication object and places it in the security context. Method level rules then use annotations like @PreAuthorize.
Be ready for: "Where would you store the signing key?" (a secrets manager, never the code), "How do you handle token expiry?" (short-lived access tokens plus refresh tokens) and "Why is CSRF often disabled for stateless APIs?" (no session cookie to forge, though it matters again if you use cookies).
Which microservices questions come up with Spring Boot?
For candidates with three or more years, expect at least one round on distributed systems. Our system design interview basics guide covers the wider design side. The Spring-specific questions usually include:
How services find each other: service discovery, or Kubernetes services and DNS in most modern setups.
How you centralise configuration: Spring Cloud Config, Kubernetes config maps or a cloud parameter store.
How you stop one failing service from taking down others: timeouts, retries with backoff, and circuit breakers using Resilience4j.
How you trace a request across services: Micrometer Tracing with a tracing backend, and correlation IDs in logs.
How you handle data consistency without distributed transactions: the saga pattern and the outbox pattern with Kafka or another broker.
How you check health in production: Actuator health, readiness and liveness endpoints wired to the orchestrator.
What scenario questions do experienced candidates get?
These have no single right answer. Talk through your diagnosis step by step.
Interviewer: Your Spring Boot API is fine in testing but slows down badly at peak traffic. What do you do? Candidate: First I would check metrics in Actuator and our monitoring: response times by endpoint, database connection pool usage and thread pool saturation. If the Hikari pool is exhausted, the problem is usually slow queries or connections held too long, so I would look at query logs and transaction boundaries. If threads are blocked on a slow downstream call, I would add timeouts and a circuit breaker, and consider virtual threads if the work is mostly waiting on I/O. Then I would load test the fix before releasing it.
Other favourites: "How would you migrate a Spring Boot 2 service to 3?", "How do you make a scheduled job safe when running three instances?" and "A bean is not being picked up. How do you debug it?" Practise each aloud for about two minutes.
For live coding rounds, our technical interview copilot page explains how candidates use on-screen prompts drawn from their own resume, within each employer's interview rules. The goal is to recall your real experience under pressure, not to read out answers you do not understand.
How should you prepare in the final week?
Build or revisit one small service end to end: REST endpoints, JPA, validation, security and Actuator.
Write down two production stories: a bug you fixed and a performance improvement you made.
Revise the questions in this guide until you can answer each in under two minutes.
Do at least one timed mock interview focused on Spring Boot and Java.
Read your own resume again. Every framework listed there is fair game.
And once you land the role, the learning continues. Java Job Support gives you AI plus expert help with tickets, code reviews and stand-ups in your first 90 days.
Want to rehearse these questions with instant feedback? Start free with InterviewPlan AI with 5 live minutes and 100 AI credits, no card needed, and run a Spring Boot mock interview today.
Frequently asked questions
Which Spring Boot version should I prepare for in 2026?
Prepare for Spring Boot 3 at minimum, with Java 17 or 21, since it is the baseline in most teams. Understand the jakarta namespace change and be aware of what newer versions, including Spring Boot 4, change. Interviewers often ask about migration from older Spring Boot 2 projects.
Are Spring Boot questions different for freshers and experienced candidates?
Yes. Freshers mostly get basics: starters, annotations, dependency injection, REST controllers and simple JPA. Candidates with three or more years get auto-configuration internals, transactions, security flows, microservice patterns and production scenarios like slow APIs or failing deployments.
Do I need to know Spring Cloud for Spring Boot interviews?
For microservice roles, you should know the patterns Spring Cloud addresses, such as configuration, discovery, resilience and gateways. Many teams now use Kubernetes features instead of some Spring Cloud modules, so explain the pattern first and the tool second.
What are virtual threads and should I mention them?
Virtual threads are lightweight threads in Java 21 that make blocking code scale better for I/O heavy workloads. Spring Boot can enable them with a single property. Mention them when discussing throughput, but also note they do not speed up CPU heavy work or fix slow queries.
How many Spring Boot questions are asked in a typical Java interview?
It varies by company, but in most Java backend rounds Spring Boot takes a large share of the technical discussion, alongside core Java, SQL and system design. Expect a mix of quick concept checks and at least one deeper scenario or project question.