ASP.NET Core Interview

Senior ASP.NET Core Real-World Scenarios

ASP.NET Core interview questions covering senior asp.net core real-world scenarios.

25 Questions Filter by level

Interview questions

Open a question for the full answer, code and interview guidance.

25 Results
226
SeniorAdvanced

How would you diagnose a slow ASP.NET Core endpoint in production?

Start with measurements rather than assumptions. Check request latency percentiles, traces, structured logs, CPU, memory, database timings, outgoing HTTP calls, thread-pool behavior, and cache effectiveness. A distributed trace can show whether the time is spent in middleware, application code, the database, or a downstream service.

227
SeniorAdvanced

An ASP.NET Core application works locally but fails in production. How would you troubleshoot it?

Compare the production environment with local development systematically. Verify the deployed build, runtime, environment name, configuration sources, connection strings, file permissions, certificates, network access, database schema, reverse-proxy settings, and external-service endpoints.

228
SeniorAdvanced

How would you design an ASP.NET Core application for high traffic?

Keep request processing stateless where practical so multiple instances can serve traffic behind a load balancer. Use asynchronous I/O, efficient database queries, pagination, appropriate caching, connection pooling, response compression, and bounded outbound calls.

229
SeniorAdvanced

How would you prevent duplicate form submissions or duplicate API operations?

For browser forms, the Post/Redirect/Get pattern prevents ordinary refreshes from resubmitting a successful POST, but it does not solve all duplicate-request scenarios.

230
SeniorAdvanced

How would you handle a long-running operation requested by an HTTP client?

Do not keep an HTTP request open for minutes when the work can be performed asynchronously. Validate and accept the request, create a job record, enqueue durable work, and return an identifier that the client can use to query status.

231
SeniorAdvanced

How would you safely call an unreliable external API from ASP.NET Core?

Use IHttpClientFactory, set an appropriate timeout, propagate cancellation, and classify failures. Apply retries only to transient failures and only when retrying the operation is safe. Backoff and jitter help avoid synchronized retry storms.

232
SeniorAdvanced

How would you handle transient database failures?

First determine whether the failure is actually transient. Temporary connectivity or failover conditions may justify a limited retry strategy, while constraint violations or invalid SQL will not improve by retrying.

233
SeniorAdvanced

How would you prevent race conditions when two users update the same record?

Use a concurrency strategy appropriate to the business rule. Optimistic concurrency is common: store a concurrency token and include it in the update condition. If another request changed the row first, the second update detects the conflict instead of silently overwriting data.

234
SeniorAdvanced

How would you design caching for frequently requested product data?

Decide what can be stale and for how long before choosing a cache. For data that is identical for all users, cache a compact DTO using a stable key such as product:{id}. Use explicit expiration and invalidate or replace the entry when the product changes.

235
SeniorAdvanced

How would you secure an ASP.NET Core admin area?

Require authentication and explicit authorization, preferably through a role or policy that represents administrative permission. Apply the requirement at the area/controller or endpoint boundary so new actions do not accidentally become public.

236
SeniorAdvanced

How would you implement multi-tenant data isolation?

Identify the tenant from a trusted source, such as authenticated claims, a validated host mapping, or another controlled tenant-resolution mechanism. Do not trust an arbitrary tenant ID from the request without verifying the user is entitled to that tenant.

237
SeniorAdvanced

How would you upload large files safely in ASP.NET Core?

Set explicit size limits and validate the upload according to business requirements. Do not trust the client-provided file name or Content-Type as proof of file contents. Generate a server-side storage name and keep untrusted uploads outside executable application paths.

238
SeniorAdvanced

How would you stream a large download without loading it fully into memory?

Use a stream-based response so the server can transfer data progressively rather than creating a large byte array. The underlying storage API should also support streaming.

239
SeniorAdvanced

How would you troubleshoot high memory usage in an ASP.NET Core application?

Measure the process over time and determine whether memory is stable under load, grows because of legitimate caching, or continuously accumulates. Inspect GC metrics, allocation rates, large object heap activity, memory dumps, and profiler results.

240
SeniorAdvanced

How would you troubleshoot thread-pool starvation?

Look for increasing request latency and queued work while CPU is not necessarily saturated. Runtime counters, traces, and dumps can reveal thread-pool growth and blocked threads.

241
SeniorAdvanced

How would you design a background email queue?

The request path should create the business state and enqueue an email command rather than waiting for a slow mail server when immediate delivery is unnecessary. A background worker consumes the queue and sends messages.

242
SeniorAdvanced

What is the transactional outbox pattern and when would you use it?

The transactional outbox pattern addresses the problem of updating a database and publishing a message as one logical business operation when there is no distributed transaction across both systems.

243
SeniorAdvanced

How would you perform a zero-downtime deployment when the database schema changes?

Use backward-compatible schema evolution so the old and new application versions can operate during the deployment overlap. A common expand-and-contract approach first adds compatible schema, then deploys code that can use it, migrates data if necessary, and only later removes obsolete columns or behavior.

244
SeniorAdvanced

How would you handle configuration and secrets across multiple environments?

Keep ordinary non-secret defaults in configuration files and override environment-specific values through deployment configuration. Store passwords, API keys, certificates, and signing credentials in a protected secret store or platform secret mechanism rather than source control.

245
SeniorAdvanced

How would you design API versioning for a public ASP.NET Core API?

Version an API when incompatible contract changes must coexist with existing clients. Decide whether versions are expressed in the URL, query string, header, or media type and keep the convention consistent.

246
SeniorAdvanced

How would you protect an API from abusive or unexpectedly expensive clients?

Require authentication where appropriate and apply authorization to sensitive operations. Add rate limiting or concurrency limiting based on a meaningful partition such as client identity, API key, tenant, or endpoint.

247
SeniorAdvanced

How would you investigate intermittent 500 errors that cannot be reproduced locally?

Use centralized structured logs, exception details in protected telemetry, correlation or trace IDs, and distributed traces. Capture the request path, application version, instance, dependency timings, and safe contextual identifiers so failures can be grouped and compared.

248
SeniorAdvanced

How would you make an ASP.NET Core application resilient to a dependency outage?

Set bounded timeouts so calls fail promptly instead of consuming resources indefinitely. Use limited retries with backoff only for transient and retry-safe operations, and use circuit-breaking behavior when repeated failures indicate a dependency is unavailable.

249
SeniorAdvanced

How would you review an ASP.NET Core application before a production release?

Verify that Release builds and automated tests pass, configuration is valid, migrations are reviewed, secrets are externalized, and production error handling does not expose internals. Review authentication, authorization, anti-forgery requirements, CORS, upload/request limits, forwarded headers, HTTPS, and security-sensitive cookies.

250
SeniorAdvanced

How would you explain the architecture of a production ASP.NET Core application in a senior interview?

Start from the request boundary and explain responsibilities rather than listing technologies. Describe how traffic reaches the host, how middleware handles cross-cutting concerns, how routing reaches controllers or endpoints, and how application services coordinate business use cases.