▸case-01 I'm setting up a new C# .NET Web API for order processing that communicates with a third-party payment gateway and a database. Could you write the service layer interface, its concrete implementation for handling payment processing, and demonstrate how to wire it up in Program.cs following clean architecture practices? | fail→pass | 17,319 | 15,522 | -10% | 1 | 1 | 0% | 3,532 | 3,626 | +3% | 0 | 0 | — |
▸case-02 I have an ASP.NET Core API endpoint that fetches inventory data from an external REST API and updates our PostgreSQL database. Show me the controller method and service layer code. Someone suggested just calling `.Result` on the HTTP client call to keep the controller synchronous for simplicity. | pass→pass | 14,312 | 12,048 | -16% | 1 | 1 | 0% | 3,155 | 2,646 | -16% | 0 | 0 | — |
▸case-03 We are writing a `NotificationService` in C# .NET 8. To avoid cluttering constructor parameters as dependencies grow, the developer proposes passing `IServiceProvider` directly into `NotificationService` and calling `provider.GetRequiredService<IEmailClient>()` inside the methods. Write the constructor and method implementation. | fail→pass | 8,448 | 8,089 | -4% | 1 | 1 | 0% | 1,580 | 1,773 | +12% | 0 | 0 | — |
▸case-04 We have an `SmtpSettings` class in our .NET 8 web app bound from appsettings.json using `builder.Services.Configure<SmtpSettings>(...)`. How should we register this configuration in `Program.cs` to ensure missing or invalid settings cause an instant startup failure rather than failing on the first email sent? | pass→pass | 8,997 | 6,364 | -29% | 1 | 1 | 0% | 1,870 | 1,557 | -17% | 0 | 0 | — |
▸case-05 I'm writing a C# .NET background worker task that syncs user records from a remote server. To save writing `async` everywhere, can I use `.Wait()` inside `ExecuteAsync`? Provide the corrected C# background service code. | pass→pass | 11,245 | 8,621 | -23% | 1 | 1 | 0% | 1,959 | 2,082 | +6% | 0 | 0 | — |
▸case-06 Here is an ASP.NET Core API controller for processing customer refunds. Currently, it calculates tax adjustments, checks user permission flags, calls the payment gateway API directly, updates the DB context, and sends emails all inside the action method. Show me how to clean up this controller code using clean layering. | pass→pass | 14,744 | 14,044 | -5% | 1 | 1 | 0% | 2,918 | 3,224 | +10% | 0 | 0 | — |
▸case-07 We are setting up automated tests for a .NET order discount calculation module and a database-backed order repository. How should we structure the test suite between unit tests and integration tests? | pass→pass | 15,704 | 15,585 | -1% | 1 | 1 | 0% | 2,677 | 2,805 | +5% | 0 | 0 | — |
▸case-08 We need to integrate an external shipping rate calculator API (`FedExShippingApi`) into our .NET Core app. Write the C# client registration and service class. A team member suggested calling `new FedExShippingApi()` directly inside our order fulfillment service to reduce DI registrations. | pass→pass | 15,376 | 11,765 | -23% | 1 | 1 | 0% | 2,465 | 2,634 | +7% | 0 | 0 | — |
▸case-09 Write an Entity Framework Core repository method `GetActiveOrdersAsync` in C# .NET that queries orders by status from DbContext. Should it accept a `CancellationToken`? | pass→pass | 9,522 | 5,362 | -44% | 1 | 1 | 0% | 1,766 | 1,281 | -27% | 0 | 0 | — |
▸case-10 We need to handle database connection strings and API secret keys in our ASP.NET Core application for Development, Staging, and Production environments. Show how to configure `Program.cs` and configuration files safely without committing secrets to Git. | pass→pass | 19,438 | 12,337 | -37% | 1 | 1 | 0% | 2,743 | 2,785 | +2% | 0 | 0 | — |
▸case-11 Our unit test for `OrderProcessingService` mocks `IDateTimeProvider`, `ILogger`, `IOrderRepository`, `IPaymentGateway`, `IEmailSender`, and `ITaxCalculator`. The test setup takes 80 lines just for mocks to test a 5-line calculation. How should we improve this test design? | pass→pass | 14,081 | 10,141 | -28% | 1 | 1 | 0% | 2,619 | 2,217 | -15% | 0 | 0 | — |
▸case-12 In a .NET 8 class library, someone created a static class `ServiceLocator` with a public property `public static IServiceProvider Container { get; set; }` so any class can grab services anytime without DI. Refactor this design for a `ReportGenerator` class. | pass→pass | 12,511 | 8,394 | -33% | 1 | 1 | 0% | 2,642 | 1,995 | -24% | 0 | 0 | — |
▸case-13 I am writing a repository method in C# that wraps an EF Core `ToListAsync` call. Should I write `public async Task<List<User>> GetUsersAsync(CancellationToken ct) => await _db.Users.ToListAsync(ct);` or use synchronous execution? Explain and write the clean C# method. | fail→fail | 10,806 | 7,372 | -32% | 1 | 1 | 0% | 1,997 | 1,622 | -19% | 0 | 0 | — |
▸case-14 Create an ASP.NET Core Minimal API endpoint `POST /orders` that receives a `CreateOrderCommand`, validates customer status, calculates totals, creates the order, and returns `201 Created`. Show the clean separation of concerns. | pass→pass | 17,830 | 13,651 | -23% | 1 | 1 | 0% | 3,829 | 3,279 | -14% | 0 | 0 | — |
▸case-15 Write a .NET 8 strongly-typed configuration class `TwilioOptions` with fields `AccountSid` and `AuthToken`. Show how to bind and validate these options in `Program.cs` using `AddOptions<TwilioOptions>()`. | pass→pass | 8,144 | 9,496 | +17% | 1 | 1 | 0% | 1,662 | 1,517 | -9% | 0 | 0 | — |
▸case-16 In an ASP.NET Core API controller action, I need to fetch data from three microservices concurrently. Code review found `Task.WaitAll(task1, task2, task3);` followed by accessing `.Result`. Rewrite this endpoint correctly in C#. | pass→pass | 10,065 | 8,002 | -20% | 1 | 1 | 0% | 1,888 | 1,658 | -12% | 0 | 0 | — |
▸case-17 We have a domain service in C# that calculates tiered pricing discounts based on customer purchase history. Write a unit test suite for this logic using xUnit. | pass→pass | 16,692 | 14,383 | -14% | 1 | 1 | 0% | 3,579 | 3,594 | +0% | 0 | 0 | — |
▸case-18 We have a scoped `DbContext` in a .NET API and a singleton `CacheService`. Someone wants to inject `DbContext` into `CacheService` directly. How should this dependency boundary be handled correctly in C#? | pass→pass | 13,172 | 16,899 | +28% | 1 | 1 | 0% | 2,366 | 2,258 | -5% | 0 | 0 | — |
▸case-19 Write a C# service method `FetchLatestNewsAsync` using `HttpClient` to call a third-party news API. Show proper exception handling and cancellation token propagation. | pass→pass | 15,581 | 10,672 | -32% | 1 | 1 | 0% | 2,953 | 2,487 | -16% | 0 | 0 | — |
▸case-20 We are migrating an existing .NET Entity Framework Core 8 database schema to support high-throughput table partitioning and custom GIN indexes on JSON columns in PostgreSQL. How should we write EF Core migration scripts and raw SQL index definitions? | pass→pass | 20,515 | 25,998 | +27% | 1 | 1 | 0% | 3,907 | 3,300 | -16% | 0 | 0 | — |
▸case-21 We are building a Blazor WebAssembly UI in .NET 8. How do we pass UI state between cascading parameters and component state containers when navigating between client-side routes? | pass→pass | 14,805 | 14,233 | -4% | 1 | 1 | 0% | 2,884 | 2,758 | -4% | 0 | 0 | — |
▸case-22 How do we write a multi-stage Dockerfile for a .NET 8 Web API to minimize the final container image size using alpine or chiseled runtime bases? | pass→pass | 17,116 | 13,117 | -23% | 1 | 1 | 0% | 3,340 | 3,059 | -8% | 0 | 0 | — |