Home/Interview Prep/Spring Boot

Spring Boot Interview Questions

Auto-configuration, IoC/DI, REST APIs, Spring Data JPA, Security, AOP, Transactions, and Testing.

IoC & DIREST APISecurityData JPATestingAria-powered explanations
0 / 100 answered
0%
13 Easy52 Medium35 Hard

Showing 120 of 100

#1What is auto-configuration in Spring Boot?

Medium
Core Concepts

#2What is @SpringBootApplication and what does it do?

Easy
Core Concepts

#3What is IoC (Inversion of Control) and Dependency Injection?

Easy
Core Concepts

#4What is the difference between @Component, @Service, and @Repository?

Easy
Core Concepts

#5What is the difference between @Controller and @RestController?

Easy
REST API

#6Explain @Transactional and its propagation levels.

Hard
Data Access

#7How does Spring Boot handle exceptions globally?

Medium
REST API

#8What is Spring Boot Actuator?

Easy
Production

#9What is the difference between @Bean and @Component?

Medium
Core Concepts

#10Explain Spring Bean scopes.

Medium
Core Concepts

#11What is Spring AOP and where is it used?

Hard
Advanced

#12What is circular dependency and how do you fix it?

Hard
Advanced

#13How do you configure Spring profiles?

Easy
Configuration

#14How does Spring Security authentication work?

Hard
Security

#15What is @Async in Spring Boot and how does it work?

Medium
Advanced

#16What is Spring Data JPA and how does it simplify data access?

Medium
Data Access

#17How does Spring Boot externalized configuration work?

Medium
Configuration

#18What is Spring Cache Abstraction and how do you use it?

Medium
Advanced

#19What are Spring Boot starters and why are they useful?

Easy
Core Concepts

#20How do you write integration tests in Spring Boot?

Medium
Testing

Showing 120 of 100

Ask Aria about Spring Boot

Sign in to chat with Aria

All 100 Spring Boot questions at a glance
  1. What is auto-configuration in Spring Boot?(Medium)
  2. What is @SpringBootApplication and what does it do?(Easy)
  3. What is IoC (Inversion of Control) and Dependency Injection?(Easy)
  4. What is the difference between @Component, @Service, and @Repository?(Easy)
  5. What is the difference between @Controller and @RestController?(Easy)
  6. Explain @Transactional and its propagation levels.(Hard)
  7. How does Spring Boot handle exceptions globally?(Medium)
  8. What is Spring Boot Actuator?(Easy)
  9. What is the difference between @Bean and @Component?(Medium)
  10. Explain Spring Bean scopes.(Medium)
  11. What is Spring AOP and where is it used?(Hard)
  12. What is circular dependency and how do you fix it?(Hard)
  13. How do you configure Spring profiles?(Easy)
  14. How does Spring Security authentication work?(Hard)
  15. What is @Async in Spring Boot and how does it work?(Medium)
  16. What is Spring Data JPA and how does it simplify data access?(Medium)
  17. How does Spring Boot externalized configuration work?(Medium)
  18. What is Spring Cache Abstraction and how do you use it?(Medium)
  19. What are Spring Boot starters and why are they useful?(Easy)
  20. How do you write integration tests in Spring Boot?(Medium)
  21. What is the Spring ApplicationContext and how does it differ from BeanFactory?(Medium)
  22. What is a BeanPostProcessor and when would you use it?(Hard)
  23. What is the @PostConstruct and @PreDestroy lifecycle?(Medium)
  24. What is @Qualifier and when do you need it?(Medium)
  25. How does Spring Boot auto-configuration work under the hood?(Hard)
  26. What is @ConfigurationProperties and how does it differ from @Value?(Medium)
  27. What is Spring Boot's embedded server and how do you switch from Tomcat to Undertow?(Medium)
  28. What is Spring's @EventListener and ApplicationEvent?(Medium)
  29. What is @Conditional and how do you create custom conditions?(Hard)
  30. What is Spring Boot DevTools?(Easy)
  31. What is the difference between @RequestParam, @PathVariable, and @RequestBody?(Easy)
  32. How do you implement request validation in Spring Boot?(Medium)
  33. What is ResponseEntity and when should you use it?(Medium)
  34. What is content negotiation in Spring MVC?(Medium)
  35. How do you implement pagination and sorting in Spring Boot?(Medium)
  36. What is HATEOAS and does Spring Boot support it?(Hard)
  37. How do you version a REST API in Spring Boot?(Medium)
  38. What is the difference between findById() and getById() in Spring Data JPA?(Medium)
  39. What are JPA entity states (Transient, Managed, Detached, Removed)?(Hard)
  40. What is the difference between @OneToMany with fetch LAZY vs EAGER?(Medium)
  41. What is Hibernate first-level cache and second-level cache?(Hard)
  42. What is the Open Session in View (OSIV) pattern and why is it controversial?(Hard)
  43. What is a Spring Data JPA Specification and when would you use it?(Hard)
  44. What is CSRF and how does Spring Security handle it?(Medium)
  45. How do you implement JWT authentication in Spring Boot?(Hard)
  46. What is the difference between @Secured, @PreAuthorize, and @RolesAllowed?(Medium)
  47. What is CORS and how do you configure it in Spring Boot?(Medium)
  48. What is OAuth2 and how does Spring Security support it?(Hard)
  49. What is MockMvc and how do you use it?(Medium)
  50. What is @MockBean vs @Mock in Spring Boot tests?(Medium)
  51. What is @DataJpaTest and how does it differ from @SpringBootTest?(Medium)
  52. What is Testcontainers and how does it improve Spring Boot tests?(Medium)
  53. What is Micrometer and how does it integrate with Spring Boot Actuator?(Medium)
  54. How do you implement custom health indicators in Spring Boot?(Medium)
  55. How do you implement distributed tracing in Spring Boot?(Hard)
  56. What is graceful shutdown in Spring Boot and how do you configure it?(Medium)
  57. What is a Filter vs HandlerInterceptor in Spring Boot?(Hard)
  58. What is @ControllerAdvice and how does it work?(Medium)
  59. What is Spring WebFlux and how does it differ from Spring MVC?(Hard)
  60. What is Spring's @Scheduled and how do you configure it?(Medium)
  61. What happens during Spring Boot startup?(Hard)
  62. What is CommandLineRunner and ApplicationRunner?(Easy)
  63. What is Spring Boot's banner and how can you customize it?(Easy)
  64. What is Spring Boot's fat JAR and how is it structured?(Hard)
  65. What is Spring Retry and how do you use it?(Medium)
  66. What is Spring Integration vs Spring Batch?(Hard)
  67. What is @Transactional readOnly = true and what does it optimize?(Medium)
  68. What is the difference between Spring @Repository exception translation and JDBC exceptions?(Hard)
  69. How do you handle file uploads in Spring Boot?(Medium)
  70. What is the difference between @RequestMapping and specific mapping annotations?(Easy)
  71. What is Spring Cloud and its key components?(Hard)
  72. What is the difference between @Transactional on a class vs a method?(Medium)
  73. What is Spring Boot's connection pool? How do you tune HikariCP?(Medium)
  74. What is Spring Boot's auto-configuration for messaging (RabbitMQ / Kafka)?(Medium)
  75. What is Spring's @Lookup annotation?(Hard)
  76. What is Spring Security's method security and how is it different from URL security?(Hard)
  77. How does Spring Boot handle environment-specific properties?(Medium)
  78. What is the purpose of @EnableJpaAuditing?(Medium)
  79. How do you implement rate limiting in Spring Boot?(Hard)
  80. What is the difference between eager and lazy initialization in Spring Boot?(Medium)
  81. What is Spring Boot's support for caching with Redis?(Medium)
  82. What is Spring Boot's support for MongoDB?(Medium)
  83. What is @Transactional self-invocation problem and how do you fix it?(Hard)
  84. What is the difference between @Valid and @Validated in Spring?(Medium)
  85. What is Spring Boot's support for scheduled tasks with Quartz?(Hard)
  86. What is Spring Data REST and how does it differ from Spring MVC?(Medium)
  87. What is the difference between @Inject and @Autowired?(Easy)
  88. What is Flyway and how does it integrate with Spring Boot?(Medium)
  89. What is Spring Boot's support for WebSockets?(Hard)
  90. How do you implement a multi-tenant application in Spring Boot?(Hard)
  91. What are Spring Boot's management endpoints and how do you secure them?(Medium)
  92. What is Spring Boot's support for R2DBC (reactive database access)?(Hard)
  93. How do you implement idempotency in Spring Boot APIs?(Hard)
  94. What is Spring Boot's support for virtual threads (Java 21)?(Hard)
  95. What is Spring Boot's Docker image building support?(Medium)
  96. What is GraalVM native image and Spring Boot AOT support?(Hard)
  97. What is the difference between @SpringBootTest(webEnvironment) options?(Medium)
  98. What is Spring Boot's support for SSE (Server-Sent Events)?(Medium)
  99. What is Resilience4j and how does it integrate with Spring Boot?(Hard)
  100. What are best practices for Spring Boot application performance tuning?(Hard)