All fields

“ASP.NET Core Middleware & Request Pipeline” in Information Technology

80 questions across 4 technologies.

Information Technology

80 questions in 4 technologies

#QuestionTechnologyTopicLevel
1What is middleware in ASP.NET Core, and how does it form the request pipeline? .NET › ASP.NET Core Middleware & Request Pipeline.NETASP.NET Core Middleware & Request PipelineBeginner
2What is middleware in ASP.NET Core, and how does the order in which it's registered affect request handling? .NET › ASP.NET Core Middleware & Request Pipeline.NETASP.NET Core Middleware & Request PipelineIntermediate
3How do you register built-in middleware for serving static files in an ASP.NET Core application? .NET › ASP.NET Core Middleware & Request Pipeline.NETASP.NET Core Middleware & Request PipelineBeginner
4What is the recommended standard order for common middleware in a typical ASP.NET Core Web API pipeline, and why? .NET › ASP.NET Core Middleware & Request Pipeline.NETASP.NET Core Middleware & Request PipelineAdvanced
5Why does the order in which middleware is registered matter so much in ASP.NET Core? .NET › ASP.NET Core Middleware & Request Pipeline.NETASP.NET Core Middleware & Request PipelineIntermediate
6What's the difference between app.Use, app.Run, and app.Map in configuring the middleware pipeline? .NET › ASP.NET Core Middleware & Request Pipeline.NETASP.NET Core Middleware & Request PipelineIntermediate
7How 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
8How do you conditionally apply middleware only to certain requests using UseWhen or MapWhen? .NET › ASP.NET Core Middleware & Request Pipeline.NETASP.NET Core Middleware & Request PipelineIntermediate
9How does the HttpContext object serve as the shared state carrier through the middleware pipeline? .NET › ASP.NET Core Middleware & Request Pipeline.NETASP.NET Core Middleware & Request PipelineIntermediate
10What are Minimal APIs in ASP.NET Core, and when would you choose them over traditional MVC controllers? .NET › ASP.NET Core Middleware & Request Pipeline.NETASP.NET Core Middleware & Request PipelineIntermediate
11How does UseRouting and endpoint routing (via MapControllers, MapGet, etc.) fit into the middleware pipeline conceptually? .NET › ASP.NET Core Middleware & Request Pipeline.NETASP.NET Core Middleware & Request PipelineAdvanced
12How does the middleware pipeline interact with asynchronous streaming responses, and what precautions are needed? .NET › ASP.NET Core Middleware & Request Pipeline.NETASP.NET Core Middleware & Request PipelineAdvanced
13How does short-circuiting work in middleware, and when would you deliberately not call next()? .NET › ASP.NET Core Middleware & Request Pipeline.NETASP.NET Core Middleware & Request PipelineIntermediate
14What is the purpose of UseExceptionHandler and UseDeveloperExceptionPage middleware, and how should they differ between environments? .NET › ASP.NET Core Middleware & Request Pipeline.NETASP.NET Core Middleware & Request PipelineIntermediate
15How do you write a custom middleware component as a reusable class instead of an inline lambda? .NET › ASP.NET Core Middleware & Request Pipeline.NETASP.NET Core Middleware & Request PipelineIntermediate
16How do minimal API endpoint filters (IEndpointFilter) compare to traditional middleware for cross-cutting logic? .NET › ASP.NET Core Middleware & Request Pipeline.NETASP.NET Core Middleware & Request PipelineAdvanced
17Why is it dangerous to capture and store an HttpContext reference in a singleton-scoped service, and what should you use instead? .NET › ASP.NET Core Middleware & Request Pipeline.NETASP.NET Core Middleware & Request PipelineAdvanced
18How does Blazor integrate with ASP.NET Core's hosting model, and what are the two primary interactive render modes? ASP.NET Core › Blazor Integration with ASP.NET CoreASP.NET CoreBlazor Integration with ASP.NET CoreBeginner
19What is the purpose of global exception handling middleware in an ASP.NET Core application? .NET › Global Exception Handling & Middleware.NETGlobal Exception Handling & MiddlewareBeginner
20What happens by default in ASP.NET Core if you don't configure any global exception handling middleware at all? .NET › Global Exception Handling & Middleware.NETGlobal Exception Handling & MiddlewareBeginner
21What is the purpose of global exception handling middleware in an ASP.NET Core application? ASP.NET Core › Error HandlingASP.NET CoreError HandlingBeginner
22What are MVC filters in ASP.NET Core, and what are the main filter types in the pipeline (authorization, resource, action, exception, result)? ASP.NET Core › FiltersASP.NET CoreFiltersBeginner
23Why must UseCors be positioned after UseRouting but before UseAuthorization in the ASP.NET Core middleware pipeline? .NET › CORS & Cross-Origin Resource Sharing.NETCORS & Cross-Origin Resource SharingIntermediate
24What happens by default in ASP.NET Core if you don't configure any global exception handling middleware at all? ASP.NET Core › Error HandlingASP.NET CoreError HandlingIntermediate
25What are gRPC interceptors, and how do they compare to ASP.NET Core middleware or MVC filters for implementing cross-cutting concerns? ASP.NET Core › gRPC ServicesASP.NET CoregRPC ServicesAdvanced
26How does prerendering work when a Blazor component is embedded within a traditional Razor Pages or MVC view, and what is the purpose of Component Tag Helpers? ASP.NET Core › Blazor Integration with ASP.NET CoreASP.NET CoreBlazor Integration with ASP.NET CoreAdvanced
27How would you configure and use output caching or response caching for the static, non-interactive portions of a Blazor application? ASP.NET Core › Blazor Integration with ASP.NET CoreASP.NET CoreBlazor Integration with ASP.NET CoreAdvanced
28What is authentication in ASP.NET Core, and how does the framework represent an authenticated user? ASP.NET Core › AuthenticationASP.NET CoreAuthenticationBeginner
29What is CORS, and why does an ASP.NET Core API need to explicitly configure it for browser-based clients on a different origin? ASP.NET Core › CORS (Cross-Origin Resource Sharing)ASP.NET CoreCORS (Cross-Origin Resource Sharing)Beginner
30What is response caching middleware in ASP.NET Core, and how does it differ from application-level data caching? .NET › Caching (In-Memory, Distributed & Redis).NETCaching (In-Memory, Distributed & Redis)Intermediate
31How do you configure a CORS policy in ASP.NET Core to allow requests from specific origins? .NET › CORS & Cross-Origin Resource Sharing.NETCORS & Cross-Origin Resource SharingIntermediate
32What is the purpose of the authentication middleware's position in the pipeline, and why must UseAuthentication come before UseAuthorization? ASP.NET Core › AuthenticationASP.NET CoreAuthenticationIntermediate
33Where must UseCors be positioned in the middleware pipeline relative to UseRouting and UseAuthorization, and why does this order matter? ASP.NET Core › CORS (Cross-Origin Resource Sharing)ASP.NET CoreCORS (Cross-Origin Resource Sharing)Intermediate
34How would you use the Chain of Responsibility pattern to implement a request-processing pipeline (such as middleware-style validation/authentication/logging), and how does this relate conceptually to servlet filters or web framework middleware? Java › Design Patterns in JavaJavaDesign Patterns in JavaAdvanced
35How do you handle exceptions specifically within minimal API endpoints, given they don't use the traditional MVC exception filter pipeline? .NET › Global Exception Handling & Middleware.NETGlobal Exception Handling & MiddlewareIntermediate
36What are Filters in ASP.NET Core MVC? .NET Core › MVC Filters.NET CoreMVC FiltersIntermediate
37What is the difference between authentication and authorization in ASP.NET Core? .NET › Authentication & Authorization (Identity, JWT, OAuth).NETAuthentication & Authorization (Identity, JWT, OAuth)Beginner
38What is dependency injection, and how does ASP.NET Core's built-in DI container support it? .NET › Dependency Injection.NETDependency InjectionBeginner
39What are the main strategies for versioning an ASP.NET Core API (URL, query string, header, media type)? .NET › API Versioning.NETAPI VersioningIntermediate
40How do you implement URL-based API versioning using the Asp.Versioning.Mvc package in ASP.NET Core? .NET › API Versioning.NETAPI VersioningIntermediate
41How does JWT (JSON Web Token) authentication work at a high level in ASP.NET Core? .NET › Authentication & Authorization (Identity, JWT, OAuth).NETAuthentication & Authorization (Identity, JWT, OAuth)Intermediate
42How 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
43How does the newer Output Caching middleware (introduced in .NET 7) differ from Response Caching middleware? ASP.NET Core › CachingASP.NET CoreCachingIntermediate
44What is endpoint metadata, and how do attributes like [Authorize] and custom metadata attach to a specific route for later inspection by middleware? ASP.NET Core › Endpoint Metadata, Route Constraints & TemplatesASP.NET CoreEndpoint Metadata, Route Constraints & TemplatesIntermediate
45What is an IResourceFilter, and how does its position in the pipeline (before model binding) make it useful for short-circuiting expensive work? ASP.NET Core › FiltersASP.NET CoreFiltersIntermediate
46How would you exclude health check endpoints from other cross-cutting middleware like authentication, logging, or rate limiting that shouldn't apply to frequent automated health polling? ASP.NET Core › Health ChecksASP.NET CoreHealth ChecksIntermediate
47How does ASP.NET Core support multiple authentication schemes simultaneously (e.g., cookies for a web UI and JWT for an API in the same application)? .NET › Authentication & Authorization (Identity, JWT, OAuth).NETAuthentication & Authorization (Identity, JWT, OAuth)Advanced
48How does gRPC support interceptors for cross-cutting concerns like authentication, logging, and retries, similar to middleware in a REST pipeline? .NET › gRPC Services.NETgRPC ServicesAdvanced
49What is response caching middleware, and how does it differ from application-level data caching? ASP.NET Core › CachingASP.NET CoreCachingAdvanced
50What is a CORS preflight request, and when does the browser automatically send one before the actual request? ASP.NET Core › CORS (Cross-Origin Resource Sharing)ASP.NET CoreCORS (Cross-Origin Resource Sharing)Advanced
51How does IExceptionFilter differ from global exception handling middleware, and when would you choose one over the other? ASP.NET Core › FiltersASP.NET CoreFiltersAdvanced
52What is the difference between SaveChanges() and SaveChangesAsync(), and why does it matter for a web application's scalability? .NET › Entity Framework Core & Data Access.NETEntity Framework Core & Data AccessIntermediate
53How do you handle exceptions that occur during response streaming, after the response has already partially started sending to the client? .NET › Global Exception Handling & Middleware.NETGlobal Exception Handling & MiddlewareAdvanced
54How do you configure a .NET application inside a container to listen on the correct port, and what does ASPNETCORE_URLS control? .NET › Docker & Containerization.NETDocker & ContainerizationIntermediate
55How do you apply a global authorization policy requiring authentication by default for every endpoint, with explicit opt-out for public ones? ASP.NET Core › AuthorizationASP.NET CoreAuthorizationIntermediate
56What is the purpose of the [AllowAnonymous] attribute, and how does it interact with a controller-level [Authorize] attribute? ASP.NET Core › AuthorizationASP.NET CoreAuthorizationIntermediate
57What is the risk of caching sensitive or user-specific data with an incorrectly scoped cache key, and how do you prevent cross-user data leakage? ASP.NET Core › CachingASP.NET CoreCachingIntermediate
58How would you troubleshoot a CORS error in browser developer tools, and what's the most common root cause? ASP.NET Core › CORS (Cross-Origin Resource Sharing)ASP.NET CoreCORS (Cross-Origin Resource Sharing)Intermediate
59How can filters access route values, query string parameters, or the raw HttpContext during execution? ASP.NET Core › FiltersASP.NET CoreFiltersIntermediate
60What are common patterns for implementing a producer-consumer background processing pipeline using Channel<T> with a BackgroundService? .NET › Background Services.NETBackground ServicesAdvanced
61What is a CORS preflight request, and when does the browser send one automatically? .NET › CORS & Cross-Origin Resource Sharing.NETCORS & Cross-Origin Resource SharingAdvanced
62How would you cache the results of an expensive, paginated database query while correctly handling different page/filter parameter combinations? ASP.NET Core › CachingASP.NET CoreCachingAdvanced
63What is Blazor, and what are the two primary hosting models (Server and WebAssembly)? .NET › Blazor (Server & WebAssembly).NETBlazor (Server & WebAssembly)Beginner
64What is CORS, and why do browsers enforce it? .NET › CORS & Cross-Origin Resource Sharing.NETCORS & Cross-Origin Resource SharingBeginner
65What is gRPC, and how does it differ from a traditional REST/JSON API? .NET › gRPC Services.NETgRPC ServicesBeginner
66How do you version an API's OpenAPI/Swagger documentation to show separate docs per version? .NET › API Versioning.NETAPI VersioningIntermediate
67How do you call JavaScript from C# code in Blazor (JS interop), and when is it necessary? .NET › Blazor (Server & WebAssembly).NETBlazor (Server & WebAssembly)Intermediate
68How does Blazor handle routing, and what does the @page directive do? .NET › Blazor (Server & WebAssembly).NETBlazor (Server & WebAssembly)Intermediate
69What HTTP caching headers (Cache-Control, ETag) can a client and CDN use, and how do they relate to server-side caching strategies? .NET › Caching (In-Memory, Distributed & Redis).NETCaching (In-Memory, Distributed & Redis)Intermediate
70What are the risks of caching sensitive or user-specific data, and how do you avoid cache poisoning across users? .NET › Caching (In-Memory, Distributed & Redis).NETCaching (In-Memory, Distributed & Redis)Intermediate
71How do you troubleshoot a CORS error reported in browser developer tools, and what does the error message typically indicate? .NET › CORS & Cross-Origin Resource Sharing.NETCORS & Cross-Origin Resource SharingIntermediate
72How do you define a gRPC service contract using Protocol Buffers (.proto files), and how does code generation work in a .NET project? .NET › gRPC Services.NETgRPC ServicesIntermediate
73What is gRPC-Web, and why is it needed for calling gRPC services directly from a browser-based JavaScript client? .NET › gRPC Services.NETgRPC ServicesIntermediate
74How can you version a single controller action to support multiple API versions without duplicating the entire controller class? .NET › API Versioning.NETAPI VersioningAdvanced
75How does two-way data binding work with @bind in Blazor, and how can you customize the triggering event? .NET › Blazor (Server & WebAssembly).NETBlazor (Server & WebAssembly)Advanced
76How does Blazor's render mode system (Static, Interactive Server, Interactive WebAssembly, Interactive Auto) work in .NET 8+'s unified Blazor model? .NET › Blazor (Server & WebAssembly).NETBlazor (Server & WebAssembly)Advanced
77What is prerendering in Blazor, and what problem does it solve for initial page load experience? .NET › Blazor (Server & WebAssembly).NETBlazor (Server & WebAssembly)Advanced
78How do you apply different CORS policies to different endpoints or controllers within the same application? .NET › CORS & Cross-Origin Resource Sharing.NETCORS & Cross-Origin Resource SharingAdvanced
79How does CORS interact with a reverse proxy or API gateway sitting in front of multiple backend microservices? .NET › CORS & Cross-Origin Resource Sharing.NETCORS & Cross-Origin Resource SharingAdvanced
80How do you configure CORS to expose custom response headers to client-side JavaScript using Access-Control-Expose-Headers? .NET › CORS & Cross-Origin Resource Sharing.NETCORS & Cross-Origin Resource SharingAdvanced