What is the .NET SDK, and how does it differ from the .NET Runtime?
The .NET SDK includes everything needed to build, run, and publish .NET applications: the compiler (Roslyn for C#), the dotnet CLI, MSBuild, and the runtime.
The 50 .NET questions worth preparing first, picked from all 313 on W3Teacher and spread across 20 topics. Each one has a short answer here and a full answer with examples and follow-ups on its own page.
The .NET SDK includes everything needed to build, run, and publish .NET applications: the compiler (Roslyn for C#), the dotnet CLI, MSBuild, and the runtime.
.NET Framework is the original, Windows-only implementation of .NET dating back to 2002, tightly coupled to Windows and installed as a shared system component.
API versioning lets you evolve an API's contract (adding fields, changing behavior, removing deprecated endpoints) without breaking existing clients that depend on the current behavior.
Middleware are components assembled into a pipeline that handles every incoming HTTP request and outgoing response.
An assembly is the fundamental unit of deployment and versioning in .NET -- a compiled .dll or .exe file containing IL (Intermediate Language) code, type metadata, and a manifest describing the assembly's identity (name, version, culture) and its references to other assemblies.
Authentication answers 'who are you?' -- verifying a user's identity, typically producing a ClaimsPrincipal representing the authenticated user.
BackgroundService is an abstract base class implementing IHostedService, designed for long-running background work that runs alongside the main application (like an ASP.NET Core web app or worker service).
Blazor is a framework for building interactive web UIs using C# and .NET instead of JavaScript. Blazor Server runs application logic on the server, with the browser maintaining a persistent SignalR connection that relays UI events up and DOM updates down as lightweight diffs.
IMemoryCache is a built-in in-process cache storing key-value pairs directly in the application's own memory, ideal for single-instance applications or data that's acceptable to recompute per-instance -- it's extremely fast (no network round-trip) but not shared across multiple…
A typical pipeline includes: restore dependencies (dotnet restore), build (dotnet build), run automated tests (dotnet test), publish deployable artifacts (dotnet publish), and deploy to a target environment (container registry, cloud platform, or server) -- often gated by…
The CLR is the execution engine of .NET, responsible for managing memory (allocation and garbage collection), just-in-time (JIT) compiling IL code to native machine code, enforcing type safety, handling exceptions, managing threads, and providing security sandboxing.
IConfiguration builds a unified key-value configuration tree by combining multiple providers in a specific registration order, where later-registered providers override earlier ones for the same key -- the default host builder registers appsettings.json first, then…
CORS (Cross-Origin Resource Sharing) is a browser security mechanism that restricts web pages from making requests to a different origin (different scheme, domain, or port) than the one that served the page, unless the target server explicitly permits it via response headers.
Dependency injection is a design pattern where a class receives its dependencies (other objects it needs to function) from an external source rather than creating them itself, promoting loose coupling and testability.
The .NET SDK includes global diagnostic tools installable via `dotnet tool install -g`: dotnet-trace collects CPU and runtime event traces for performance analysis, dotnet-counters displays live performance counters (GC stats, request rate, CPU usage), dotnet-dump captures and…
The sdk image (mcr.microsoft.com/dotnet/sdk) includes the full SDK for building and publishing applications -- large, used only in build stages.
EF Core is an object-relational mapper (ORM) that lets you work with a relational database using C# objects (entities) and LINQ queries instead of writing raw SQL by hand, translating LINQ expressions into SQL and mapping query results back into strongly-typed objects.
The Generic Host (IHost, built via Host.CreateApplicationBuilder or WebApplication.CreateBuilder) provides a unified application startup model handling dependency injection container setup, configuration loading, logging configuration, and graceful start/stop lifecycle…
Global exception handling middleware catches unhandled exceptions thrown anywhere downstream in the pipeline (controllers, other middleware, business logic), preventing them from crashing the request or leaking a raw stack trace to clients, and instead converting them into a…
gRPC is a high-performance RPC (Remote Procedure Call) framework built on HTTP/2, using Protocol Buffers (protobuf) as its binary serialization format for both requests and responses, rather than JSON over HTTP/1.1 as typical REST APIs use.
The dotnet CLI is the cross-platform command-line interface for creating, building, running, testing, and publishing .NET projects.
NuGet is .NET's official package manager, providing a standardized way to discover, install, update, and share reusable libraries (packages) across projects, avoiding the need to manually download DLLs and manage their dependencies and versions by hand.
Microsoft skipped .NET 4 specifically to avoid confusion with .NET Framework 4.x, since the new unified platform was meant to signal a clean break as the singular future of .NET -- dropping the 'Core' branding entirely starting with .NET 5, with .NET Framework remaining a…
URL segment versioning (/api/v1/products) is the most visible and cache-friendly approach. Query string versioning (/api/products?api-version=1.0) keeps URLs stable but is less discoverable.
Middleware executes in exactly the order it's registered for the 'incoming' phase, then unwinds in reverse order for the 'outgoing' phase -- so registering exception handling before routing means it can catch errors from routing and everything after it, but registering…
A client authenticates once (e.g., with credentials) and receives a signed JWT containing claims about the user (identity, roles, expiration) encoded in its payload.
When the host begins shutting down (e.g., SIGTERM in a container, or Ctrl+C locally), it signals the CancellationToken passed to ExecuteAsync, and gives the service a configurable grace period (default 30 seconds via ShutdownTimeout) to finish current work and exit its loop…
Since all UI state and event handling logic actually executes on the server, a Blazor Server app's interactivity entirely depends on its SignalR connection -- if the connection drops (network blip, server restart, idle timeout), the UI becomes unresponsive until reconnection…
Absolute expiration removes an entry at a fixed point in time regardless of how recently it was accessed, guaranteeing data won't become stale beyond a hard limit.
A GitHub Actions workflow YAML file defines jobs with steps using the actions/setup-dotnet action to install the required SDK version, followed by standard dotnet CLI commands, with results and artifacts optionally uploaded using actions/upload-artifact for use in subsequent…
JIT compilation translates IL into native machine code at runtime, immediately before a method is first executed, allowing the CLR to optimize compiled code based on the actual runtime environment (CPU architecture, observed usage patterns) -- at the cost of a warm-up delay for…
The Options pattern binds a strongly-typed C# class to a section of configuration (via IOptions , IOptionsSnapshot , or IOptionsMonitor ), giving you compile-time type safety, IntelliSense, and centralized validation instead of scattering magic string-based…
Register a named CORS policy via AddCors specifying allowed origins, methods, and headers, then apply it either globally with UseCors(policyName) in the middleware pipeline or per-endpoint/controller with the [EnableCors] attribute -- the policy must be registered before…
Singleton creates one instance for the entire application lifetime, shared across all requests and threads. Scoped creates one instance per client request (or per explicitly created scope), shared within that single request but distinct across different requests.
dotnet-counters connects to a running .NET process and streams live performance counters to the console (or exports them), including built-in metrics like CPU usage, GC heap size and collection counts per generation, ThreadPool thread count and queue length, exception count, and…
A multi-stage Dockerfile uses a build stage (based on the full SDK image) to restore, compile, and publish the application, then a separate, final stage (based on a minimal runtime image) copies only the published output artifacts from the build stage, discarding the SDK…
Code-First defines your data model as C# classes first, then uses migrations to generate and apply corresponding database schema changes -- ideal for new projects where the application drives the schema.
Host.CreateApplicationBuilder (introduced in .NET 7) is the modern, minimal-hosting-model-aligned builder returning a HostApplicationBuilder with more direct, immediate access to Services, Configuration, and Logging properties for a more streamlined top-level-statements-friendly…
IExceptionHandler defines a TryHandleAsync(HttpContext, Exception, CancellationToken) method that you implement as a proper, testable, DI-injectable class rather than an inline delegate -- multiple exception handlers can be registered and are tried in order until one returns…
A .proto file declares message types (structured data with numbered fields) and service definitions (RPC method signatures) using protobuf's interface definition language; the Grpc.Tools NuGet package's MSBuild integration automatically generates strongly-typed C# client and…
A .csproj file is an MSBuild XML project file describing how to build a project: target framework, package references, project references, compiler settings, and output type.
.NET Standard was a formal specification of APIs that both .NET Framework and .NET Core (and Xamarin, Mono, etc.) committed to implementing, letting library authors target one .NET Standard version to support multiple runtime flavors simultaneously.
The Asp.Versioning packages (successor to Microsoft.AspNetCore.Mvc.Versioning) let you register API versioning services, define supported versions per controller/action via [ApiVersion] attributes, and use a {version:apiVersion} route template placeholder so the framework…
A class-based middleware implements a constructor accepting RequestDelegate next (and typically other injected services), and an InvokeAsync (or Invoke) method containing the actual per-request logic, then calling await next(context) to pass control to the next middleware.
The GAC was a machine-wide repository in .NET Framework for storing strongly-named shared assemblies, letting multiple applications reference one common copy instead of each having a private copy.
Claims are key-value pairs embedded in a JWT's payload describing attributes about the authenticated subject (standard ones include sub, exp, iss, aud; custom ones might include role, tenant_id, or permissions).
Since BackgroundService instances are singletons for the app's lifetime, you cannot inject scoped services directly into the constructor -- instead, inject IServiceScopeFactory (or IServiceProvider) and create a new scope for each unit of work, resolving scoped services from…
A circuit represents the server-side connection and state for one Blazor Server user session -- it holds the component tree, its current render state, and any DHTML event handlers, kept alive on the server for the browser tab's lifetime via the SignalR connection.
IDistributedCache is an abstraction over an external, shared cache store (like Redis or SQL Server) that all instances of a horizontally-scaled application read from and write to consistently, unlike IMemoryCache where each instance maintains its own separate, unsynchronized…
Blue-green deployment maintains two identical production environments (blue = current, green = new), routing all traffic to green only after it's fully deployed and verified, enabling instant rollback by switching traffic back to blue if issues arise.
Run a timed .NET mock interview: random questions, answer out loud, reveal the model answer and get a readiness score you can share.