📁 Sangam Dhakal - Portfolio v2.0 - Netscape Navigator 4.0
_
□
×

πŸ“š .NET Interview Questions

1325 questions for senior .NET engineer interviews, each with a 30-second answer, the full answer, a deep dive, the follow-ups interviewers ask next, and real-world production problems.

Phase 22 — Production Engineering

Keeping .NET systems healthy in production: diagnosing memory leaks, high CPU, starvation, deadlocks, timeouts and exhaustion; the production toolset; root cause analysis; and the senior responsibilities of owning incidents and reducing recurrence.

  1. What is ReDoS, and how do you stop catastrophic regex backtracking in .NET?
    Mid-Level Debugging Debugging Production Issues
  2. How do you tell a managed memory leak from native memory growth in a .NET process?

    Separating managed heap growth from native memory growth in a .NET process, and the tools for each.

    Senior Theory Debugging Production Issues
  3. It's 2 am and the alert says your order API pods are being OOMKilled and restarted every three hours, starting the day after Tuesday's release. Walk me through your playbook: what you do in the first five minutes, how you capture evidence before the next restart wipes it, how you tell a managed leak from native memory growth, and how you get from dump diffs to the leaking root and a fix.

    A production playbook for a memory leak that ends in OOMKilled restarts: mitigation, evidence capture with dotnet-counters, dotnet-monitor and dotnet-gcdump, managed versus native growth, dump diffing with gcroot, the fix and prevention.

    Mid-Level Debugging Debugging Production Issues Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  4. One of your eight API instances is pinned at 100% CPU, its requests are slow, and the others look normal. How do you diagnose and fix it? Walk me through what you do first, how you use dotnet-counters and dotnet-trace to find the hot code, the usual culprits (a runaway loop, catastrophic regex backtracking, a hot lock, GC), and how you mitigate while you work on the fix.

    A production playbook for one instance stuck at 100% CPU: isolating the instance, dotnet-counters triage, a dotnet-trace CPU sample, reading the hot path, and the usual causes such as regex backtracking, runaway loops, spin contention and GC.

    Mid-Level Debugging Debugging Production Issues Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  5. During a sale, your ASP.NET Core API's response times jump from 100 ms to 30 seconds, health probes start failing and Kubernetes restarts pods, which makes it worse, yet CPU sits at 20%. How do you confirm it's ThreadPool starvation, stop the bleeding during the incident, find the blocking code, and make sure it doesn't happen again?

    An incident playbook for ThreadPool starvation under load: the low-CPU signature, the probe-restart death spiral, confirming with dotnet-counters and a dump, emergency mitigations such as SetMinThreads, finding sync-over-async and preventing it.

    Senior Debugging Debugging Production Issues Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  6. Every few days one instance of your .NET order service stops responding completely: its requests hang forever, CPU drops to almost zero, it never recovers on its own, and restarting it "fixes" it until next time. How do you confirm it's a deadlock, capture the evidence before anyone restarts it, read the dump with syncblk, clrstack and pstacks, and fix the lock ordering or async misuse behind it?

    A production playbook for an intermittent deadlock: the frozen-instance signature, capturing a dump before restart, reading it with SOS (syncblk, clrstack, pstacks, dumpasync), lock-order and async-blocking causes, the fix and prevention.

    Senior Debugging Debugging Production Issues Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  7. Your API's timeout rate jumps from 0.1% to 8% at 10 am on a weekday. Your service calls SQL Server, Redis and two downstream HTTP APIs. How do you work out quickly whether the slowness is in your own code or in a dependency, using distributed traces, dependency metrics and runtime counters, and what do you do about it in each case?

    A production playbook for a spike in API timeouts: using Application Insights end-to-end traces, dependency duration and failure metrics, runtime counters and KQL to separate your own slowness from a dependency's, then mitigating with timeouts, circuit breakers and fallbacks.

    Mid-Level Debugging Debugging Production Issues Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  8. Your API starts throwing "Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached." Walk me through how you diagnose and fix SQL connection pool exhaustion: what you do in the first minutes, how you tell a leak from slow queries or too much concurrency, and how you stop it happening again.

    A production playbook for SQL connection pool exhaustion in .NET: the error, how the SqlClient pool works, distinguishing leaked connections from long-held connections and genuine concurrency, the counters and queries to check, the fix and prevention.

    Mid-Level Debugging Debugging Production Issues Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  9. Your Redis cache becomes unreachable during peak hours. Within a minute every request falls through to SQL Server, database CPU hits 100%, the API starts timing out, and even when Redis comes back the database doesn't recover. Walk me through the incident: how you stop the collapse, how you bring the cache back without a second stampede, and how you redesign so a cache failure degrades the service instead of taking it down.

    A production playbook for a cache outage that collapses the database: why fall-through overloads SQL, immediate load shedding and protection, warming the cache safely, and designing cache-failure handling with timeouts, circuit breakers, a local L1 cache, stampede protection and capacity for a cold cache.

    Senior Debugging Debugging Production Issues Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  10. The pipeline says the deployment succeeded, but the new version of your ASP.NET Core API won't start: App Service shows HTTP 500.30, or the Kubernetes pods are in CrashLoopBackOff. How do you find out why quickly, what are the usual causes (configuration, missing secrets or Key Vault access, migrations, a missing dependency, a port or health check mismatch), and how do you make deployments that can't go green while the app is broken?

    A production playbook for a deployment that succeeds but whose app fails to start: getting the startup exception from App Service and Kubernetes, the usual causes (configuration, secrets, managed identity, migrations, missing native dependencies, ports and probes), rollback, and making the pipeline verify startup.

    Mid-Level Debugging Debugging Production Issues Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  11. At 9:05 on a Monday, support reports that users suddenly can't sign in to your web app, and nobody deployed anything over the weekend. Your app uses OpenID Connect with Microsoft Entra ID (or another identity provider) and cookie sessions. How do you work out what broke: an expired client secret or certificate, signing key rollover, clock skew, lost Data Protection keys, or an identity provider outage, and how do you fix and prevent each?

    A production playbook for sudden sign-in failures with no deployment: reading the OIDC error, and the usual time-based causes such as expired client secrets or certificates, signing key rollover with cached metadata, clock skew, lost Data Protection keys and identity provider outages, with fixes and prevention.

    Mid-Level Debugging Debugging Production Issues Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  12. Every weekday your invoice-processing queue on Azure Service Bus starts growing at about 9 am, peaks around 2 pm with a backlog of 400,000 messages, and only drains overnight. Customers complain that invoices take hours to appear. Nothing is failing outright. How do you work out why with throughput maths, decide between scaling consumers and fixing the handler, handle any poison messages hiding in the backlog, and set this up so you'd see it coming?

    A production scenario for a queue backlog that grows every business day: arrival rate versus service rate and Little's law, measuring handler throughput, the limits of scaling out (downstream bottlenecks, ordering, locks), fixing the handler with batching and concurrency, poison messages, KEDA autoscaling and backlog-age alerts.

    Senior RealWorldScenario Debugging Production Issues Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  13. How would you run a percentage rollout of a risky change and decide, with data, whether to go to the next step or roll it back?
    Mid-Level Theory Production Tools
  14. During a production incident you have logs, metrics, distributed traces and memory dumps available. What is each one, which question does each answer best, and in what order would you reach for them when an alert fires on your .NET API?

    Covers the four production signals (metrics, traces, logs, dumps): what each records, its cost, which incident question it answers, how they link through trace ids, and the order a responder uses them in.

    Junior Theory Production Tools Β· πŸ”— 3 follow-ups
  15. You need a memory dump from a .NET 10 API running in production on Kubernetes or App Service. How do you capture it safely? Compare dotnet-dump, dotnet-gcdump, createdump on crash and dotnet-monitor collection rules, and explain how you deal with the process pause, file size, disk space and the personal data inside the dump, and how you analyse it offline.

    Covers capturing dumps in production safely: dump types (full, heap, triage, gcdump), dotnet-dump, createdump environment variables, dotnet-monitor sidecars and triggers, pause and size impact, storage and Privacy Act handling, and offline analysis.

    Intermediate Theory Production Tools Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  16. How do you use feature flags as an incident tool rather than just a release tool? Explain kill switches, gradual percentage rollouts and targeting, how you implement them in .NET with Microsoft.FeatureManagement and Azure App Configuration, how fast a change reaches running instances, and how you stop old flags from becoming a liability.

    Covers feature flags for operations: kill switches and safe defaults, percentage and targeted rollouts, Microsoft.FeatureManagement with Azure App Configuration refresh, propagation delay, auditing flag changes, and flag clean-up and expiry.

    Mid-Level Theory Production Tools Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  17. What makes a good runbook? Your on-call engineer gets paged at 3 am for an alert on a .NET service they've never touched. What should the runbook linked from that alert contain (symptoms, checks, safe actions, escalation), how do you write it so a tired stranger can follow it, and how do you stop runbooks going stale?

    Covers runbook design: one runbook per alert, the structure (impact, triage checks, safe mitigations, verification, escalation), exact commands and queries, writing for a stranger under stress, automation, and keeping runbooks current through drills and post-incident updates.

    Mid-Level Theory Production Tools Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  18. Your team is about to take a new .NET 10 service live on Azure. As the senior engineer, what has to be true before you agree it's production ready? Walk me through your production readiness checklist: observability, alerting and on-call, resilience, capacity, deployment and rollback, security and data, and operational documentation, and how you run the review without it becoming a box-ticking exercise.

    Covers production readiness reviews: the checklist across observability, SLOs and alerting, on-call and runbooks, resilience and dependencies, capacity and load testing, deployment and rollback, security and privacy, data backup and restore, and how to run the review so it changes outcomes.

    Senior Architecture Production Tools Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  19. Your five whys ends with "the cloud provider had an outage". Is that a valid root cause? What do you do next?
    Mid-Level Theory RCA
  20. A bug may have shown some customers' addresses to other customers. Walk me through your obligations and the first steps under the Notifiable Data Breaches scheme.
    Mid-Level Theory RCA

🌐 Sangam's Webring

βͺ Previous 🏠 Main Next ⏩
πŸ’¬ Chat with me