📁 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 20 — Observability and Monitoring

Seeing inside running .NET 10 systems: log platforms, metrics, distributed tracing with OpenTelemetry, health checks, SLOs and alerting, and the incident response process that turns signals into fixes.

  1. Your team needs a central place for logs from a set of .NET 10 services on Azure. Compare Application Insights with Log Analytics, Seq, the ELK stack or OpenSearch, and Grafana Loki. How do they store and index logs, what do they cost to run and retain, and how would you choose?

    Compares the main log platforms for .NET teams (Application Insights and Log Analytics, Seq, Elasticsearch/OpenSearch, Grafana Loki) on storage and indexing model, query language, licensing, cost drivers, retention tiers and Australian data residency, and how to choose.

    Intermediate Theory Log Management Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  2. What is your log level strategy for a .NET 10 service in production? What belongs at Trace, Debug, Information, Warning, Error and Critical, how do you change levels at runtime without a redeploy, and how do you stop a log flood from hurting the service and the bill?

    Production log level policy for .NET: what each level means, category filters, changing levels at runtime (reloadable configuration, Azure App Configuration, Serilog level switches), log sampling and buffering, rate limiting, and protecting the service and budget from log floods.

    Mid-Level Theory Log Management Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  3. Customers report that checkout failed for some of them in the last hour. Using KQL in Application Insights (Log Analytics), show how you would find which operations are failing, how the failures break down by result code and exception, and how you would follow one failed request across services by its trace id.

    Hands-on KQL for incident questions in workspace-based Application Insights: failure rate by operation over time, breakdown by result code, exception and role, joining requests, dependencies, exceptions and traces by OperationId (the W3C trace id), and turning the query into an alert.

    Mid-Level Coding Log Management Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  4. You run about 30 .NET services on Kubernetes and Azure. Design the logging pipeline: how logs get from the services to storage, where you enrich, filter, sample and mask them, and how you set retention by data class. Where does the OpenTelemetry Collector fit, and what are the failure modes?

    Architecture of a multi-service logging pipeline: OTLP from .NET services, OpenTelemetry Collector agent and gateway tiers, enrichment with Kubernetes and resource attributes, filtering and sampling, masking personal data, routing by data class to different backends and retention, back-pressure and failure modes.

    Senior Architecture Log Management Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  5. Show me how you would add custom business metrics to a .NET 10 service with System.Diagnostics.Metrics: create a Meter, a Counter<T> and a Histogram<T>, choose names, units and tags, export them with OpenTelemetry, and prove in a unit test that they are recorded.

    Covers writing custom metrics with Meter, IMeterFactory, Counter<T>, Histogram<T> and ObservableGauge<T>, naming and unit conventions, bounded tags, histogram bucket advice, exporting via OpenTelemetry (OTLP, Azure Monitor, Prometheus) and testing with MetricCollector<T>.

    Mid-Level Coding Metrics Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  6. Your team runs .NET 10 services on AKS and has to choose between Prometheus with Grafana and Azure Monitor (Application Insights metrics, Azure Monitor managed Prometheus) for metrics. Explain scraping versus pushing, how each stores and queries metrics, how cardinality drives cost in each, and how you would decide.

    Covers the pull (Prometheus scrape) and push (OTLP, Azure Monitor exporter) models, self-hosted Prometheus and Grafana versus Azure Monitor managed Prometheus, Azure Managed Grafana and Application Insights metrics, PromQL versus KQL, cardinality limits and cost drivers, and a decision framework.

    Mid-Level Theory Metrics Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  7. A developer added the user id as a tag on a request metric. A week later Prometheus memory has tripled, dashboards time out, and the managed Prometheus bill has jumped. How do you confirm cardinality is the cause, find the offending metric and label, stop the bleeding, and fix it so it doesn't happen again?

    Covers diagnosing a metric cardinality explosion (series counts, top metrics and labels with PromQL, workspace ingestion metrics), immediate mitigation (Collector or relabel drop, SDK views and cardinality limits), the code fix, where per-user data belongs instead, and guardrails.

    Senior Debugging Metrics Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  8. Your team has forty Grafana dashboards, and during the last outage nobody could tell from them what was broken. Design a service dashboard that on-call engineers actually use during an incident: what goes at the top, how it is laid out, which queries drive it, how it links to traces and logs, and how you keep dashboards from rotting.

    Covers designing incident-ready service dashboards: SLO and RED at the top, dependencies and USE below, deploy and change annotations, consistent templates as code, drill-down links to traces and logs, query performance, ownership and review to avoid dashboard sprawl.

    Senior Architecture Metrics Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  9. What is the difference between a counter, a gauge and a histogram? Give an example of each from a .NET 10 web API, and tell me which metrics ASP.NET Core and the .NET runtime already publish for you before you write any code.

    Covers the three core metric instrument types (counter, gauge, histogram), the System.Diagnostics.Metrics instruments that implement them, and the built-in ASP.NET Core, HttpClient and System.Runtime metrics in .NET 10.

    Junior Theory Metrics Β· πŸ”— 3 follow-ups
  10. Your dashboard shows an average response time of 120 ms and everyone is happy, but customers say the site is slow. Why are averages misleading for latency? Explain p50, p95, p99 and p99.9, how percentiles are calculated from histograms, and why you can't average percentiles across instances or time windows.

    Covers why averages hide tail latency, what p50/p95/p99/p99.9 mean, how percentiles are estimated from histogram buckets, why percentiles cannot be averaged, and how to query them in Prometheus and KQL.

    Intermediate Theory Metrics Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  11. What are the RED and USE methods? Explain rate, errors and duration, and utilisation, saturation and errors, which one you apply to a service and which to a resource like a database, node or thread pool, and what you would put on the dashboard for a .NET API.

    Covers the RED method for request-driven services and the USE method for resources, how they map to built-in .NET and Azure metrics, how they relate to Google's four golden signals, and how to use them to structure dashboards and triage.

    Intermediate Theory Metrics Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  12. What is distributed tracing? Explain traces, spans and parent/child relationships, what a trace id and span id are, and why logs alone aren't enough to understand a request that crosses several services.

    Covers what distributed tracing is, the trace and span model with parent/child links and ids, and why correlated logs alone can't show where time goes across services.

    Junior Theory Tracing Β· πŸ”— 3 follow-ups
  13. What are Activity and ActivitySource in .NET, and how do they map to OpenTelemetry spans? Explain how you create an Activity, why StartActivity can return null, what Activity.Current is, and how tags, events, status and ActivityKind correspond to the OpenTelemetry span model.

    Covers System.Diagnostics.Activity and ActivitySource as .NET's span API, listeners and sampling (null activities), Activity.Current flow, and the mapping of tags, events, status, kind and links to OpenTelemetry.

    Intermediate Theory Tracing Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  14. Show me how you add custom spans and attributes to a .NET 10 service and propagate the trace context through Azure Service Bus messages so the consumer's work appears in the same trace. Cover Producer and Consumer spans, injecting and extracting the context, messaging semantic conventions, and when to use span links instead of parent/child.

    Covers writing custom spans with ActivitySource, injecting and extracting W3C trace context through Service Bus application properties, Producer/Consumer span kinds, messaging semantic conventions, span links for batches, and the Azure SDK's experimental tracing flag.

    Mid-Level Coding Tracing Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  15. Explain W3C Trace Context. What is in the traceparent and tracestate headers, what is W3C Baggage and when should you use it, how does .NET propagate these headers (and what changed in .NET 10), and how do you handle trace context when crossing into other vendors' systems or accepting it from the public internet?

    Covers the traceparent and tracestate formats, the sampled flag, W3C Baggage and its risks, DistributedContextPropagator and the .NET 10 switch to the W3C propagator, interoperating with B3 and vendors, and trust boundaries at the public edge.

    Mid-Level Theory Tracing Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  16. How do you sample traces in production? Compare head-based and tail-based sampling, explain parent-based and trace-id-ratio samplers, how you make sure errors and slow requests are always kept, what Application Insights and the Azure Monitor distro do, and how you balance cost against visibility.

    Covers head sampling (ParentBased, TraceIdRatioBased, rate-limited), tail sampling in the OpenTelemetry Collector with its load-balancing requirement, keeping errors and slow traces, Azure Monitor sampling and item counts, and the cost/visibility trade-off.

    Senior Theory Tracing Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  17. Your traces are broken. In Application Insights a checkout shows the API request but not the downstream pricing call's server span, background jobs and Service Bus consumers appear as separate traces, and some traces have orphan spans with missing parents. How do you find where trace context is being lost, and how do you fix each cause?

    Covers diagnosing broken distributed traces: confirming propagation on the wire, missing AddSource or instrumentation, inconsistent sampling, gateways stripping headers, Activity.Current lost across queues and background work, messaging without propagation, mixed propagation formats and split backends.

    Senior Debugging Tracing Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  18. Jaeger, Zipkin, Grafana Tempo or Application Insights: what does each give you as a tracing backend, how do you get traces into them from .NET using OTLP and the OpenTelemetry Collector, and how would you choose for a team running .NET 10 services on Azure?

    Compares Jaeger v2, Zipkin, Grafana Tempo and Application Insights on features, storage, cost and operations, explains OTLP export directly or via the Collector, the deprecated Zipkin exporter, and a decision approach for Azure-hosted .NET teams.

    Mid-Level Theory Tracing Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  19. What is the difference between an SLI, an SLO and an SLA? How do you choose good SLIs for a .NET API, turn a latency percentile into an SLO, and calculate and use an error budget?

    Defines SLI, SLO and SLA, covers choosing user-centred SLIs and where to measure them, turning latency percentiles into ratio-based SLOs from histograms, error budget maths and an error budget policy.

    Mid-Level Theory Health and Alerts Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  20. Design the alerting for a set of .NET services on Azure. Why do you alert on symptoms and SLO burn rate rather than causes such as high CPU, how do multi-window burn-rate alerts work, how do you set severities and route alerts to the right people, and what does every alert need?

    Covers alerting design: symptom versus cause alerts, SLO burn-rate maths and multi-window rules, low-traffic services, severity and routing to owning teams, runbooks and alert metadata, and alerts as code with Azure Monitor and Prometheus.

    Senior Architecture Health and Alerts Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world

🌐 Sangam's Webring

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