📁 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 25 — Cloud-Native .NET

Building cloud-native .NET 10 applications: .NET Aspire for local orchestration, service discovery, configuration and telemetry; the twelve-factor and cloud-native patterns; and awareness of tools such as Dapr, service meshes, the OpenTelemetry Collector and Backstage.

  1. How do you build a .NET Aspire AppHost? Show how you add projects, SQL Server and Redis containers and references, and what WithReference and WaitFor actually do.

    Writing an Aspire AppHost: AddProject, AddSqlServer/AddDatabase, AddRedis, WithReference, WaitFor, data volumes and persistent containers, parameters for secrets, and how references become environment variables.

    Junior Coding .NET Aspire Β· πŸ”— 3 follow-ups
  2. What is Aspire (formerly .NET Aspire), and what problem does it solve for a team building several services on .NET 10? Explain the AppHost, what happens when you press F5 or run `aspire run`, and what Aspire is not.

    What Aspire is, the local distributed-development problem it solves, the AppHost and the developer inner loop, the dashboard, and the limits of what Aspire does.

    Beginner Theory .NET Aspire Β· πŸ”— 3 follow-ups
  3. What do Aspire service defaults give you? Walk through AddServiceDefaults and MapDefaultEndpoints: the OpenTelemetry, health check, service discovery and HTTP resilience set-up, and what you would change before production.

    The Aspire ServiceDefaults project: ConfigureOpenTelemetry with OTLP export, default health checks and the /health and /alive endpoints, service discovery, the standard resilience handler, and production hardening.

    Intermediate Theory .NET Aspire Β· πŸ”— 3 follow-ups
  4. How does Aspire service discovery and configuration work? Explain how connection strings and endpoints reach each service, what the https+http:// scheme means, and how the same code finds its dependencies when deployed.

    Aspire's configuration flow from AppHost references to environment variables, Microsoft.Extensions.ServiceDiscovery and its configuration provider, the https+http:// scheme and named endpoints, parameters, and how discovery works on Container Apps and Kubernetes.

    Intermediate Theory .NET Aspire Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  5. What are Aspire integrations? Explain the difference between hosting and client integrations, what a client integration adds beyond the plain SDK, and how you add Azure resources such as Service Bus and Storage, run them locally or provision them in Azure, and connect to ones that already exist.

    Aspire hosting vs client integrations, what client integrations register (DI, health checks, telemetry, resilience, configuration), Azure hosting integrations with emulators, local provisioning and existing resources, customising generated Bicep, and community integrations.

    Mid-Level Theory .NET Aspire Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  6. How do you use the Aspire dashboard while developing and debugging? Explain what the resources, console logs, structured logs, traces and metrics views show, how telemetry gets there, how you'd use it to find a slow or failing request across services, and why it isn't a production monitoring tool.

    The Aspire dashboard: resources and resource commands, console vs structured logs, traces and span details, metrics, how OTLP telemetry reaches it, the standalone dashboard, telemetry limits and security, and using it to debug cross-service problems.

    Mid-Level Theory .NET Aspire Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  7. How do you deploy an Aspire application? Explain aspire publish and aspire deploy, azd up to Azure Container Apps, generating Kubernetes (Helm) or Docker Compose output, how secrets, identity and the database get handled, and what Aspire does and doesn't do for you in production.

    Deploying Aspire apps: compute environments (Container Apps, Kubernetes, Docker Compose, App Service), aspire publish vs aspire deploy vs azd, generated Bicep and Helm, parameters and secrets, managed identity, migrations, CI/CD, and Aspire's responsibilities and limits in production.

    Senior Theory .NET Aspire Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  8. Your organisation already runs .NET services on a Kubernetes platform managed by a platform team, and a team wants to adopt Aspire. How do you evaluate it? Cover the benefits, the costs and lock-in, how it fits with existing Helm, GitOps and observability tooling, and how you would roll it out or decide against it.

    Evaluating Aspire adoption: benefits for the inner loop and consistency, lock-in and version churn, fit with an existing Kubernetes platform, Helm and GitOps, observability standards, adoption options (local-only, testing, full deployment), and how to decide and measure.

    Senior Architecture .NET Aspire Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  9. Your ASP.NET Core app works with one replica, but after scaling to three, users are randomly logged out and antiforgery validation fails. What is wrong?
    Junior Theory Cloud-Native Patterns
  10. What is the difference between IOptions<T>, IOptionsSnapshot<T> and IOptionsMonitor<T>, and which do you use when configuration can change at run time?
    Intermediate Theory Cloud-Native Patterns
  11. What is the twelve-factor app? Walk me through the factors that matter most for a .NET service and map each one to an ASP.NET Core feature, and tell me which factors you would bend in practice.

    Covers the twelve-factor methodology and maps codebase, dependencies, config, backing services, build/release/run, stateless processes, port binding, concurrency, disposability, dev/prod parity, logs and admin processes to ASP.NET Core and .NET 10 features.

    Junior Theory Cloud-Native Patterns Β· πŸ”— 3 follow-ups
  12. How do you externalise configuration and secrets for a .NET service running in the cloud? Compare environment variables, Azure App Configuration, Azure Key Vault and secrets mounted as files, explain how each reaches IConfiguration, and how you handle refresh and rotation.

    Covers externalised configuration for cloud-hosted .NET services: environment variables, Azure App Configuration, Key Vault (direct and via references), Kubernetes and Container Apps secrets mounted as files with the key-per-file provider, managed identity, refresh with IOptionsMonitor and secret rotation.

    Intermediate Theory Cloud-Native Patterns Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  13. How do graceful shutdown and container readiness work for an ASP.NET Core service on Kubernetes or Azure Container Apps? Explain what happens from SIGTERM to process exit, the role of IHostApplicationLifetime and HostOptions.ShutdownTimeout, connection draining, and how startup and readiness probes stop traffic reaching a pod that is not ready.

    Covers the container lifecycle for a .NET service: startup, readiness and liveness probes, the SIGTERM to SIGKILL sequence and terminationGracePeriodSeconds, the Generic Host's shutdown path, IHostApplicationLifetime events, HostOptions.ShutdownTimeout, preStop delays for endpoint propagation and draining background work.

    Mid-Level Theory Cloud-Native Patterns Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  14. How should cloud-native .NET services talk to each other? Compare synchronous HTTP/JSON, gRPC and asynchronous messaging, explain how you secure the call with service identity and mTLS, and how you decide which style to use for a given interaction.

    Covers service-to-service communication for .NET services: HTTP/JSON with IHttpClientFactory and the standard resilience handler, gRPC over HTTP/2, messaging with Azure Service Bus, temporal coupling, service identity with Entra ID tokens and managed identity, mTLS from a service mesh or platform, and how to choose per interaction.

    Mid-Level Theory Cloud-Native Patterns Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  15. You are the senior engineer setting standards for new .NET services that will run on Azure Container Apps or AKS. What goes on your cloud-native service checklist? Cover statelessness, health, telemetry, resilience, configuration and secrets, security and operability, and explain how you would enforce it across teams without slowing them down.

    Covers a cloud-native readiness checklist for .NET services: stateless design, probes and graceful shutdown, OpenTelemetry logs, metrics and traces, resilience and timeouts, externalised config and managed identity, container security, scaling and operability, and enforcing it through a service template, Aspire service defaults, pipeline gates and platform policy.

    Senior Architecture Cloud-Native Patterns Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  16. Tell me about taking an existing ASP.NET Core API that ran on VMs or App Service and making it cloud-native on Azure Container Apps or AKS. What did you find that stopped it running well in containers, what did you change and in what order, and how did you prove it was ready?

    Covers a real migration of an existing ASP.NET Core API to Azure Container Apps or AKS: auditing for hidden state, baked-in config, file-based logs and ignored shutdown; containerising; externalising config and secrets with managed identity; probes, telemetry, resilience and scaling; and proving readiness with chaos and load tests.

    Senior RealWorldScenario Cloud-Native Patterns Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  17. Code review: a teammate's ASP.NET Core service, about to be deployed to Kubernetes, saves uploaded files and a SQLite cache to the container's local disk, reads its settings (including an API key) from a config.json copied into the image, logs to a rolling file, and runs a background loop that ignores the stopping token. What do you flag, in what order, and what does the fixed version look like?

    A code review of a container-unfriendly ASP.NET Core service: local disk state, secrets in a config file baked into the image, file logging, a BackgroundService that ignores SIGTERM, and missing probes; findings ranked by severity with a cloud-native rewrite using Blob Storage, IConfiguration with Key Vault, stdout logging, cancellation and health endpoints.

    Senior CodeReview Cloud-Native Patterns Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  18. What is Dapr? Explain its building blocks (service invocation, state, pub/sub, bindings, workflow), how the sidecar model works, and when it actually helps a .NET team rather than just adding another moving part.

    Covers Dapr as a portable runtime: the daprd sidecar and its HTTP/gRPC API, the main building blocks, components that swap the backing service by YAML, the .NET SDK (Dapr.Client, Dapr.AspNetCore, Dapr.Workflow), Dapr on Azure Container Apps and AKS, and when to choose it over plain Azure SDKs.

    Intermediate Theory Optional Advanced Tools Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  19. What is a service mesh? Compare Istio (sidecar and ambient mode), Linkerd and Envoy: what mTLS, traffic shifting and observability they give a .NET platform, what they cost to run, and when you would not use one.

    Covers service meshes: data plane versus control plane, Envoy as a proxy, Istio sidecar and ambient (ztunnel and waypoint) modes, Linkerd's Rust micro-proxy, automatic mTLS, retries and traffic splitting, golden-signal metrics, operational cost, and alternatives such as Container Apps or plain Kubernetes.

    Mid-Level Theory Optional Advanced Tools Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  20. What is the OpenTelemetry Collector? Explain receivers, processors, exporters and pipelines, agent versus gateway deployment, and why you would put a Collector between your .NET services and Application Insights or another vendor instead of exporting directly.

    Covers the OpenTelemetry Collector: OTLP receivers, processors (memory_limiter, batch, attributes, filter, tail_sampling), exporters (Azure Monitor, Prometheus, OTLP), pipelines per signal, core versus contrib distributions, agent and gateway patterns, and the trade-off against direct export from the .NET SDK or the Azure Monitor distro.

    Mid-Level Theory Optional Advanced Tools Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world

🌐 Sangam's Webring

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