What is NuGet?

BeginnerConcept.NET builds (dotnet CLI)
Answer

Short answer

NuGet is the package manager for .NET — the equivalent of npm or Maven. Packages (.nupkg files) are downloaded from nuget.org or a private feed (Azure Artifacts, Nexus, Artifactory) during dotnet restore, based on the PackageReference entries in each .csproj.

Commands

dotnet add package Npgsql --version 8.0.3
dotnet remove package OldLib
dotnet list package --outdated
dotnet list package --vulnerable --include-transitive
dotnet nuget locals all --clear      # clear the local cache

Private feed with nuget.config

<configuration>
  <packageSources>
    <clear />
    <add key="company" value="https://pkgs.dev.azure.com/org/_packaging/shop/nuget/v3/index.json" />
  </packageSources>
</configuration>

Credentials come from CI (e.g. NuGetAuthenticate@1 task in Azure DevOps or a PAT secret).

Cache

Packages are cached in ~/.nuget/packages — cache this folder in CI.

What to say in the interview

"NuGet is .NET's package manager. dotnet restore pulls PackageReferences from nuget.org or our Azure Artifacts feed defined in nuget.config, and we cache ~/.nuget/packages in CI and check dotnet list package --vulnerable for CVEs."

All Build Tools (Java, Node.js, Python, .NET) questions Roadmap: .NET apps: dotnet build & publish

More on .NET builds (dotnet CLI)