Skip to content

Latest commit

 

History

History
38 lines (33 loc) · 2.33 KB

File metadata and controls

38 lines (33 loc) · 2.33 KB

🔹 Basic Dependency Injection Questions

* What is dependency injection in Spring Boot?
* How does Spring Boot implement inversion of control (IoC)?
* What are the main benefits of using dependency injection?
* What is the difference between field, constructor, and setter injection in Spring Boot?
* How do you annotate a class to be automatically discovered as a Spring bean?
* What is the difference between @Component, @Service, and @Repository?
* What is the purpose of @Autowired, and how does it work?
* What happens if Spring Boot finds multiple beans for the same dependency?
* How can you prioritize one bean over another when multiple beans of the same type exist?
* What is the use of @Primary in dependency injection?

🔹 Intermediate Dependency Injection Questions

* What is the difference between @Qualifier and @Primary?
* How do you define a custom bean using the @Bean annotation?
* What is the @Lazy annotation, and when would you use it?
* What are singleton and prototype bean scopes in Spring Boot?
* How can you inject a list of beans into a Spring Boot service?
* How does constructor injection improve testability compared to field injection?
* How do you disable auto-wiring for a specific field or method?
* How can you inject dependencies conditionally in Spring Boot?
* What is @Scope, and what are the different bean scopes available?
* How do you inject values from application.properties using @Value?

🔹 Advanced Dependency Injection Questions

* What is circular dependency, and how does Spring Boot handle it?
* How do you resolve a circular dependency in Spring Boot?
* What is ObjectProvider, and how does it help with dependency injection?
* How does Spring Boot handle dependency injection for external libraries that don’t have @Component annotations?
* What is the difference between Java-based and annotation-based configuration for DI?
* What is the @DependsOn annotation, and when would you use it?
* How does Spring Boot support constructor-based dependency injection for immutable objects?
* What is the role of ApplicationContext in dependency injection?
* How can you conditionally create a bean using @ConditionalOnProperty?
* How do you inject a bean dynamically at runtime based on a configuration value?