All fields

“Testing ASP.NET Core Applications” in Information Technology

27 questions across 2 technologies.

Information Technology

27 questions in 2 technologies

#QuestionTechnologyTopicLevel
1What is dependency injection, and how does ASP.NET Core's built-in DI container support it out of the box? ASP.NET Core › Dependency InjectionASP.NET CoreDependency InjectionBeginner
2How do you add XML output formatting support to an ASP.NET Core API alongside the default JSON formatter? ASP.NET Core › Content Negotiation & Output FormattersASP.NET CoreContent Negotiation & Output FormattersIntermediate
3How would you debug why a specific request isn't matching the route you expect it to, using ASP.NET Core's routing diagnostics? ASP.NET Core › Endpoint Metadata, Route Constraints & TemplatesASP.NET CoreEndpoint Metadata, Route Constraints & TemplatesAdvanced
4How would you implement automated testing that verifies deprecated API versions still function correctly while newer versions are actively developed? ASP.NET Core › API VersioningASP.NET CoreAPI VersioningAdvanced
5How do you unit test that a specific API version's controller action behaves correctly, given the version-based routing? ASP.NET Core › API VersioningASP.NET CoreAPI VersioningIntermediate
6How do you use IHostEnvironment/IWebHostEnvironment to conditionally configure services based on the current environment? ASP.NET Core › Configuration & Options PatternASP.NET CoreConfiguration & Options PatternIntermediate
7How do you test that an API correctly returns different formats based on the Accept header using integration tests? ASP.NET Core › Content Negotiation & Output FormattersASP.NET CoreContent Negotiation & Output FormattersIntermediate
8What is the difference between constructor injection and using IServiceProvider directly to resolve dependencies imperatively (service location)? ASP.NET Core › Dependency InjectionASP.NET CoreDependency InjectionIntermediate
9How would you unit test a custom action filter's logic in isolation, without needing a full HTTP request pipeline? ASP.NET Core › FiltersASP.NET CoreFiltersIntermediate
10How would you write an integration test verifying that your health check endpoint correctly reports Unhealthy when a dependency is down? ASP.NET Core › Health ChecksASP.NET CoreHealth ChecksIntermediate
11How would you write a unit test that thoroughly verifies a custom equals() and hashCode() implementation satisfies its contract, and what testing libraries exist specifically for this purpose? Java › equals(), hashCode() & toString() ContractsJavaequals(), hashCode() & toString() ContractsIntermediate
12How would you design API versioning strategy differently for a public, third-party-consumed API versus an internal microservice API? ASP.NET Core › API VersioningASP.NET CoreAPI VersioningAdvanced
13How do you unit test custom authorization handlers in isolation, without needing a full HTTP request pipeline? ASP.NET Core › AuthorizationASP.NET CoreAuthorizationAdvanced
14How 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
15How would you decide between controllers and minimal APIs for a new project, weighing team familiarity, project complexity, and long-term maintainability? ASP.NET Core › Controllers vs Minimal APIsASP.NET CoreControllers vs Minimal APIsAdvanced
16How does dependency injection differ in practice between controllers (constructor injection) and minimal APIs (parameter injection)? ASP.NET Core › Controllers vs Minimal APIsASP.NET CoreControllers vs Minimal APIsAdvanced
17How would you migrate an existing controller-based API to minimal APIs incrementally without a risky big-bang rewrite? ASP.NET Core › Controllers vs Minimal APIsASP.NET CoreControllers vs Minimal APIsAdvanced
18How do you write integration tests that work consistently for both controller-based and minimal API endpoints using WebApplicationFactory? ASP.NET Core › Controllers vs Minimal APIsASP.NET CoreControllers vs Minimal APIsAdvanced
19How would you write an integration test verifying that a CORS policy correctly allows a specific origin and rejects an unauthorized one? ASP.NET Core › CORS (Cross-Origin Resource Sharing)ASP.NET CoreCORS (Cross-Origin Resource Sharing)Advanced
20How would you unit test a service or minimal API handler that depends on multiple injected interfaces, without spinning up the full DI container? ASP.NET Core › Dependency InjectionASP.NET CoreDependency InjectionAdvanced
21How does ValidateOnBuild help catch dependency injection configuration errors immediately at application startup rather than at runtime? ASP.NET Core › Dependency InjectionASP.NET CoreDependency InjectionAdvanced
22How 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
23How would you calculate a person's age or the number of days until a recurring annual event (like a birthday) using ChronoUnit, and what's a common pitfall with leap-year birthdays (February 29)? Java › Java Date & Time API (java.time)JavaJava Date & Time API (java.time)Intermediate
24What is a qualified export (exports package to specificModule), and when would you use it instead of a plain, unqualified export? Java › Java Platform Module System (JPMS)JavaJava Platform Module System (JPMS)Intermediate
25How would you correctly handle daylight saving time (DST) transitions when performing date-time arithmetic with ZonedDateTime, and what specific pitfalls exist around the 'spring forward' and 'fall back' transitions? Java › Java Date & Time API (java.time)JavaJava Date & Time API (java.time)Advanced
26How would you implement a recurring event scheduling system that correctly handles both fixed-instant recurrence (every exactly 24 hours) and calendar-based recurrence (every day at 9 AM local time), given these have meaningfully different behavior across DST transitions? Java › Java Date & Time API (java.time)JavaJava Date & Time API (java.time)Advanced
27How would you implement a simple HTTP server (not just a client) using the lightweight com.sun.net.httpserver.HttpServer class bundled with the JDK, without a full framework like Spring? Java › Java Networking & HTTP ClientJavaJava Networking & HTTP ClientAdvanced