# Spring Boot Interview Questions

> Dependency injection, auto-configuration, REST controllers, JPA and N+1, @Transactional pitfalls, security, and testing.

Canonical: https://www.internhack.in/learn/interview/spring-boot-interview
Last updated: 2026-11-28

Dependency injection, auto-configuration, REST controllers, JPA and N+1, @Transactional pitfalls, security, and testing.

## 30 questions in this section

- [Spring vs Spring Boot: What Problem Does Boot Solve?](https://www.internhack.in/learn/interview/spring-boot-interview/spring-vs-spring-boot) (Beginner)
- [Inversion of Control and Dependency Injection Explained](https://www.internhack.in/learn/interview/spring-boot-interview/spring-ioc-dependency-injection) (Beginner)
- [Constructor vs Setter vs Field Injection](https://www.internhack.in/learn/interview/spring-boot-interview/spring-injection-types-constructor-preferred) (Beginner)
- [ApplicationContext vs BeanFactory](https://www.internhack.in/learn/interview/spring-boot-interview/spring-applicationcontext-vs-beanfactory) (Intermediate)
- [Spring Bean Scopes and the Singleton Trap](https://www.internhack.in/learn/interview/spring-boot-interview/spring-bean-scopes) (Beginner)
- [Spring Bean Lifecycle Step by Step](https://www.internhack.in/learn/interview/spring-boot-interview/spring-bean-lifecycle) (Intermediate)
- [@Component, @Service, @Repository and @Controller](https://www.internhack.in/learn/interview/spring-boot-interview/spring-stereotype-annotations) (Beginner)
- [@Autowired, @Qualifier and @Primary](https://www.internhack.in/learn/interview/spring-boot-interview/spring-autowired-qualifier-primary) (Beginner)
- [How @SpringBootApplication and Auto-Configuration Work](https://www.internhack.in/learn/interview/spring-boot-interview/spring-boot-autoconfiguration-springbootapplication) (Advanced)
- [Spring Boot Starters and Dependency Management](https://www.internhack.in/learn/interview/spring-boot-interview/spring-boot-starters) (Beginner)
- [application.properties, YAML and Profiles](https://www.internhack.in/learn/interview/spring-boot-interview/spring-properties-yaml-profiles) (Beginner)
- [@RestController vs @Controller](https://www.internhack.in/learn/interview/spring-boot-interview/spring-restcontroller-vs-controller) (Beginner)
- [@PathVariable vs @RequestParam vs @RequestBody](https://www.internhack.in/learn/interview/spring-boot-interview/spring-request-mapping-pathvariable-requestparam-requestbody) (Intermediate)
- [Bean Validation with @Valid and @Validated](https://www.internhack.in/learn/interview/spring-boot-interview/spring-validation-valid) (Intermediate)
- [Global Exception Handling with @ControllerAdvice](https://www.internhack.in/learn/interview/spring-boot-interview/spring-controlleradvice-global-exception-handling) (Intermediate)
- [ResponseEntity and Correct HTTP Status Codes](https://www.internhack.in/learn/interview/spring-boot-interview/spring-responseentity) (Intermediate)
- [Spring Data JPA: Repositories, Derived Queries and @Query](https://www.internhack.in/learn/interview/spring-boot-interview/spring-data-jpa-repositories-queries) (Intermediate)
- [JPA Relationships and the N+1 Query Problem](https://www.internhack.in/learn/interview/spring-boot-interview/spring-jpa-relationships-n-plus-one) (Advanced)
- [Lazy vs Eager Fetching and LazyInitializationException](https://www.internhack.in/learn/interview/spring-boot-interview/spring-jpa-lazy-vs-eager-fetching) (Intermediate)
- [@Transactional: Propagation, Rollback Rules and Self-Invocation](https://www.internhack.in/learn/interview/spring-boot-interview/spring-transactional-pitfalls) (Advanced)
- [Hibernate First-Level and Second-Level Cache](https://www.internhack.in/learn/interview/spring-boot-interview/spring-hibernate-caching) (Advanced)
- [Spring Security Filter Chain and JWT Authentication Flow](https://www.internhack.in/learn/interview/spring-boot-interview/spring-security-filter-chain-jwt) (Advanced)
- [Password Encoding with BCrypt in Spring Security](https://www.internhack.in/learn/interview/spring-boot-interview/spring-security-password-encoding) (Intermediate)
- [Spring Boot Actuator for Production Monitoring](https://www.internhack.in/learn/interview/spring-boot-interview/spring-boot-actuator) (Intermediate)
- [Spring AOP: Aspects, Advice and Proxies](https://www.internhack.in/learn/interview/spring-boot-interview/spring-aop-basics) (Advanced)
- [Microservices with Spring Cloud: Service Discovery and API Gateway](https://www.internhack.in/learn/interview/spring-boot-interview/spring-cloud-discovery-gateway) (Intermediate)
- [Circuit Breaker and Resilience4j](https://www.internhack.in/learn/interview/spring-boot-interview/spring-circuit-breaker-resilience4j) (Advanced)
- [Testing: @SpringBootTest vs @WebMvcTest vs @DataJpaTest](https://www.internhack.in/learn/interview/spring-boot-interview/spring-testing-slices) (Intermediate)
- [Testing Controllers with MockMvc and Mockito](https://www.internhack.in/learn/interview/spring-boot-interview/spring-mockito-mockmvc-testing) (Intermediate)
- [Circular Dependencies in Spring and How to Fix Them](https://www.internhack.in/learn/interview/spring-boot-interview/spring-circular-dependencies) (Advanced)

## Related

- [Learn](https://www.internhack.in/learn)
- [Interview Prep](https://www.internhack.in/learn/interview)
