All fields

“Dependency Injection & IoC Principles” in Information Technology

17 questions across 2 technologies.

Information Technology

17 questions in 2 technologies

#QuestionTechnologyTopicLevel
1What is the Inversion of Control (IoC) principle, and how does dependency injection relate to it as one specific technique? C# › Dependency Injection & IoC PrinciplesC#Dependency Injection & IoC PrinciplesIntermediate
2What is dependency injection, and what problem does it solve compared to a class creating its own dependencies directly? C# › Dependency Injection & IoC PrinciplesC#Dependency Injection & IoC PrinciplesBeginner
3How do you register and resolve a service using ASP.NET Core's built-in dependency injection container? C# › Dependency Injection & IoC PrinciplesC#Dependency Injection & IoC PrinciplesBeginner
4How would you implement the Factory pattern using dependency injection to resolve a specific implementation at runtime based on a parameter, when the standard container can't decide statically? C# › Dependency Injection & IoC PrinciplesC#Dependency Injection & IoC PrinciplesAdvanced
5How does constructor injection differ from property (setter) injection, and why is constructor injection generally preferred? C# › Dependency Injection & IoC PrinciplesC#Dependency Injection & IoC PrinciplesIntermediate
6What causes a 'captive dependency' bug, and how does ASP.NET Core's DI container detect and prevent it? C# › Dependency Injection & IoC PrinciplesC#Dependency Injection & IoC PrinciplesAdvanced
7How do you correctly and safely resolve a Scoped service from within a Singleton service using IServiceScopeFactory, avoiding the captive dependency problem? C# › Dependency Injection & IoC PrinciplesC#Dependency Injection & IoC PrinciplesAdvanced
8How would you write a custom IServiceProviderFactory or use a third-party container (like Autofac) to enable advanced DI features not supported by the built-in ASP.NET Core container, like property injection or convention-based registration? C# › Dependency Injection & IoC PrinciplesC#Dependency Injection & IoC PrinciplesAdvanced
9What is the difference between Singleton, Scoped, and Transient service lifetimes in ASP.NET Core's DI container? C# › Dependency Injection & IoC PrinciplesC#Dependency Injection & IoC PrinciplesIntermediate
10How does the DI container resolve a class with MULTIPLE constructors, and how do you influence which one gets chosen? C# › Dependency Injection & IoC PrinciplesC#Dependency Injection & IoC PrinciplesAdvanced
11How does the .NET dependency injection container and ASP.NET Core's model binding use reflection and attributes together under the hood? C# › Attributes & ReflectionC#Attributes & ReflectionAdvanced
12How do C# 12 primary constructors interact with dependency injection in ASP.NET Core minimal APIs and controller classes? C# › Modern C# Features (Global Usings, File-Scoped Namespaces, Top-Level Statements)C#Modern C# Features (Global Usings, File-Scoped Namespaces, Top-Level Statements)Advanced
13How do you create a custom attribute class, and what does AttributeUsage control? C# › Attributes & ReflectionC#Attributes & ReflectionIntermediate
14How does the Repository pattern abstract data access, and what interface typically defines its contract? C# › Design Patterns in C#C#Design Patterns in C#Intermediate
15How is the Factory pattern commonly applied in Node.js applications, and what problem does it solve? Node.js › Architecture & Design PatternsNode.jsArchitecture & Design PatternsIntermediate
16How would you implement the Unit of Work pattern alongside the Repository pattern to coordinate multiple repository changes within a single transaction? C# › Design Patterns in C#C#Design Patterns in C#Advanced
17What is a Hexagonal Architecture (Ports and Adapters), and what specific benefit does it provide for a Node.js API? Node.js › Architecture & Design PatternsNode.jsArchitecture & Design PatternsAdvanced