🍃 Section 5 · 29 questions
Spring Spring Boot
29 interview questions and answers in the Spring Spring Boot section.
Questions in this section
- What is Dependency Injection
- Difference between constructor, setter and field injection
- Which injection type is recommended and why
- What is a Bean in Spring
- How to create a Bean in Spring
- What is Bean Lifecycle
- What are the Bean Lifecycle stages
- What is BeanPostProcessor
- What do PostConstruct and PreDestroy methods do
- What is Bean scope
- What scopes exist in Spring
- Difference between singleton and prototype scope
- What is a proxy in Spring
- When does Spring create a proxy
- What is AOP Aspect-Oriented Programming
- What is aspect advice pointcut join point
- What does the Transactional annotation do
- Why Transactional does not work with self-invocation
- How to solve the self-invocation problem
- What is auto-configuration in Spring Boot
- How SpringBootApplication works
- What is a starter in Spring Boot
- What does the ComponentScan annotation do
- What is a Configuration class
- Difference between Component Service Repository Controller
- What does the Autowired annotation do
- What to do if there are multiple beans of the same type
- What is Qualifier
- What are profiles in Spring
Study navigator
A structured compilation of 29 core questions designed to prepare software engineers for Junior 🟢, Middle 🟡, and Senior 🔴 Spring & Spring Boot technical interviews.
📋 All Questions
🗺️ Topic Dependency Map
┌──────────────────────────────────────────┐
│ DI & IOC FOUNDATIONS (01-03) │
│ 01. Dependency Injection │
│ 02. Constructor vs Setter vs Field │
│ 03. Injection Best Practices │
└──────────────────┬───────────────────────┘
│
┌──────────────────────────┼──────────────────────────┐
▼ ▼ ▼
┌───────────────┐ ┌───────────────┐ ┌────────────────────┐
│ BEAN CONCEPT │ │ BEAN LIFECYCLE│ │ BEAN SCOPES │
│ (04-05) │ │ (06-09) │ │ (10-12) │
│ 04. Bean │ │ 06. Lifecycle │ │ 10. Scope concept │
│ 05. Creation │ │ 07. 12 steps │ │ 11. Scope types │
│ │ │ 08. BPP │ │ 12. Singleton vs │
│ │ │ 09. @PostCon/ │ │ Prototype │
│ │ │ @PreDest │ │ │
└───────┬───────┘ └───────┬───────┘ └────────┬───────────┘
│ │ │
└────────────────────────┼────────────────────────┘
▼
┌──────────────────────────────────────────┐
│ DYNAMIC PROXY & AOP (13-19) │
│ 13. Dynamic Proxies (CGLIB / JDK) │
│ 14. When Spring Creates Proxies │
│ 15. AOP Fundamentals │
│ 16. Advice, Pointcut, JoinPoint │
│ 17. @Transactional Internals │
│ 18-19. Self-Invocation Problem & Fixes │
└──────────────────────────────────────────┘
│
┌────────────────────────┼────────────────────────┐
▼ ▼ ▼
┌───────────────┐ ┌───────────────┐ ┌────────────────────┐
│ SPRING BOOT │ │ CONFIG & SCAN │ │ STEREOTYPES & DI │
│ (20-22) │ │ (23-24) │ │ (25-29) │
│ 20. Auto-conf │ │ 23. @CompScan │ │ 25. Stereotypes │
│ 21. @BootApp │ │ 24. @Config │ │ 26. @Autowired │
│ 22. Starters │ │ Full/Lite │ │ 27. Multiple Beans │
│ │ │ │ │ 28. @Qualifier │
│ │ │ │ │ 29. Spring Profiles│
└───────────────┘ └───────────────┘ └────────────────────┘
🎯 Recommended Study Tracks
🟢 Junior Level Track (Core Fundamentals)
- DI & Injection: Q01, Q02, Q03 (Inversion of Control, constructor vs field injection).
- Bean Basics: Q04, Q05 (
@Component,@Bean,ApplicationContext). - Scopes & Stereotypes: Q10, Q12, Q25, Q26 (Singleton vs Prototype,
@Service,@Repository,@Autowired). - Spring Boot Starters: Q20, Q22 (Autoconfiguration concepts, starter BOMs).
🟡 Middle Level Track (Internals & Production Mechanics)
- Lifecycle & Hooks: Q06, Q07, Q08, Q09 (
BeanPostProcessor,@PostConstruct,@PreDestroy). - Web Scopes: Q11 (
request,session,applicationscoped proxies). - Proxy Engine: Q13, Q14 (CGLIB subclassing vs JDK dynamic interface proxies).
- Transactions & Self-Invocation: Q17, Q18, Q19 (
@Transactionalrollback rules, proxy bypassing, 4 solutions). - Boot Composition: Q21, Q27, Q28, Q29 (
@SpringBootApplication,@Primary,@Qualifier,@Profile).
🔴 Senior Level Track (Architecture & Deep Internals)
- AOP Weaving & Interception: Q15, Q16 (Spring AOP runtime proxying vs AspectJ compile-time weaving).
- Autoconfiguration Engine: Q20, Q23 (
@ConditionalOn*,AutoConfiguration.importsvsspring.factories). - Configuration Modes: Q24 (
@Configuration(proxyBeanMethods = true)Full CGLIB mode vs Lite mode). - Circular Dependency Engine: Q07 (3-level cache:
singletonObjects,earlySingletonObjects,singletonFactories).
🔗 Cross-Section Links
- Section 2: Design Patterns — Dependency Injection, Proxy, Decorator
- Section 11: Transactions — ACID, Propagation, Isolation levels
- Section 16: Hibernate JPA —
@Repository, Open Session in View, L2 Cache