📁 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.

Profiling

BenchmarkDotNet, the Visual Studio profiler, dotnet-counters, dotnet-trace, dotnet-dump, dotnet-gcdump, dotnet-monitor, PerfView, the Application Insights Profiler and load testing.

  1. What are the main .NET diagnostics tools? Explain what dotnet-counters, dotnet-trace, dotnet-dump, dotnet-gcdump and dotnet-monitor each tell you, and which one you reach for first when a service misbehaves.

    The .NET diagnostics CLI toolbox: what dotnet-counters, dotnet-trace, dotnet-dump, dotnet-gcdump and dotnet-monitor each capture, their overhead, and the order you use them in.

    Junior Theory Profiling Β· πŸ”— 3 follow-ups
  2. How do you write a correct benchmark with BenchmarkDotNet? Show a benchmark that compares two implementations, and explain [MemoryDiagnoser], baselines, [Params], and how you avoid dead-code elimination and other traps that make results meaningless.

    Writing trustworthy micro-benchmarks with BenchmarkDotNet on .NET 10: Release builds, warm-up and statistics, MemoryDiagnoser, baselines and ratios, Params, returning results to defeat dead-code elimination, and reading the results table.

    Intermediate Coding Profiling Β· πŸ”— 2 follow-ups
  3. How do you CPU-profile a .NET service with dotnet-trace? Explain how sampling works, how you read a flame graph or call tree in PerfView, Speedscope or Visual Studio, the difference between inclusive and exclusive time, and how you go from a hot frame to a fix.

    CPU profiling .NET 10 services: EventPipe stack sampling with dotnet-trace, flame graphs and call trees in PerfView, Speedscope and Visual Studio, inclusive vs exclusive time, wall-clock vs CPU time, and turning a hot path into a verified fix.

    Mid-Level Theory Profiling Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  4. Your API's memory grows steadily for hours until the container is OOM-killed and restarted. How do you use dotnet-counters and dotnet-gcdump snapshots to find what is growing and what keeps it alive, and how do you fix and verify it?

    Diagnosing managed memory growth in .NET 10: confirming it with GC counters, comparing dotnet-gcdump snapshots in Visual Studio or PerfView, reading retention paths to the GC root, common leak roots (static caches, events, DI scopes, timers), and verifying the fix.

    Mid-Level Debugging Profiling Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  5. How do you profile a .NET service safely in production? Explain how you would use dotnet-monitor in containers and the Application Insights Profiler, what overhead each adds, and how you handle the security and privacy risks of traces and dumps.

    Production profiling for .NET 10: dotnet-monitor as a sidecar with collection rules and egress, the Application Insights Profiler (classic SDK and the OpenTelemetry preview), overhead and blast radius, authentication, and Privacy Act obligations for diagnostic artefacts.

    Senior Theory Profiling Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  6. How do you load test a .NET API properly? Explain how you design a realistic workload with k6 or Azure Load Testing, open vs closed load models and coordinated omission, how you read percentiles, and how you find the breaking point.

    Load testing ASP.NET Core APIs: test types (smoke, load, stress, soak, spike), realistic workload modelling, open vs closed models and coordinated omission, k6 and Azure Load Testing, reading p50/p95/p99 and finding the saturation point with server-side metrics.

    Mid-Level Theory Profiling Β· πŸ”— 2 follow-ups Β· πŸ›  1 real-world
  7. One endpoint is slow only in production: p95 is 3 seconds there but 150 ms in staging and locally, and you can't reproduce it. What is your plan to find out why, which tools do you use at each step, and how do you prove the fix?

    A production-only slow endpoint with no repro: listing what differs in production (data, concurrency, configuration, dependencies, tenants), slicing telemetry to isolate the slow subset, then targeted evidence from distributed traces, Query Store, the Application Insights Profiler and dotnet-monitor triggers, and proving the fix with production percentiles.

    Senior RealWorldScenario Profiling Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world

🌐 Sangam's Webring

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