Home › Blog › Spring Boot interview questions

Spring Boot interview questions

Spring Boot interviews reward people who know what the framework is doing on their behalf. Most of the hard questions are really one question: this is a proxy, and here is what that implies.

Dependency injection and beans

The proxy question, which decides the loop

Spring wraps your beans in proxies to add behaviour. That single fact explains the most-asked gotchas:

If you remember one thing: self-invocation bypasses the proxy. Being able to explain *why* - the call never leaves the object, so nothing intercepts it - is what the question is for.

Auto-configuration and transactions

Data and testing

JPA questions centre on the N+1 problem - what causes it, how you detect it, and fetch strategies to fix it - plus lazy loading outside a transaction. Testing questions cover `@SpringBootTest` versus slice tests such as `@WebMvcTest`, and why loading the whole context for every test is slow. The database half overlaps with SQL interview questions.

How deep it goes by level

Whatever the level, the reliable way to prepare is to say your answers out loud rather than reading them. Most of what candidates lose in a Spring Boot interview is lost in the gap between knowing something and explaining it under observation - the method is in how to use AI for interview prep.

Where CoPilot Interview fits

Disclosure: we build an interview assistant, so treat this as a disclosed pitch. CoPilot Interview is a native Windows and macOS app that puts suggested answers on your own screen in about two seconds, across coding, system design and behavioral rounds, with a permanent free tier that needs no credit card.

Frequently asked questions

What are the most common Spring Boot interview questions?

Constructor versus field injection, bean scopes, how auto-configuration works, transaction propagation levels, the N+1 query problem, and above all why `@Transactional` fails on a self-invoked method.

Why does @Transactional not work on internal method calls?

Spring applies the annotation through a proxy that wraps the bean. When one method in a class calls another directly, the call never leaves the object, so the proxy is never involved and no transaction is started. The same limitation affects `@Cacheable` and `@Async`.

Does Spring roll back on checked exceptions?

Not by default - only unchecked exceptions and errors trigger rollback. To roll back on a checked exception you must declare it with `rollbackFor`. This default surprises candidates regularly and is a common interview check.

What is the N+1 problem in JPA?

Loading a collection of entities with one query, then issuing a further query per entity to load a lazy association - one query becomes N+1. It is usually fixed with a join fetch, an entity graph, or batch fetching, and detected by logging the generated SQL.

Walk into the round with a second pair of eyes

CoPilot Interview is a native Windows and macOS app that puts suggested answers on your own screen in about two seconds, across coding, system design and behavioral rounds. The free tier is permanent: 15 minutes a day, no credit card.

Try it free