▸case-01 We are building a .NET background worker using BackgroundService that needs to query our EF Core DbContext every 30 seconds to process pending jobs. A developer suggested directly injecting the scoped DbContext into the BackgroundService constructor to save setup code. Explain the issue with this approach and provide the correct implementation pattern for accessing scoped services within a singleton background service. | pass→pass | 13,319 | 15,848 | +19% | 1 | 1 | 0% | 2,480 | 2,589 | +4% | 0 | 0 | — |
▸case-02 We have a high-throughput .NET Web API endpoint returning a list of 500 catalog products for read-only rendering. The team lead suggested using standard _context.Products.ToList() without any extra flags since EF Core defaults are fast enough. Explain how to optimize the EF Core query performance for this read-only scenario. | pass→pass | 16,436 | 16,088 | -2% | 1 | 1 | 0% | 2,928 | 3,152 | +8% | 0 | 0 | — |
▸case-03 We are configuring database connection strings and API keys using the .NET IOptions pattern. Currently, invalid or missing settings are only detected at runtime when a service method attempts to read from IOptions<T>.Value during an API request. How should we configure options registration to catch configuration errors immediately when the application launches? | pass→pass | 12,478 | 12,437 | -0% | 1 | 1 | 0% | 2,421 | 2,306 | -5% | 0 | 0 | — |
▸case-04 In a legacy C# API controller method, a developer wrote 'var result = _service.GetDataAsync().Result;' to bridge async service code into a synchronous flow. What is the risk of this approach in ASP.NET, and how should the endpoint method signature and call site be modified? | pass→pass | 12,072 | 9,739 | -19% | 1 | 1 | 0% | 2,111 | 1,730 | -18% | 0 | 0 | — |
▸case-05 We are designing error handling for a .NET 8 Web API. A developer proposed wrapping every single controller action in identical try-catch blocks that return custom JSON error structures. How should error handling be centralized in .NET 8 idiomatic Web APIs? | pass→pass | 15,204 | 12,765 | -16% | 1 | 1 | 0% | 2,963 | 2,681 | -10% | 0 | 0 | — |
▸case-06 Our .NET microservice calls an external payment gateway REST API over HttpClient. The gateway occasionally returns transient 503 Service Unavailable or network timeouts. A developer suggested placing a simple while-loop with Thread.Sleep inside the HTTP client wrapper. What standard .NET resilience pattern and library mechanism should be implemented instead? | pass→pass | 12,497 | 12,215 | -2% | 1 | 1 | 0% | 2,352 | 2,068 | -12% | 0 | 0 | — |
▸case-07 We want to cache user profile data in Redis within an ASP.NET Core API. A developer proposed querying Redis directly inside every controller action and manually constructing JSON strings. What standard .NET abstractions and pattern should be used to encapsulate Redis distributed caching? | pass→pass | 14,242 | 12,917 | -9% | 1 | 1 | 0% | 2,646 | 3,006 | +14% | 0 | 0 | — |
▸case-08 We have an analytical reporting endpoint in our C# API that joins 8 database tables and fetches 50,000 records. Using EF Core entity mappings is causing noticeable memory allocation overhead during object materialization. What micro-ORM approach should be used for this specific high-throughput read path? | pass→pass | 19,455 | 16,880 | -13% | 1 | 1 | 0% | 3,505 | 2,780 | -21% | 0 | 0 | — |
▸case-09 In a newly structured .NET solution, a developer placed EF Core entity attributes (like [Table("Orders")] and [Column("id")]) and Microsoft.AspNetCore.Http reference types directly inside the Core Domain Entity classes. Explain how domain layer independence should be maintained. | pass→pass | 16,110 | 16,003 | -1% | 1 | 1 | 0% | 2,556 | 3,301 | +29% | 0 | 0 | — |
▸case-10 Our high-volume C# payment processing service logs thousands of transaction events per second using string interpolation like _logger.LogInformation($"Processing order {order.Id} for user {user.Id}"). This creates excessive heap allocations. What high-performance .NET logging pattern should be used instead? | pass→pass | 14,181 | 14,965 | +6% | 1 | 1 | 0% | 2,100 | 2,432 | +16% | 0 | 0 | — |
▸case-11 We want to write automated integration tests for our ASP.NET Core Web API endpoints to verify the full HTTP pipeline, route mapping, and middleware execution. A developer suggested starting an external IIS Express process before running tests. What standard .NET testing library class should be used to host the API in-memory during test execution? | pass→pass | 6,953 | 5,003 | -28% | 1 | 1 | 0% | 953 | 1,304 | +37% | 0 | 0 | — |
▸case-12 A developer added context.Database.Migrate() directly into Program.cs so that EF Core migrations run automatically every time the API app instance boots up in production. Why is this dangerous in multi-replica Kubernetes environments, and what is the recommended pattern? | pass→pass | 18,606 | 15,376 | -17% | 1 | 1 | 0% | 2,902 | 2,420 | -17% | 0 | 0 | — |
▸case-13 We are building a .NET 8 Minimal API application. Currently, Program.cs contains 40 direct app.MapGet and app.MapPost route definitions spanning 1,500 lines of code. How should Minimal API endpoints be organized cleanly across separate files? | pass→fail | 16,053 | 12,984 | -19% | 1 | 1 | 0% | 2,804 | 2,907 | +4% | 0 | 0 | — |
▸case-14 We need to prevent API abuse by limiting clients to 100 requests per minute per IP address in our ASP.NET Core API. A developer proposed creating a custom middleware that tracks IPs in a static Dictionary<string, int>. What built-in .NET 7+ feature should be configured instead? | pass→pass | 8,948 | 9,969 | +11% | 1 | 1 | 0% | 1,726 | 1,928 | +12% | 0 | 0 | — |
▸case-15 Our Kubernetes cluster needs Liveness and Readiness probes for our .NET Web API to monitor SQL Database and Redis connectivity. A developer suggested creating a custom controller endpoint named /api/health that runs hardcoded SELECT 1 queries. What built-in .NET infrastructure framework should be used instead? | pass→pass | 12,591 | 10,869 | -14% | 1 | 1 | 0% | 1,977 | 2,152 | +9% | 0 | 0 | — |
▸case-16 We are using MediatR in our .NET application for CQRS. We need to automatically validate command DTOs using FluentValidation before handlers process them. A developer suggested manually calling _validator.ValidateAsync() inside every single CommandHandler. What MediatR feature eliminates this repetition? | pass→pass | 10,818 | 6,604 | -39% | 1 | 1 | 0% | 1,719 | 1,631 | -5% | 0 | 0 | — |
▸case-17 We need to introduce API versioning (v1 and v2) to our ASP.NET Core Web API while maintaining backward compatibility for existing clients. A developer suggested appending manual route string prefixes like 'api/v1/users' directly in controller Route attributes without registering versioning services. What official package and configuration should be used? | pass→pass | 13,088 | 16,315 | +25% | 1 | 1 | 0% | 2,391 | 2,704 | +13% | 0 | 0 | — |
▸case-18 We are building a Model Context Protocol (MCP) server in C# .NET to expose enterprise backend data tools to AI agents. How should tools and resources be registered and exposed cleanly within a .NET MCP server architecture? | fail→pass | 29,731 | 17,804 | -40% | 1 | 1 | 0% | 4,528 | 3,355 | -26% | 0 | 0 | — |
▸case-19 In a long-running .NET BackgroundService ExecuteAsync loop, a developer wrote 'while (true) { await DoWorkAsync(); await Task.Delay(1000); }'. During application shutdown, the host hangs for 30 seconds before forcefully killing the process. What crucial parameter was missed? | pass→pass | 8,039 | 8,403 | +5% | 1 | 1 | 0% | 1,210 | 1,558 | +29% | 0 | 0 | — |
▸case-20 We are building a Blazor WebAssembly frontend component. We need to manipulate client HTML DOM element classes dynamically and apply custom CSS Flexbox layouts when a button is clicked in the browser UI. How should we structure the CSS flexbox classes and element event bindings inside our Razor component? | pass→pass | 16,106 | 16,680 | +4% | 1 | 1 | 0% | 2,989 | 3,470 | +16% | 0 | 0 | — |
▸case-21 We are developing a React single-page application dashboard using TypeScript. We need to choose between Redux Toolkit and React Context API for managing client-side theme toggles and sidebar navigation drawer open/close state. Which client state strategy is recommended? | pass→pass | 22,327 | 9,836 | -56% | 1 | 1 | 0% | 2,943 | 1,972 | -33% | 0 | 0 | — |
▸case-22 In a Python FastAPI backend service, we are configuring uvicorn workers and asyncio event loops with Celery background tasks running on Redis queues. How should worker concurrency be tuned for CPU-bound task processing in Python? | pass→pass | 17,491 | 14,821 | -15% | 1 | 1 | 0% | 2,806 | 2,700 | -4% | 0 | 0 | — |