All fields

“Services & Dependency Injection” in Information Technology

71 questions across 8 technologies.

Information Technology

71 questions in 8 technologies

#QuestionTechnologyTopicLevel
1What is dependency injection in Angular, and how does a component receive a service? Angular › Services & Dependency InjectionAngularServices & Dependency InjectionBeginner
2What is hierarchical dependency injection in Angular, and how does providing a service at the component level differ from providing it at the root level? Angular › Services & Dependency InjectionAngularServices & Dependency InjectionAdvanced
3How does the newer inject function differ from using constructor based dependency injection in Angular? Angular › Services & Dependency InjectionAngularServices & Dependency InjectionIntermediate
4What is a service in Angular and why are services used to hold shared logic? Angular › Services & Dependency InjectionAngularServices & Dependency InjectionBeginner
5How would you mock a service during testing to isolate a component from its real dependencies? Angular › Services & Dependency InjectionAngularServices & Dependency InjectionIntermediate
6How is dependency injection set up in MAUI? .NET MAUI › Dependency Injection & Services.NET MAUIDependency Injection & ServicesBeginner
7How is dependency injection set up in MAUI? .NET MAUI › Dependency Injection & Services.NET MAUIDependency Injection & ServicesBeginner
8How do you resolve services from a static or platform context where constructor injection isn't possible? .NET MAUI › Dependency Injection & Services.NET MAUIDependency Injection & ServicesAdvanced
9How do you resolve services from a static or platform context where constructor injection isn't possible? .NET MAUI › Dependency Injection & Services.NET MAUIDependency Injection & ServicesAdvanced
10What is dependency injection, and why is it a generally recommended practice for structuring a Flutter application's various services and repositories? Flutter › Dependency Injection in Flutter (GetIt & Service Locator)FlutterDependency Injection in Flutter (GetIt & Service Locator)Beginner
11What is a provider in Angular's dependency injection system? Angular › Dependency Injection Providers & Injection TokensAngularDependency Injection Providers & Injection TokensBeginner
12How 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
13What are the DI service lifetimes and when do you use each? .NET MAUI › Dependency Injection & Services.NET MAUIDependency Injection & ServicesBeginner
14What are the DI service lifetimes and when do you use each? .NET MAUI › Dependency Injection & Services.NET MAUIDependency Injection & ServicesBeginner
15How do you inject a view model into a page? .NET MAUI › Dependency Injection & Services.NET MAUIDependency Injection & ServicesIntermediate
16What is the service locator anti-pattern and how do you avoid it in MAUI? .NET MAUI › Dependency Injection & Services.NET MAUIDependency Injection & ServicesIntermediate
17How do you register and use HttpClient with IHttpClientFactory in MAUI? .NET MAUI › Dependency Injection & Services.NET MAUIDependency Injection & ServicesIntermediate
18How do you inject a view model into a page? .NET MAUI › Dependency Injection & Services.NET MAUIDependency Injection & ServicesIntermediate
19What is the service locator anti-pattern and how do you avoid it in MAUI? .NET MAUI › Dependency Injection & Services.NET MAUIDependency Injection & ServicesIntermediate
20How do you register and use HttpClient with IHttpClientFactory in MAUI? .NET MAUI › Dependency Injection & Services.NET MAUIDependency Injection & ServicesIntermediate
21How do you implement a messaging/event aggregator to decouple view models? .NET MAUI › Dependency Injection & Services.NET MAUIDependency Injection & ServicesAdvanced
22How do you implement a messaging/event aggregator to decouple view models? .NET MAUI › Dependency Injection & Services.NET MAUIDependency Injection & ServicesAdvanced
23How do you use IServiceScopeFactory to manually create a DI scope outside the normal per-request pipeline, such as inside a background service? ASP.NET Core › Dependency InjectionASP.NET CoreDependency InjectionIntermediate
24What is the 'captive dependency' problem, and how does the DI container help catch it? .NET › Dependency Injection.NETDependency InjectionAdvanced
25How do you use IServiceScopeFactory to manually create and manage a DI scope outside the normal request pipeline? .NET › Dependency Injection.NETDependency InjectionAdvanced
26What is the 'captive dependency' problem, and how does ASP.NET Core's DI container help catch it automatically? ASP.NET Core › Dependency InjectionASP.NET CoreDependency InjectionAdvanced
27How do you register a service using a factory delegate instead of a simple type mapping, when construction requires reading configuration or resolving other services conditionally? ASP.NET Core › Dependency InjectionASP.NET CoreDependency InjectionIntermediate
28What are keyed services (introduced in .NET 8), and what problem do they solve compared to multiple unnamed registrations? .NET › Dependency Injection.NETDependency InjectionAdvanced
29How does the DI container's disposal behavior work for IDisposable and IAsyncDisposable services across different lifetimes? .NET › Dependency Injection.NETDependency InjectionAdvanced
30What are keyed services (introduced in .NET 8), and what problem do they solve compared to injecting IEnumerable<T> when you need one specific implementation? ASP.NET Core › Dependency InjectionASP.NET CoreDependency InjectionAdvanced
31How does the DI container's disposal behavior work for IDisposable services registered as Transient, and why can this cause unexpected memory retention? ASP.NET Core › Dependency InjectionASP.NET CoreDependency InjectionAdvanced
32How does Laravel's service container and service providers work together to manage dependency injection and bootstrap an application's various services? PHP › Laravel Framework EssentialsPHPLaravel Framework EssentialsAdvanced
33What does providedIn root mean when registering an Angular service? Angular › Dependency Injection Providers & Injection TokensAngularDependency Injection Providers & Injection TokensBeginner
34What is the difference between providing a service using useClass and useExisting? Angular › Dependency Injection Providers & Injection TokensAngularDependency Injection Providers & Injection TokensIntermediate
35How does the useFactory provider option let you create a service with more complex setup logic? Angular › Dependency Injection Providers & Injection TokensAngularDependency Injection Providers & Injection TokensAdvanced
36How do you register and run multiple independent BackgroundServices within the same application? .NET › Background Services.NETBackground ServicesIntermediate
37How do you safely access scoped services like a DbContext from within a BackgroundService, which is registered as a singleton? ASP.NET Core › Background Tasks & Hosted ServicesASP.NET CoreBackground Tasks & Hosted ServicesIntermediate
38What is the difference between Singleton, Scoped, and Transient service lifetimes, and how does Scoped specifically map to an HTTP request? ASP.NET Core › Dependency InjectionASP.NET CoreDependency InjectionIntermediate
39How does the Options pattern's IOptions<T>/IOptionsSnapshot<T> relate to and build upon the standard DI container? ASP.NET Core › Dependency InjectionASP.NET CoreDependency InjectionIntermediate
40How do health checks interact with dependency injection scoping, particularly for checks that need a scoped service like a DbContext? ASP.NET Core › Health ChecksASP.NET CoreHealth ChecksIntermediate
41How do you safely access scoped services (like a DbContext) from within a BackgroundService, which itself is registered as a singleton? .NET › Background Services.NETBackground ServicesAdvanced
42What is the Options pattern's relationship to DI, and how does IOptions<T> itself get resolved through the container? .NET › Dependency Injection.NETDependency InjectionAdvanced
43How do you access the built IHost's service provider after Build() to resolve services outside the normal request/injection flow, such as in Program.cs itself? .NET › Generic Host.NETGeneric HostIntermediate
44What is a BackgroundService in ASP.NET Core, and how do you register one to run alongside a web application? ASP.NET Core › Background Tasks & Hosted ServicesASP.NET CoreBackground Tasks & Hosted ServicesBeginner
45How do you implement a gRPC server method in ASP.NET Core, and how does it integrate with the standard hosting model? .NET › gRPC Services.NETgRPC ServicesIntermediate
46What is the difference between IHostedService and the BackgroundService convenience base class? ASP.NET Core › Background Tasks & Hosted ServicesASP.NET CoreBackground Tasks & Hosted ServicesIntermediate
47How do you generate and use a strongly-typed gRPC client in a .NET application to call a gRPC service? ASP.NET Core › gRPC ServicesASP.NET CoregRPC ServicesIntermediate
48What is the single responsibility principle and how does it apply to writing Angular components and services? Angular › Angular Style Guide & Best PracticesAngularAngular Style Guide & Best PracticesIntermediate
49How do you test a BackgroundService's business logic without waiting for its actual polling interval, keeping tests fast? ASP.NET Core › Background Tasks & Hosted ServicesASP.NET CoreBackground Tasks & Hosted ServicesAdvanced
50How do you mock platform/device services for testing? .NET MAUI › Testing & Debugging.NET MAUITesting & DebuggingIntermediate
51How do you mock platform/device services for testing? .NET MAUI › Testing & Debugging.NET MAUITesting & DebuggingIntermediate
52What is the Options pattern, and why is it preferred over directly injecting IConfiguration into services? .NET › Configuration & Options.NETConfiguration & OptionsIntermediate
53How do you inject scoped (per-request) services into middleware, given that middleware classes are constructed once at app startup? .NET › ASP.NET Core Middleware & Request Pipeline.NETASP.NET Core Middleware & Request PipelineAdvanced
54How do you add a Material dialog to an Angular app? Angular › Angular Material & UI Component LibrariesAngularAngular Material & UI Component LibrariesBeginner
55How do you make a basic GET request to a server using Angular's HttpClient? Angular › HTTP Client & InterceptorsAngularHTTP Client & InterceptorsBeginner
56What are lifecycle hooks in Angular and why would you use them? Angular › Lifecycle HooksAngularLifecycle HooksBeginner
57What is a route guard in Angular, and what is it commonly used for? Angular › Router Guards & ResolversAngularRouter Guards & ResolversBeginner
58What is state management in an Angular app? Angular › State ManagementAngularState ManagementBeginner
59What is a common sign that an Angular app's state management approach needs to be reconsidered? Angular › State ManagementAngularState ManagementBeginner
60How would you generate a new component, service, or module using Angular CLI commands? Angular › Angular CLI & Project StructureAngularAngular CLI & Project StructureIntermediate
61How do you use the effect function with signals to run code whenever a signal's value changes? Angular › Angular SignalsAngularAngular SignalsIntermediate
62How would you manually trigger change detection in Angular when needed, such as after code that runs outside Angular's normal tracking? Angular › Change DetectionAngularChange DetectionIntermediate
63How would you create a custom attribute directive in Angular? Angular › DirectivesAngularDirectivesIntermediate
64What is an HTTP interceptor in Angular, and what is it commonly used for? Angular › HTTP Client & InterceptorsAngularHTTP Client & InterceptorsIntermediate
65What is the difference between a Subject, a BehaviorSubject, and a ReplaySubject in RxJS? Angular › RxJS & ObservablesAngularRxJS & ObservablesIntermediate
66How do you use Angular's TestBed to test a component that depends on a service? Angular › Testing with Jasmine & KarmaAngularTesting with Jasmine & KarmaIntermediate
67How would you define a strongly typed interface for data returned from an API, and use it throughout an Angular service? Angular › TypeScript with AngularAngularTypeScript with AngularIntermediate
68What is the difference between IOptions<T>, IOptionsSnapshot<T>, and IOptionsMonitor<T>? .NET › Configuration & Options.NETConfiguration & OptionsAdvanced
69What is the difference between IOptions<T>, IOptionsSnapshot<T>, and IOptionsMonitor<T>, and which is safe to inject into a singleton? ASP.NET Core › Configuration & Options PatternASP.NET CoreConfiguration & Options PatternAdvanced
70How would you combine multiple route guards together to enforce both authentication and a specific user role? Angular › Router Guards & ResolversAngularRouter Guards & ResolversAdvanced
71How would you test an Angular service that makes HTTP requests, without making real network calls during the test? Angular › Testing with Jasmine & KarmaAngularTesting with Jasmine & KarmaAdvanced