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

Containers

Docker, Dockerfiles, multi-stage builds, Docker Compose, container registries, Kubernetes pods, deployments, services, ingress, ConfigMaps and secrets, resource limits and Helm for .NET 10.

  1. What is the difference between the .NET sdk, aspnet, runtime, runtime-deps and chiseled container images, and which do you use for what?
    Junior Theory Containers
  2. Your chiseled .NET container has no shell. How do you debug it in production?
    Intermediate Coding Containers
  3. How do you run integration tests against a real SQL Server in CI using Testcontainers?
    Junior Theory Containers
  4. How would you run EF Core migrations when deploying a .NET service to Kubernetes with Helm, and how do you keep rollback safe?
    Mid-Level Theory Containers
  5. What is a container, and how is it different from a virtual machine? Explain images versus containers, image layers, and why most teams now ship .NET services as containers.

    Containers versus VMs (shared kernel, namespaces and cgroups), images versus running containers, layered images and caching, and why .NET 10 services are shipped as container images.

    Junior Theory Containers Β· πŸ”— 3 follow-ups
  6. Write a production Dockerfile for a .NET 10 ASP.NET Core API. Explain the multi-stage build, layer caching for NuGet restore, chiseled base images and running as a non-root user, and when you would use dotnet publish container support instead of a Dockerfile.

    A production-grade multi-stage Dockerfile for .NET 10 (restore caching, publish, chiseled aspnet runtime, non-root, port 8080, .dockerignore) and the Dockerfile-less alternative with dotnet publish /t:PublishContainer.

    Intermediate Coding Containers Β· πŸ”— 3 follow-ups
  7. How would you use Docker Compose to run a .NET 10 API locally with SQL Server and Redis? Explain services, networks, volumes, health checks and depends_on, and when you would use .NET Aspire or Testcontainers instead.

    Docker Compose for local .NET development: compose.yaml services for the API, SQL Server and Redis, service-name DNS, named volumes, health checks with depends_on conditions, environment configuration, and the Aspire and Testcontainers alternatives.

    Junior Theory Containers Β· πŸ”— 3 follow-ups
  8. Explain the Kubernetes basics a .NET developer needs: pods, deployments, ReplicaSets, services, ingress (and the Gateway API), ConfigMaps and secrets. How does a request reach your ASP.NET Core container, and how does configuration get into it?

    Core Kubernetes objects for .NET developers (pod, deployment, ReplicaSet, service, ingress and Gateway API, ConfigMap, secret, probes), the request path to an ASP.NET Core container, and how configuration and secrets are injected.

    Intermediate Theory Containers Β· πŸ”— 3 follow-ups
  9. How should you set Kubernetes CPU and memory requests and limits for a .NET 10 service? Explain how the GC and the thread pool read container limits, what CPU throttling does to latency, when to use DOTNET_GCHeapHardLimit or GCHeapHardLimitPercent, and how you size a pod from measurements.

    Sizing .NET 10 pods: requests versus limits, QoS classes, how the runtime reads cgroup limits (ProcessorCount, GC heap hard limit at 75%), Server GC and DATAS, CFS CPU throttling and its latency impact, GC heap limit settings, and a measurement-driven sizing method.

    Mid-Level Theory Containers Β· πŸ”— 2 follow-ups Β· πŸ›  1 real-world
  10. A .NET 10 pod is stuck in CrashLoopBackOff, and another one is restarting with OOMKilled. Walk me through how you debug each with kubectl, logs and events, and how you tell an app startup failure from a probe misconfiguration or a memory problem.

    Debugging CrashLoopBackOff and OOMKilled .NET pods: kubectl describe, events, logs --previous, exit codes (1, 134, 137, 139), probe failures versus startup exceptions, missing configuration or identity, debug containers and dotnet-dump, and prevention.

    Mid-Level Debugging Containers Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  11. What is Helm and why would a .NET team use it? Explain charts, templates, values files per environment, releases, upgrades and rollback, and compare Helm with Kustomize. When would you choose each?

    Helm for deploying .NET services to Kubernetes: charts, Go templates, values per environment, releases and revision history, upgrade/rollback and hooks, OCI chart registries, and the trade-offs against Kustomize overlays.

    Mid-Level Theory Containers Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  12. Code review: a teammate submits a Dockerfile that builds and runs a .NET 10 API on the SDK image as root, plus a Kubernetes Deployment with one replica, no probes, no resource requests or limits, the latest image tag, and the database password in a plain env var. What do you flag, in what order, and what does the fixed version look like?

    Reviewing a .NET 10 Dockerfile and Kubernetes manifest: SDK image in production, root user, secrets in env vars, :latest tags, missing probes, missing requests/limits, single replica, shell-form entry point; findings ranked by severity with a rewrite and review close-out.

    Senior CodeReview Containers Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world

🌐 Sangam's Webring

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