Spring Boot interview questions
BetaBeans, auto-configuration, Spring MVC, Data JPA, security and testing.
Subtopics
- IoC container & bean scopes8
- Auto-configuration & starters6
- Spring MVC & REST controllers8
- Validation & exception handling6
- Spring Data JPA & repositories8
- Transactions & @Transactional6
- Lazy loading & N+16
- Spring Security & JWT8
- Configuration & profiles6
- Actuator & observability6
- Caching6
- Testing with Spring Boot Test6
Sample questions
- CodingJuniorActuator & observability
Model how
/actuator/healthcombines multiple health indicators into one overall status. ImplemententryPoint(Map<String, String> componentStatuses). Each entry maps a component name to its own status:"UP","DOWN", - TheoryJuniorActuator & observability
What does adding
spring-boot-starter-actuatorgive you out of the box, and why are most of its endpoints — besides/healthand/info— not exposed over HTTP by default? - CodingJuniorAuto-configuration & starters
Model a simplified
@ConditionalOnClass. ImplemententryPoint(Set<String> classpath, List<List<String>> candidates). Each entry incandidatesis a two-element list[beanName, requiredClassName], representing an auto-configuration that would - TheoryJuniorAuto-configuration & starters
In plain terms, what does
@SpringBootApplicationturn on, and what is a "starter" (likespring-boot-starter-web) actually made of? - CodingJuniorCaching
Model Spring's default cache key generation (
SimpleKeyGenerator). ImplemententryPoint(List<String> params), whereparamsare a method's arguments, already converted to strings, in parameter order. If there are no parameters, return"SimpleKey[]". If there - TheoryJuniorCaching
In one sentence each: what do
@Cacheable,@CachePut, and@CacheEvicteach actually do to the cache?