1.
DI Fundamentals
- 2.
Explain the concept of Inversion of Control (IoC) and how it relates to Dependency Injection.
- 3.
What are the main advantages of using Dependency Injection in a software project?
- 4.
Describe the impact of Dependency Injection on the maintainability of code.
- 5.
Can you explain the Dependency Inversion Principle and how it differs from Dependency Injection?
Types of Dependency Injection
- 6.
Compare and contrast constructor injection versus setter injection.
- 7.
When would you use method injection instead of constructor injection?
- 8.
Can mixing different types of injection in the same class lead to issues? If so, what kind?
- 9.
Is there a preferred type of dependency injection when working with immutable objects? Please explain.
- 10.
How does each type of dependency injection affect the ease of unit testing?
DI Containers and Frameworks
- 11.
What is a Dependency Injection container and what are its responsibilities?
- 12.
Can you list some popular Dependency Injection frameworks and their distinctive features?
- 13.
What is the difference between a Dependency Injection container and a service locator?
- 14.
How do you configure dependencies within a DI container typically?
- 15.
Describe a situation where you should opt for a lightweight DI container over a full-fledged framework.
DI in Design Patterns
- 16.
How does Dependency Injection complement the Factory Design Pattern?
- 17.
What design pattern may be violated by improper use of Dependency Injection and why?
- 18.
Can you show how Dependency Injection can be used to implement a Singleton pattern properly?
DI and Unit Testing
- 19.
How does Dependency Injection improve the testability of a class?
- 20.
Explain how Dependency Injection facilitates the use of Mock objects in unit tests.
- 21.
Can you describe a scenario where Dependency Injection made unit testing more challenging?
Best Practices in DI
- 22.
What is constructor injection overuse, and why should it be avoided?
- 23.
Describe an anti-pattern in Dependency Injection and how to resolve it.
- 24.
What could be some potential pitfalls when using automatic wire-up features in DI frameworks?
- 25.
How should developers manage the lifetime of dependencies provided by DI containers?
Advanced Concepts in DI
- 26.
Explain the concept of Scoped Dependencies in Dependency Injection.
- 27.
How does a Dependency Injection framework typically resolve circular dependencies?
- 28.
What is meant by lazy loading of services in Dependency Injection and when is it useful?
Dependency Injection in Microservices
- 29.
How does Dependency Injection support the scalability of microservices?
- 30.
What role does a DI container play in orchestrating microservice dependencies?
- 31.
How do you manage cross-service dependencies in microservices architecture with DI?
DI in Specific Languages
- 32.
How is Dependency Injection implemented differently in statically-typed versus dynamically-typed languages?
- 33.
Explain the concept of property injection in C# and where is it most suitable to use?
- 34.
How do you perform dependency injection in a JavaScript application without a DI framework?
Real-world Scenarios and Use Cases
- 35.
Can you describe a real-world problem that you solved using Dependency Injection and how it benefited the project?