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.
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.
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.
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.
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.
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.
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.
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.
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.
SDK resolution: how the dotnet host picks an SDK, what global.json's version, rollForward and allowPrerelease settings do, why pinning matters for IDEs and CI, and how to diagnose 'compatible SDK not found' failures.
The modern project file: the Sdk attribute, implicit imports, default globbing of source files, PackageReference, and why SDK-style projects are short, mergeable and cross-platform.
Solutions versus projects, the classic .sln format, the XML .slnx format that is the default for new solutions in the .NET 10 SDK, migrating with dotnet sln migrate, and .slnf solution filters for large repos.
TFMs and the .NET support lifecycle: what net8.0/net9.0/net10.0 and OS-specific TFMs mean, LTS versus STS, choosing targets for apps versus libraries, multi-targeting with TargetFrameworks and conditional code, and .NET 11 awareness.
Runtime identifiers: portable RIDs like linux-x64 and win-arm64, when a RID is needed (self-contained, single-file, AOT, native assets), RuntimeIdentifier versus RuntimeIdentifiers, the .NET 8 move to portable RIDs, and RID-specific NuGet assets.
Shared build configuration: how MSBuild finds and imports Directory.Build.props early and Directory.Build.targets late, nearest-file-wins and chaining with GetPathOfFileAbove, what to put in each, conditions per project type, and debugging with preprocess and binary logs.
Referencing code in .NET: NuGet PackageReference versus ProjectReference, version ranges and floating versions, transitive flow, PrivateAssets/IncludeAssets/ExcludeAssets, ReferenceOutputAssembly, and when to use each.
Central Package Management in practice: Directory.Packages.props, ManagePackageVersionsCentrally, PackageVersion items, VersionOverride, GlobalPackageReference, transitive pinning, NU1008 and NU1507, migration steps and governance.
Staff-level design of repo-wide .NET build governance: global.json, layered Directory.Build files, Central Package Management, nuget.config and lock files, analyser and warning policy, artefact layout, CODEOWNERS, shared pipelines, exception processes, build performance and metrics.
MSBuild fundamentals: the evaluation and execution phases, properties, items and metadata, targets and their ordering, tasks, global properties, incremental builds with Inputs and Outputs, and how dotnet build maps onto MSBuild.
Build configurations: what Debug and Release change (optimisation, DEBUG/TRACE constants, debugging information, JIT behaviour), which commands default to which, custom configurations, and why behaviour can differ.
Conditional compilation in .NET: preprocessor directives, DefineConstants and implicit symbols (DEBUG, TFM and OS symbols), the [Conditional] attribute's call-site semantics, feature switches, and why most environment differences belong in run-time configuration.