25 ASP.NET Core interview questions
Structure the ASP.NET Core interview loop around evidence, not trivia. Start with a 30-minute screen to confirm recent .NET 8/10, C#, HTTP API, database, and cloud experience. Use a focused technical interview to probe request pipeline knowledge, dependency injection, async code, EF Core, security, and debugging judgment. Add a practical exercise that mirrors your codebase: a small API change with tests, validation, persistence, and observability. For senior candidates, include a system design session around scaling, reliability, deployment, and integration boundaries. Finish with a collaboration interview covering code reviews, incident response, mentoring, and product trade-offs. Keep each stage tied to decisions the engineer will actually make on your team.
Junior ASP.NET Core questions
Fundamentals, learning speed and how they debug.
01You join an ASP.NET Core API where one endpoint sometimes returns 500 but only in staging. How would you investigate it?
Listen for: A strong answer starts with reproducing the request, checking structured logs, correlation IDs, environment-specific configuration, connection strings, feature flags, and external dependencies. They should mention reading the exception details safely, adding targeted logging or tests, comparing local and staging settings, and avoiding random code changes without evidence.
Red flag: They immediately guess a fix or say they would just attach a debugger to staging without considering logs or configuration.
02When would you put code in middleware, an endpoint filter, an action filter, or the endpoint handler itself?
Listen for: Look for an explanation based on scope and timing in the request pipeline. Middleware is for cross-cutting behavior across many requests, endpoint filters for minimal API endpoint concerns, action filters for MVC/controller actions, and handler code for business-specific behavior. They should mention ordering, short-circuiting, and testability.
Red flag: They treat all four as interchangeable places to put any shared code.
03How do you handle validation errors in a JSON API built with ASP.NET Core?
Listen for: They should describe validating input DTOs, returning clear 400 responses, using ProblemDetails, keeping validation separate from persistence models, and testing common invalid requests. Bonus signals include FluentValidation or built-in validation, consistent error shape, avoiding exception-driven validation, and not leaking internal field or database details.
Red flag: They rely on database exceptions to catch invalid input.
04What problems can happen if you block on async code with .Result or .Wait() in an ASP.NET Core app?
Listen for: A good answer mentions thread pool starvation, reduced throughput, deadlocks in some contexts, hidden exception wrapping, and poor cancellation behavior. They should prefer async all the way, using await with CancellationToken where available, and understand that I/O-bound database and HTTP calls should not occupy threads while waiting.
Red flag: They say async is only for UI apps and does not matter on the server.
05You need to add a new EF Core query to list recent orders. What do you check before merging it?
Listen for: Listen for filtering, sorting, pagination, projection to DTOs, no unnecessary Include calls, async execution, cancellation token use, and reviewing generated SQL for expensive joins or client evaluation. They should mention indexes with the team or migration owner and tests that cover empty, normal, and boundary cases.
Red flag: They load all rows into memory and filter with LINQ afterward.
06How would you store and read configuration values such as API keys, feature flags, and environment-specific URLs?
Listen for: They should distinguish appsettings files, environment variables, user secrets for local development, and managed secret stores such as Azure Key Vault or AWS Secrets Manager. Strong answers mention the options pattern, validation on startup, no secrets in source control, and predictable overrides per environment.
Red flag: They put secrets in appsettings.Production.json and commit them because the repository is private.
Mid-level ASP.NET Core questions
Independent delivery, trade-offs and code quality.
07An ASP.NET Core API has rising latency after a release, but CPU is normal. What would you inspect first?
Listen for: Strong candidates look at traces, dependency timings, database queries, connection pool exhaustion, outbound HTTP calls, retries, locks, thread pool metrics, and recent code changes. They should use OpenTelemetry, logs with request IDs, and profiler or APM data before optimizing. They separate server latency from downstream or client issues.
Red flag: They focus only on CPU and suggest adding more instances without investigation.
08How do you design dependency injection lifetimes for services that use EF Core, HttpClient, and cached data?
Listen for: They should know DbContext is typically scoped, application services often scoped or singleton depending on state, HttpClient should come from IHttpClientFactory or typed clients, and singleton services cannot depend on scoped services directly. Good answers mention avoiding captured mutable state, options snapshots, and testing lifetimes during startup.
Red flag: They register everything as singleton for performance.
09You are adding authentication and authorization to a multi-tenant ASP.NET Core API. What decisions matter?
Listen for: Look for JWT or cookie choice based on clients, issuer and audience validation, tenant resolution, claims mapping, policy-based authorization, resource-level checks, and avoiding trusting tenant IDs from the body alone. They should discuss token lifetime, clock skew, key rotation, and integration tests for cross-tenant access denial.
Red flag: They only check that a user is logged in and assume tenant access is valid.
10How would you handle schema changes with EF Core in a system that must stay online during deployment?
Listen for: A strong answer uses backward-compatible migrations, expand-and-contract changes, nullable columns or default values where appropriate, separate deploy steps for code and schema, and migration review in CI. They understand when automatic migration on startup is risky and how to handle long-running indexes or data backfills.
Red flag: They let every app instance run migrations on startup in production without coordination.
11What is your approach to outbound HTTP integrations from ASP.NET Core services?
Listen for: They should use IHttpClientFactory or typed clients, set timeouts, propagate cancellation, handle non-success responses intentionally, use resilience policies such as Microsoft.Extensions.Http.Resilience or Polly, and log without leaking secrets. Strong answers mention idempotency, retries only for safe cases, circuit breakers, and contract tests or fakes.
Red flag: They create a new HttpClient per request and retry every failure indefinitely.
12How do you keep API controllers or minimal API handlers from becoming too large?
Listen for: Listen for thin transport layers, request/response DTOs, application services or command handlers, explicit validation, transaction boundaries, and clear ownership of mapping and business rules. They should avoid blindly adding patterns but know when vertical slices, MediatR, or modular organization improves maintainability and testability.
Red flag: They put all validation, authorization, database access, and external calls directly in the endpoint.
13A background job in your ASP.NET Core app processes messages twice in rare cases. How do you make it safe?
Listen for: Strong answers assume at-least-once delivery and design idempotent handlers using message IDs, deduplication tables, unique constraints, state checks, and transactional updates. They should mention visibility timeouts, poison messages, retries with backoff, observability, and not holding long database transactions while calling external services.
Red flag: They assume the queue guarantees exactly-once processing and add no safeguards.
Senior ASP.NET Core questions
Judgement, architecture and raising the team's bar.
14You inherit a large ASP.NET Core monolith with slow delivery and mixed domain boundaries. How do you improve it without a risky rewrite?
Listen for: Look for incremental modernization: mapping modules, stabilizing tests, extracting seams, improving build and deployment, reducing shared database coupling, and using strangler patterns for high-value areas. Strong candidates consider team ownership, telemetry, migration risk, and business priorities before choosing microservices or modular monolith approaches.
Red flag: They propose rewriting the whole system as microservices before understanding the domain or failure modes.
15How do you set engineering standards for ASP.NET Core APIs across several teams?
Listen for: Strong answers define practical standards: API versioning, ProblemDetails, authentication patterns, logging fields, OpenTelemetry, health checks, error handling, package management, testing expectations, and secure defaults. They balance templates and shared libraries against team autonomy, and they describe governance through examples, reviews, and maintainable documentation.
Red flag: They mandate a large internal framework that every team must use for every decision.
16A production incident shows thread pool starvation in an ASP.NET Core service. How would you lead the response and follow-up?
Listen for: They should stabilize first by reducing load, scaling if useful, disabling features, or rolling back. Investigation should check sync-over-async, blocking locks, long CPU work on request threads, connection exhaustion, and queue depth. Follow-up includes telemetry gaps, load tests, code review guidance, and clear incident notes.
Red flag: They blame developers individually or focus only on restarting the service.
17How do you decide between minimal APIs, controllers, gRPC, and message-based APIs for a new .NET service?
Listen for: Listen for protocol and consumer-driven reasoning. Minimal APIs fit small HTTP services and vertical slices, controllers fit richer MVC conventions, gRPC fits internal low-latency typed contracts, and messaging fits async workflows and resilience. They should discuss tooling, versioning, observability, client support, and team familiarity.
Red flag: They always choose the same style because it is their personal preference.
18How do you approach security review for an ASP.NET Core application before launch?
Listen for: Strong candidates cover authentication, authorization at resource boundaries, input validation, output encoding, CSRF where cookies are used, CORS, secrets, TLS, secure headers, dependency scanning, logging redaction, rate limiting, and audit trails. They should include threat modeling and abuse cases, not just package updates.
Red flag: They treat security as only adding JWT authentication.
19You need to improve test strategy for a service with many brittle unit tests and few integration tests. What do you change?
Listen for: They should rebalance toward meaningful tests: fast unit tests for pure logic, integration tests with WebApplicationFactory, Testcontainers for databases or brokers, contract tests for integrations, and fewer tests tied to implementation details. Strong answers mention deterministic data, parallel safety, CI runtime, and confidence during refactoring.
Red flag: They delete most tests or require only end-to-end tests for every behavior.
20How do you evaluate performance improvements in ASP.NET Core without making the code harder to maintain?
Listen for: Look for measuring first with traces, benchmarks, load tests, and realistic data. They should target hot paths, database access, serialization, allocations, caching, and network calls. Good answers balance readable code with optimizations, document non-obvious choices, and verify improvements under production-like conditions.
Red flag: They suggest low-level micro-optimizations before identifying the bottleneck.
System design ASP.NET Core questions
Designing real systems end to end.
21Design an ASP.NET Core order API that supports web checkout, admin edits, and asynchronous fulfillment events.
Listen for: Strong designs separate command and query concerns where useful, define transaction boundaries around order creation, publish events reliably with an outbox, and protect admin operations with policy-based authorization. They should cover EF Core modeling, optimistic concurrency, idempotency for fulfillment events, ProblemDetails responses, observability, and versioned public endpoints.
Red flag: They save the order and publish the event directly to a broker with no failure-handling strategy.
22Design a multi-tenant ASP.NET Core SaaS API serving customers with strict data isolation needs.
Listen for: Listen for tenant resolution from trusted claims or hostnames, authorization checks on every resource, database-per-tenant versus shared schema trade-offs, EF Core query filters used carefully, tenant-aware logging, migrations, backups, and operational tooling. Strong answers include tests proving cross-tenant access is denied.
Red flag: They rely only on a tenantId field supplied by the client request body.
23Design an ASP.NET Core reporting endpoint that exports large CSV files without timing out or exhausting memory.
Listen for: Good answers stream results, page database reads, project only needed columns, use async I/O, set appropriate response headers, and consider background generation with object storage for very large exports. They should discuss cancellation, authorization, audit logging, rate limiting, and avoiding loading the full file into memory.
Red flag: They build the entire CSV in a string before writing the response.
24Design a real-time notifications feature for an ASP.NET Core application used by browsers and mobile clients.
Listen for: Strong answers consider SignalR for browser and app connections, backplane or managed service for scale-out, fallback to push notifications for offline devices, authentication on hub connections, group membership by user or tenant, message persistence where needed, and observability for connection counts and delivery failures.
Red flag: They assume in-memory connection state on one server is enough for a scaled deployment.
25Design the deployment and runtime model for an ASP.NET Core API on Kubernetes or a managed container platform.
Listen for: Look for containerized .NET 10 builds, non-root images, configuration from environment and secret stores, readiness and liveness health checks, structured logs, OpenTelemetry traces and metrics, graceful shutdown, horizontal scaling, database migration strategy, and safe rollout practices such as blue-green or canary where appropriate.
Red flag: They bake environment-specific settings and secrets into the container image.
Build and harden a small ASP.NET Core support ticket API
Create a small ASP.NET Core 10 API for support tickets. Implement endpoints to create a ticket, list tickets with filtering and pagination, update status, and return a single ticket. Use EF Core with SQLite, SQL Server LocalDB, or PostgreSQL via Testcontainers. Add validation, consistent ProblemDetails errors, cancellation tokens, and at least one integration test using WebApplicationFactory. Include basic structured logging and a short README explaining trade-offs, how to run tests, and what you would improve with more time. The exercise should take two to three hours; completeness matters less than clear judgment.
How to evaluate it
- API shape, HTTP semantics, validation, and error consistency
- Correct EF Core usage, query efficiency, migrations or schema setup, and transaction boundaries
- Test quality, especially integration coverage for success and failure paths
- Code organization, dependency injection lifetimes, async/cancellation usage, and readability
- Operational thinking: logging, configuration, README clarity, and sensible trade-offs
Rather skip the interview loop?
Every Octogle ASP.NET Core engineer has already passed a technical assessment, system design and a live interview with an engineer who has shipped ASP.NET Core. Send a brief and get 3–5 scored profiles in 48 hours.