Spring Boot Interview Questions
Auto-configuration, IoC/DI, REST APIs, Spring Data JPA, Security, AOP, Transactions, and Testing.
Showing 1–20 of 100
#1What is auto-configuration in Spring Boot?
#2What is @SpringBootApplication and what does it do?
#3What is IoC (Inversion of Control) and Dependency Injection?
#4What is the difference between @Component, @Service, and @Repository?
#5What is the difference between @Controller and @RestController?
#6Explain @Transactional and its propagation levels.
#7How does Spring Boot handle exceptions globally?
#8What is Spring Boot Actuator?
#9What is the difference between @Bean and @Component?
#10Explain Spring Bean scopes.
#11What is Spring AOP and where is it used?
#12What is circular dependency and how do you fix it?
#13How do you configure Spring profiles?
#14How does Spring Security authentication work?
#15What is @Async in Spring Boot and how does it work?
#16What is Spring Data JPA and how does it simplify data access?
#17How does Spring Boot externalized configuration work?
#18What is Spring Cache Abstraction and how do you use it?
#19What are Spring Boot starters and why are they useful?
#20How do you write integration tests in Spring Boot?
Showing 1–20 of 100
Ask Aria about Spring Boot
Sign in to chat with Aria
All 100 Spring Boot questions at a glance
- What is auto-configuration in Spring Boot?(Medium)
- What is @SpringBootApplication and what does it do?(Easy)
- What is IoC (Inversion of Control) and Dependency Injection?(Easy)
- What is the difference between @Component, @Service, and @Repository?(Easy)
- What is the difference between @Controller and @RestController?(Easy)
- Explain @Transactional and its propagation levels.(Hard)
- How does Spring Boot handle exceptions globally?(Medium)
- What is Spring Boot Actuator?(Easy)
- What is the difference between @Bean and @Component?(Medium)
- Explain Spring Bean scopes.(Medium)
- What is Spring AOP and where is it used?(Hard)
- What is circular dependency and how do you fix it?(Hard)
- How do you configure Spring profiles?(Easy)
- How does Spring Security authentication work?(Hard)
- What is @Async in Spring Boot and how does it work?(Medium)
- What is Spring Data JPA and how does it simplify data access?(Medium)
- How does Spring Boot externalized configuration work?(Medium)
- What is Spring Cache Abstraction and how do you use it?(Medium)
- What are Spring Boot starters and why are they useful?(Easy)
- How do you write integration tests in Spring Boot?(Medium)
- What is the Spring ApplicationContext and how does it differ from BeanFactory?(Medium)
- What is a BeanPostProcessor and when would you use it?(Hard)
- What is the @PostConstruct and @PreDestroy lifecycle?(Medium)
- What is @Qualifier and when do you need it?(Medium)
- How does Spring Boot auto-configuration work under the hood?(Hard)
- What is @ConfigurationProperties and how does it differ from @Value?(Medium)
- What is Spring Boot's embedded server and how do you switch from Tomcat to Undertow?(Medium)
- What is Spring's @EventListener and ApplicationEvent?(Medium)
- What is @Conditional and how do you create custom conditions?(Hard)
- What is Spring Boot DevTools?(Easy)
- What is the difference between @RequestParam, @PathVariable, and @RequestBody?(Easy)
- How do you implement request validation in Spring Boot?(Medium)
- What is ResponseEntity and when should you use it?(Medium)
- What is content negotiation in Spring MVC?(Medium)
- How do you implement pagination and sorting in Spring Boot?(Medium)
- What is HATEOAS and does Spring Boot support it?(Hard)
- How do you version a REST API in Spring Boot?(Medium)
- What is the difference between findById() and getById() in Spring Data JPA?(Medium)
- What are JPA entity states (Transient, Managed, Detached, Removed)?(Hard)
- What is the difference between @OneToMany with fetch LAZY vs EAGER?(Medium)
- What is Hibernate first-level cache and second-level cache?(Hard)
- What is the Open Session in View (OSIV) pattern and why is it controversial?(Hard)
- What is a Spring Data JPA Specification and when would you use it?(Hard)
- What is CSRF and how does Spring Security handle it?(Medium)
- How do you implement JWT authentication in Spring Boot?(Hard)
- What is the difference between @Secured, @PreAuthorize, and @RolesAllowed?(Medium)
- What is CORS and how do you configure it in Spring Boot?(Medium)
- What is OAuth2 and how does Spring Security support it?(Hard)
- What is MockMvc and how do you use it?(Medium)
- What is @MockBean vs @Mock in Spring Boot tests?(Medium)
- What is @DataJpaTest and how does it differ from @SpringBootTest?(Medium)
- What is Testcontainers and how does it improve Spring Boot tests?(Medium)
- What is Micrometer and how does it integrate with Spring Boot Actuator?(Medium)
- How do you implement custom health indicators in Spring Boot?(Medium)
- How do you implement distributed tracing in Spring Boot?(Hard)
- What is graceful shutdown in Spring Boot and how do you configure it?(Medium)
- What is a Filter vs HandlerInterceptor in Spring Boot?(Hard)
- What is @ControllerAdvice and how does it work?(Medium)
- What is Spring WebFlux and how does it differ from Spring MVC?(Hard)
- What is Spring's @Scheduled and how do you configure it?(Medium)
- What happens during Spring Boot startup?(Hard)
- What is CommandLineRunner and ApplicationRunner?(Easy)
- What is Spring Boot's banner and how can you customize it?(Easy)
- What is Spring Boot's fat JAR and how is it structured?(Hard)
- What is Spring Retry and how do you use it?(Medium)
- What is Spring Integration vs Spring Batch?(Hard)
- What is @Transactional readOnly = true and what does it optimize?(Medium)
- What is the difference between Spring @Repository exception translation and JDBC exceptions?(Hard)
- How do you handle file uploads in Spring Boot?(Medium)
- What is the difference between @RequestMapping and specific mapping annotations?(Easy)
- What is Spring Cloud and its key components?(Hard)
- What is the difference between @Transactional on a class vs a method?(Medium)
- What is Spring Boot's connection pool? How do you tune HikariCP?(Medium)
- What is Spring Boot's auto-configuration for messaging (RabbitMQ / Kafka)?(Medium)
- What is Spring's @Lookup annotation?(Hard)
- What is Spring Security's method security and how is it different from URL security?(Hard)
- How does Spring Boot handle environment-specific properties?(Medium)
- What is the purpose of @EnableJpaAuditing?(Medium)
- How do you implement rate limiting in Spring Boot?(Hard)
- What is the difference between eager and lazy initialization in Spring Boot?(Medium)
- What is Spring Boot's support for caching with Redis?(Medium)
- What is Spring Boot's support for MongoDB?(Medium)
- What is @Transactional self-invocation problem and how do you fix it?(Hard)
- What is the difference between @Valid and @Validated in Spring?(Medium)
- What is Spring Boot's support for scheduled tasks with Quartz?(Hard)
- What is Spring Data REST and how does it differ from Spring MVC?(Medium)
- What is the difference between @Inject and @Autowired?(Easy)
- What is Flyway and how does it integrate with Spring Boot?(Medium)
- What is Spring Boot's support for WebSockets?(Hard)
- How do you implement a multi-tenant application in Spring Boot?(Hard)
- What are Spring Boot's management endpoints and how do you secure them?(Medium)
- What is Spring Boot's support for R2DBC (reactive database access)?(Hard)
- How do you implement idempotency in Spring Boot APIs?(Hard)
- What is Spring Boot's support for virtual threads (Java 21)?(Hard)
- What is Spring Boot's Docker image building support?(Medium)
- What is GraalVM native image and Spring Boot AOT support?(Hard)
- What is the difference between @SpringBootTest(webEnvironment) options?(Medium)
- What is Spring Boot's support for SSE (Server-Sent Events)?(Medium)
- What is Resilience4j and how does it integrate with Spring Boot?(Hard)
- What are best practices for Spring Boot application performance tuning?(Hard)