All fields

“Global Exception Handling & Middleware” in Information Technology

48 questions across 4 technologies.

Information Technology

48 questions in 4 technologies

#QuestionTechnologyTopicLevel
1What 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
2What is the purpose of global exception handling middleware in an ASP.NET Core application? .NET › Global Exception Handling & Middleware.NETGlobal Exception Handling & MiddlewareBeginner
3What is the difference between handling exceptions with middleware versus using try/catch blocks directly in controller actions? .NET › Global Exception Handling & Middleware.NETGlobal Exception Handling & MiddlewareIntermediate
4How do you write an integration test verifying that your global exception handler produces the correct error response shape? .NET › Global Exception Handling & Middleware.NETGlobal Exception Handling & MiddlewareIntermediate
5How does exception handling middleware interact with model validation errors in ASP.NET Core, and how do they typically produce different error response paths? .NET › Global Exception Handling & Middleware.NETGlobal Exception Handling & MiddlewareAdvanced
6How would you design exception handling middleware to support internationalized (localized) error messages returned to clients in different languages? .NET › Global Exception Handling & Middleware.NETGlobal Exception Handling & MiddlewareAdvanced
7How do you map different exception types to different HTTP status codes in a global exception handler? .NET › Global Exception Handling & Middleware.NETGlobal Exception Handling & MiddlewareIntermediate
8How should a global exception handler differentiate between exceptions that should return specific client-facing details versus exceptions that should always show a generic message? .NET › Global Exception Handling & Middleware.NETGlobal Exception Handling & MiddlewareIntermediate
9What is the role of the [ApiController] attribute in automatically handling certain error scenarios without explicit exception handling code? .NET › Global Exception Handling & Middleware.NETGlobal Exception Handling & MiddlewareIntermediate
10How would you implement custom middleware to catch and log unhandled exceptions before they reach the exception handler, adding request-specific context? .NET › Global Exception Handling & Middleware.NETGlobal Exception Handling & MiddlewareAdvanced
11How 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
12How 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
13How does the IExceptionHandler interface (introduced in .NET 8) provide a more structured alternative to the UseExceptionHandler lambda approach? .NET › Global Exception Handling & Middleware.NETGlobal Exception Handling & MiddlewareIntermediate
14What is ProblemDetails (RFC 7807/9457), and how does ASP.NET Core support it for standardized error responses? .NET › Global Exception Handling & Middleware.NETGlobal Exception Handling & MiddlewareAdvanced
15What information should be excluded from error responses in production to avoid leaking sensitive implementation details? .NET › Global Exception Handling & Middleware.NETGlobal Exception Handling & MiddlewareAdvanced
16How would you design a robust global exception handling middleware in ASP.NET Core to convert unhandled exceptions into consistent API error responses? C# › Exception HandlingC#Exception HandlingAdvanced
17What 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
18What is the purpose of global exception handling middleware in an ASP.NET Core application? ASP.NET Core › Error HandlingASP.NET CoreError HandlingBeginner
19How would you design and implement a global, centralized exception-handling strategy for a Java application (such as a top-level handler in main(), or an uncaught exception handler for background threads), ensuring no exception silently crashes the application without being logged? Java › ExceptionsJavaExceptionsAdvanced
20How does IExceptionFilter differ from global exception handling middleware, and when would you choose one over the other? ASP.NET Core › FiltersASP.NET CoreFiltersAdvanced
21What 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
22How do you map different custom exception types to different HTTP status codes in a global exception handler? ASP.NET Core › Error HandlingASP.NET CoreError HandlingIntermediate
23How should a global exception handler differentiate between exceptions meant for client-facing details versus exceptions that should always show a generic message? ASP.NET Core › Error HandlingASP.NET CoreError HandlingIntermediate
24How would you write an integration test verifying that your global exception handler produces the correct error response shape for a specific exception type? ASP.NET Core › Error HandlingASP.NET CoreError HandlingAdvanced
25What 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
26Why 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
27What'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
28How 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
29How does the IExceptionHandler interface (introduced in .NET 8) provide a more structured alternative to the UseExceptionHandler lambda approach? ASP.NET Core › Error HandlingASP.NET CoreError HandlingIntermediate
30What is a common anti-pattern with catching exceptions too broadly (catch (Exception e) or worse, catch (Throwable t)), and why is it generally discouraged? Java › ExceptionsJavaExceptionsIntermediate
31How does exception handling work differently for Blazor components compared to a typical MVC controller action or minimal API endpoint? ASP.NET Core › Blazor Integration with ASP.NET CoreASP.NET CoreBlazor Integration with ASP.NET CoreIntermediate
32How does the AuthorizationMiddlewareResultHandler let you customize the response returned when authorization fails, beyond the default 401/403? ASP.NET Core › AuthorizationASP.NET CoreAuthorizationAdvanced
33What HTTP status code and response should an API return when a client requests a version that no longer exists or was never supported? .NET › API Versioning.NETAPI VersioningIntermediate
34What are the security risks of storing JWTs in browser localStorage versus HttpOnly cookies? .NET › Authentication & Authorization (Identity, JWT, OAuth).NETAuthentication & Authorization (Identity, JWT, OAuth)Intermediate
35How do you validate configuration options at application startup to fail fast on misconfiguration? .NET › Configuration & Options.NETConfiguration & OptionsIntermediate
36What is the difference between CORS and CSRF (Cross-Site Request Forgery), and how does CORS relate to (but not fully prevent) CSRF? .NET › CORS & Cross-Origin Resource Sharing.NETCORS & Cross-Origin Resource SharingIntermediate
37How do you register multiple implementations of the same interface, and how do you resolve all of them together? .NET › Dependency Injection.NETDependency InjectionIntermediate
38What is a memory dump, and how do you capture and analyze one for a .NET application experiencing high memory usage or a crash? .NET › Diagnostics & Performance.NETDiagnostics & PerformanceIntermediate
39What security risk does dynamically reflecting the Origin header back as Access-Control-Allow-Origin introduce, and why is it a dangerous anti-pattern? ASP.NET Core › CORS (Cross-Origin Resource Sharing)ASP.NET CoreCORS (Cross-Origin Resource Sharing)Intermediate
40What does GetService<T>() return compared to GetRequiredService<T>() when a service isn't registered, and which should application code generally prefer? ASP.NET Core › Dependency InjectionASP.NET CoreDependency InjectionIntermediate
41How do you handle and propagate errors in gRPC, given it doesn't use standard HTTP status codes the way REST does? ASP.NET Core › gRPC ServicesASP.NET CoregRPC ServicesIntermediate
42What is the 'tolerant reader' pattern, and how does it reduce the need for frequent API versioning? .NET › API Versioning.NETAPI VersioningAdvanced
43What security risks does an overly permissive CORS policy (like AllowAnyOrigin with credentials attempted, or reflecting the Origin header) introduce? .NET › CORS & Cross-Origin Resource Sharing.NETCORS & Cross-Origin Resource SharingAdvanced
44How does gRPC handle errors and status codes, and how does this differ from HTTP status codes in REST? .NET › gRPC Services.NETgRPC ServicesAdvanced
45How do you validate configuration options at application startup to fail fast on misconfiguration, using ValidateDataAnnotations and ValidateOnStart? ASP.NET Core › Configuration & Options PatternASP.NET CoreConfiguration & Options PatternAdvanced
46How do you write a custom IValidateOptions<T> implementation for validation logic beyond what DataAnnotations attributes can express? ASP.NET Core › Configuration & Options PatternASP.NET CoreConfiguration & Options PatternAdvanced
47How would you configure an API to return Problem Details (RFC 7807) formatted error responses consistently across all content types, not just JSON? ASP.NET Core › Content Negotiation & Output FormattersASP.NET CoreContent Negotiation & Output FormattersAdvanced
48How would you implement a filter that modifies the action's result based on the outcome, such as wrapping every successful response in a standard envelope? ASP.NET Core › FiltersASP.NET CoreFiltersAdvanced