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

πŸ“š .NET Interview Questions

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

.NET CLI

The dotnet command: new, build, run, test, publish, restore, clean, pack, tool, ef and format.

  1. What is the .NET CLI, and what do dotnet new, dotnet build, dotnet run and dotnet clean do?

    The dotnet driver and its everyday commands: creating projects and solutions from templates, building, running and cleaning, and how the CLI relates to the SDK, MSBuild and the IDEs.

    Beginner Theory .NET CLI Β· πŸ”— 2 follow-ups
  2. Walk through the dotnet restore, build, test and publish flow. What does each step produce, and why do CI pipelines use --no-restore and --no-build?

    The CLI pipeline end to end: restore producing project.assets.json, build producing bin and obj outputs, test running against those outputs, publish producing a deployable folder, and how --no-restore and --no-build keep CI fast and consistent.

    Junior Theory .NET CLI Β· πŸ”— 3 follow-ups
  3. How does dotnet test work, and how do you filter tests, collect code coverage and publish results in CI?

    Running tests from the CLI: how dotnet test discovers and runs tests, VSTest filters, loggers and TRX results, Coverlet and Microsoft code coverage, hang and crash diagnostics, parallelism, and Microsoft.Testing.Platform in .NET 10.

    Intermediate Theory .NET CLI Β· πŸ”— 2 follow-ups
  4. What are your options with dotnet publish: framework-dependent or self-contained, single-file, trimming, ReadyToRun, Native AOT and container images? How do you choose?

    Choosing a deployment shape with dotnet publish for .NET 10: runtime identifiers, framework-dependent vs self-contained, single-file, trimming, ReadyToRun, Native AOT and SDK-built container images, with their size, start-up and compatibility trade-offs.

    Mid-Level Theory .NET CLI Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  5. dotnet restore fails in CI with NU1301 or 401 Unauthorized against a private NuGet feed, but works on your machine. How do you diagnose and fix it?

    Troubleshooting restore failures: how NuGet finds sources and credentials through nuget.config, credential providers and CI service connections, package source mapping, lock files, caches, NuGet Audit, and protecting against dependency confusion.

    Mid-Level Debugging .NET CLI Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  6. How do you create and publish a NuGet package with dotnet pack, including versioning, package metadata, symbols and signing?

    Packaging a reusable library with dotnet pack: required and recommended metadata, SemVer versioning from CI, README and licence, symbols and Source Link, deterministic builds, package validation, signing and pushing to a feed.

    Intermediate Theory .NET CLI Β· πŸ”— 3 follow-ups
  7. What are .NET tools, and how do global tools differ from local tools with a tool manifest and dotnet tool restore?

    Covers dotnet tool: global vs local vs tool-path installs, the .config/dotnet-tools.json manifest, restore in CI, one-shot execution in .NET 10, and supply-chain safety.

    Junior Theory .NET CLI Β· πŸ”— 3 follow-ups
  8. How do you apply EF Core migrations safely in a CI/CD pipeline using dotnet ef, and why not just call Database.Migrate() at application startup?

    Covers dotnet ef migrations in CI/CD: --project/--startup-project, design-time factories, idempotent SQL scripts, migration bundles, pending model change checks, and why startup migration is risky.

    Senior RealWorldScenario .NET CLI Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  9. Review this CI pipeline that builds, tests and publishes a .NET 10 service with the dotnet CLI and dotnet format. What would you change and why?

    A code review of a CI pipeline: redundant restores, missing --no-restore/--no-build, Release configuration, locked restore, dotnet format --verify-no-changes, test results and coverage, and publish options.

    Mid-Level CodeReview .NET CLI Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world

🌐 Sangam's Webring

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