Skip to main content

.NET Interview Questions for 2026: 45+ Questions Across C#, ASP.NET Core, EF, LINQ, Blazor (CS New Grad Edition)

.NET interview questions in 2026 span seven surfaces: C# language internals, OOP plus SOLID, ASP.NET Core, Entity Framework, LINQ, Blazor, and DevOps. Enterprise interviewers (banks, insurance, healthcare, government contractors) probe the gap between coursework C# and production .NET, and the new grad who studied only the language gets filtered out at the framework round. This guide gives 45+ questions across the seven buckets, the .NET Framework vs .NET Core vs .NET 8+ history every interviewer asks about, and the prep plan that closes the production-experience gap in three weeks.

By Alex Chen, Founder, InterviewChamp.AI · Last updated

29 min read

What .NET interview questions actually test in 2026

.NET interview questions in 2026 test four things in roughly this order: whether you know C# at a level deeper than syntax, whether you understand the framework conventions (ASP.NET Core, EF Core, dependency injection) that production .NET runs on, whether you can talk through a small system design using .NET primitives, and whether you can hold an intelligent conversation about the .NET Framework vs .NET Core vs .NET 8+ history. The syntax floor is non-negotiable. The framework layer is where most interviews are won or lost. The history conversation is the senior signal even at the entry level.

The 2026 hiring environment for .NET roles has tightened differently than for Python or Java. Most greenfield startups use a non-.NET stack, which means .NET interview volume is concentrated at enterprise companies: regional banks, insurance carriers, healthcare networks, government contractors, defense, and the long tail of established mid-market firms that ran .NET Framework 4.x for fifteen years and are now migrating to .NET 8. These employers grade differently. They want candidates who can talk credibly about both the modern stack AND the legacy stack they still operate. A new grad who only knows .NET 8 reads as someone who's never going to be useful on the migration roadmap.

Distribution of question types most new-grad candidates report seeing in their .NET loops:

  • 30-35% C# language internals (value vs reference, async/await, generics, delegates)
  • 15-20% ASP.NET Core (middleware, dependency injection, controllers vs Minimal APIs)
  • 15% Entity Framework Core (DbContext, change tracking, LINQ to entities)
  • 10-15% LINQ (deferred execution, IEnumerable vs IQueryable)
  • 10-15% OOP and SOLID (inheritance, interfaces, design patterns)
  • 5-10% Blazor (Server vs WebAssembly, component lifecycle)
  • 5% DevOps and CI/CD (build pipelines, NuGet, Docker)

The language-internals slice is the one most candidates underprepare. It is also the slice that disproportionately determines outcome.

How .NET interview questions differ from general coding interviews

A general coding interview in any language tests algorithm fluency, problem decomposition, and communication. A .NET interview adds three dimensions: deep C# language knowledge, framework-convention fluency, and the history conversation. Three concepts in particular show up over and over in 2026 .NET interviews and rarely appear in interviews for other languages:

Value types vs reference types. A first-class concept in C# in a way it isn't in Python or JavaScript. The interviewer is testing whether you understand that a struct lives on the stack, a class lives on the heap, and the boundary between them (boxing) has a real performance cost. Almost every senior follow-up loops back to this.

The async/await state machine. Most candidates know how to write async methods. Fewer know that the compiler rewrites the method into a state machine, that Task is the return type representing a future value, and that ConfigureAwait(false) matters in library code to avoid deadlocks on UI threads. The state-machine question separates the candidate who used async from the one who understands it.

The .NET version landscape. "Walk me through the difference between .NET Framework, .NET Core, and .NET 8" is one of the most-asked .NET interview questions in 2026. Interviewers ask it as a litmus test for whether the candidate has been around the stack long enough to know what's deprecated, what's LTS, and what the company's migration path looks like.

Three more concepts that round out the framework surface area: the ASP.NET Core middleware pipeline (order matters, and interviewers love asking what happens when you swap the order), EF Core's change tracker (the single biggest source of EF perf bugs new grads ship), and LINQ deferred execution (the IEnumerable vs IQueryable distinction that determines whether a query runs in C# or SQL).

Honest call here: if you only have a weekend before the .NET round, drill async/await and EF change tracking first. They show up so often and trip up so many candidates that being fast on those two will compensate for being slow on three others.

A specific case from the 2025-2026 cycle: a CS grad with 487 applications and 14 phone screens and zero offers over 11 months pivoted from web-startup-only targeting to mid-market enterprises running .NET 8. One weekend on async/await internals plus EF change tracking, two evenings on the version-history conversation, one .NET 8 ASP.NET Core API built from scratch. He landed two enterprise phone screens in week two of the pivot. The stack isn't the moat for new grads in 2026. The interview prep is.

The 45+ .NET interview questions you should rehearse

What follows is a structured rehearsal set covering the seven categories that show up most. Each question has a sample answer outline. Not a full canned response, but the bones of what a strong answer covers. Adapt the language to your own voice. The structure is the load-bearing part.

C# language internals (10 Q)

Q1. What's the difference between a value type and a reference type?

Value types (int, double, bool, struct, enum) store their data directly. Reference types (class, interface, string, array, delegate) store a pointer to data on the managed heap. Value types pass by value into methods. Reference types pass the reference by value (so the method can mutate the object the caller holds, but reassigning the parameter doesn't affect the caller).

Q2. What is boxing and unboxing?

Boxing wraps a value type in an object reference on the heap so it can be assigned to a variable of type object or an interface. Unboxing extracts the value back. Both operations allocate or copy and are perf-costly in hot paths. The classic example: int x = 5; object o = x; boxes. int y = (int)o; unboxes. Generics (List<int>) avoid boxing because the type parameter is specialized at compile time.

Q3. What's the difference between string and StringBuilder?

string is immutable. Concatenating two strings creates a new string and the original is garbage. In a loop, this is O(n²) because each iteration copies the accumulated content. StringBuilder is a mutable buffer. Append, Insert, Replace operate in-place. Use StringBuilder when you're building a string in a loop or concatenating more than 4-5 fragments. Use string for one-off concatenation or interpolation.

Q4. What is async/await and what does the compiler do with it?

async marks a method that can be paused. await pauses the method until an awaitable (Task, Task<T>, ValueTask) completes. The compiler rewrites the async method into a state machine class with fields for each local variable that crosses an await, a MoveNext method that advances the state, and a continuation registered when an awaited task isn't yet complete. async/await is not multithreading. It's cooperative scheduling on top of the existing threading model.

Q5. What's the difference between Task and Task<T>?

Task represents an async operation with no return value (like a void method that runs asynchronously). Task<T> represents an async operation that returns a value of type T. await task produces nothing; await task on Task<T> produces the T. Use Task for fire-and-forget-style async work that has side effects, Task<T> when you need the result.

Q6. What is ConfigureAwait(false) and when do you use it?

By default, when an awaited task completes, the continuation resumes on the original synchronization context (the UI thread in a WinForms or WPF app, the request context in older ASP.NET). ConfigureAwait(false) tells the runtime not to capture the context, so the continuation can run on any thread pool thread. Use it in library code that doesn't need the context (almost always), and not in app-level code that does. ASP.NET Core doesn't have a sync context, so the distinction matters less in 2026 web code than it did in 2018.

Q7. What is IDisposable and the using statement?

IDisposable is the interface for releasing unmanaged resources (file handles, network sockets, DB connections, OS handles). The using statement guarantees Dispose runs even on exception. C# 8 added the using declaration: using var stream = new FileStream(...) scopes disposal to the enclosing block. For a class that owns both managed and unmanaged resources, implement the full dispose pattern: public Dispose() that calls protected virtual Dispose(bool disposing), with a finalizer that calls Dispose(false).

Q8. What are generics and what are constraints?

Generics let you write code that works on a type parameter T without specifying T at class-definition time. List<T>, Dictionary<TKey, TValue>, Func<T, TResult> are all generic. Constraints restrict what T can be: where T : class (reference type), where T : struct (value type), where T : new() (must have parameterless constructor), where T : IComparable<T> (must implement an interface). Constraints let the generic method call methods on T that wouldn't be available without them.

Q9. What's the difference between a delegate and an event?

A delegate is a type-safe function pointer. Action, Func<T, TResult>, Predicate<T> are all delegates. An event is a delegate with restricted access: the consumer can only += and -= (subscribe and unsubscribe), not invoke or reassign. Events are the publish-subscribe primitive in C#. The event keyword on a delegate field generates the add and remove methods. Most modern C# uses events less than older code because Reactive Extensions and async-streams cover the same use cases more flexibly.

Q10. What is the garbage collector and how does generational GC work?

The .NET GC reclaims memory from objects no longer referenced. It uses a generational model: Gen 0 holds short-lived objects (most new allocations), Gen 1 is a buffer, Gen 2 holds long-lived objects. The GC runs Gen 0 collections frequently and Gen 2 collections rarely, on the assumption that most objects die young. When a Gen 0 collection finds an object still alive, it promotes it to Gen 1. The interview-relevant takeaway: allocate fewer short-lived objects in hot paths, prefer struct over class for small data, reuse buffers with ArrayPool<T> and Span<T> instead of allocating new arrays per call.

.NET OOP and SOLID interview questions (7 Q)

Q11. What's the difference between an abstract class and an interface?

An abstract class can have method implementations, fields, constructors, and access modifiers. Pre-C# 8 interfaces could only declare signatures. C# 8 added default interface methods. The 2026 distinction is intent: abstract class for an is-a relationship with shared implementation, interface for a can-do contract. A class can inherit one abstract class but implement many interfaces.

Q12. What's the difference between virtual, abstract, override, and new?

virtual: method has a default implementation in the base class but can be overridden. abstract: method has no implementation, must be overridden. override: child method replaces a virtual or abstract base method. new: child method hides the base method without overriding (the base method is still called when accessed via a base-class reference). The new keyword almost always signals a bug. You wanted override and accidentally wrote new.

Q13. Explain the Single Responsibility Principle with a C# example.

A class should have one reason to change. The classic anti-example is a User class that holds user data AND persists itself to the database AND sends emails: three reasons to change (data shape, persistence layer, notification system). The SRP refactor splits into User (data), IUserRepository (persistence), IEmailService (notifications). Each interface is a single concern. Dependency injection wires them together.

Q14. Explain Dependency Inversion with a C# example.

High-level modules should not depend on low-level modules. Both should depend on abstractions. In practice: class CheckoutService { CheckoutService(IPaymentGateway gateway) ... } instead of class CheckoutService { var gateway = new ThirdPartyPaymentGateway(); ... }. The CheckoutService depends on the IPaymentGateway interface, not the concrete implementation. ASP.NET Core's built-in DI container wires the concrete implementation at registration time. The benefit: swap gateways for a mock in unit tests, or for a different provider in production, without touching CheckoutService.

Q15. What is the Open-Closed Principle?

Open for extension, closed for modification. Add new behavior by writing new code (new class, new interface implementation, new strategy), not by modifying existing code. The canonical pattern is Strategy: an interface for the varying behavior, multiple implementations, a context class that takes the interface via constructor injection. New behavior = new implementation, no change to the existing classes.

Q16. What is the Liskov Substitution Principle?

Subtypes must be substitutable for their base types without breaking the program's correctness. If you have class Rectangle { Width, Height } and class Square : Rectangle { ... } that forces Width = Height, that's an LSP violation. Code that works on Rectangle (set Width to 5, expect Height to stay at 3) breaks when given a Square. The fix is usually to not model Square as a Rectangle subclass. They're related shapes, not an is-a relationship in the inheritance sense.

Q17. What is the Interface Segregation Principle?

Clients should not depend on methods they don't use. Prefer many small interfaces over one large one. The anti-pattern is an IRepository with twenty methods where most consumers use only three. The refactor splits into IReadOnlyRepository, IWriteRepository, IQueryRepository, so consumers depend only on what they use. ASP.NET Core's interface ecosystem is built this way: IConfiguration, ILogger<T>, IServiceProvider, IServiceScopeFactory are all narrow.

ASP.NET Core interview questions (8 Q)

Q18. What is Program.cs and what does the minimal hosting model do?

Program.cs is the entry point of an ASP.NET Core app since .NET 6. The minimal hosting model collapses the older Program.cs plus Startup.cs (with ConfigureServices and Configure methods) into one file with top-level statements. builder.Services.AddX() registers DI services. builder.Build() produces the app. app.UseX() configures the middleware pipeline. app.Run() starts the host. For a simple API, the entire Program.cs is 15-30 lines.

Q19. What is middleware and how does the pipeline work?

Middleware is a class or lambda that handles HTTP requests and responses. The pipeline is the ordered chain configured in Program.cs. Each middleware can short-circuit (return a response and stop), pass to the next middleware via next(), or transform the response on the way back. Order matters. UseRouting must come before UseEndpoints. UseAuthentication before UseAuthorization. Diagnosing middleware-order bugs is a senior signal at the new-grad tier.

Q20. What's the difference between Controllers and Minimal APIs?

Controllers are the classic MVC-style approach: a class inheriting from ControllerBase with methods decorated by [HttpGet], [HttpPost] attributes. Minimal APIs (added in .NET 6) use lambda-based endpoint registration: app.MapGet("/users", () => ...). Minimal APIs are lighter, faster to start, and better for small services. Controllers are better for large APIs with model binding, filters, and shared behavior. Most teams in 2026 default to Minimal APIs for new services under ~50 endpoints and Controllers for larger applications.

Q21. How do you configure dependency injection in ASP.NET Core?

In Program.cs: builder.Services.AddSingleton<IFoo, Foo>(), AddScoped<IBar, Bar>(), AddTransient<IBaz, Baz>(). ASP.NET Core's built-in container handles constructor injection automatically. Resolve services in controllers, Minimal API delegates, and middleware via constructor parameters or HttpContext.RequestServices.GetRequiredService<T>() when constructor injection isn't possible.

Q22. What's the difference between Singleton, Scoped, and Transient lifetimes?

Singleton: one instance for the application's lifetime. Scoped: one instance per HTTP request. Transient: a new instance every time it's resolved. DbContext is registered as Scoped via AddDbContext. Configuration objects are typically Singleton. Logging services are Singleton. Services with per-request state are Scoped. Lightweight stateless services are Transient. Injecting a Scoped service into a Singleton is a captive-dependency bug that ASP.NET Core's DI validation catches in development.

Q23. How do you handle authentication in ASP.NET Core?

Add authentication services in Program.cs: builder.Services.AddAuthentication("Bearer").AddJwtBearer(...). Add app.UseAuthentication() and app.UseAuthorization() to the middleware pipeline, in that order. Decorate endpoints with [Authorize] to require an authenticated user, [AllowAnonymous] to skip the check. For more granular policies, use AddAuthorization(options => options.AddPolicy(...)) and [Authorize(Policy = "...")].

Q24. What is the configuration system in ASP.NET Core?

A layered system of configuration providers: appsettings.json, appsettings.{Environment}.json, environment variables, command-line args, secret manager (in development), and any custom providers. Each layer overrides the previous. Access via IConfiguration injected into a constructor or builder.Configuration in Program.cs. Bind a configuration section to a strongly-typed class via Configure<MyOptions>(config.GetSection("MyOptions")) and inject IOptions<MyOptions> into your services.

Q25. What are hosted services and BackgroundService?

A hosted service is a long-running task that starts with the app and stops when the app shuts down. Implement IHostedService directly for full control, or inherit from BackgroundService and override ExecuteAsync for the common case. Use cases: scheduled jobs, message-queue consumers, telemetry flushers, periodic cleanup. Register with builder.Services.AddHostedService<MyService>(). The hosted service runs in the same process as the web host.

Entity Framework Core interview questions (6 Q)

Q26. What is DbContext and what's its lifecycle?

DbContext represents a session with the database. It tracks entities, builds queries, and manages the connection pool. It's not thread-safe. Use one DbContext per unit of work. In ASP.NET Core, AddDbContext registers it as Scoped, so you get one per HTTP request, automatically disposed at the end. Never share a DbContext across requests or threads.

Q27. What is the change tracker and what's AsNoTracking?

The change tracker holds every entity the DbContext has loaded and tracks state changes (Added, Modified, Deleted, Unchanged). When you call SaveChanges, EF generates SQL based on tracked changes. Tracking has a per-entity overhead. For read-only queries (display data, reports), call .AsNoTracking() on the query to skip tracking entirely. Most queries in a typical API should be AsNoTracking; only write paths need tracking on.

Q28. What are EF migrations and how do you use them?

Migrations are EF's version control for schema. dotnet ef migrations add Initial generates code that captures the current model as a migration. dotnet ef database update applies pending migrations to the database. Each migration has Up (apply) and Down (revert) methods. Production deployments either run migrations as part of the pipeline or apply them manually. Never edit a committed migration; add a new one.

Q29. What's the difference between Include, lazy loading, and eager loading?

Eager loading via .Include(u => u.Orders) runs a JOIN in the same SQL query as the parent select. Lazy loading (when enabled and the navigation property is virtual) issues a separate query when you access the property. Explicit loading via context.Entry(user).Collection(u => u.Orders).Load() is an explicit lazy load. The 2026 best practice: prefer Include for predictable performance, avoid lazy loading because it causes N+1 query problems where iterating a list of parents triggers one child query per parent.

Q30. What is an N+1 query and how do you fix it?

The pattern where you load N parent records, then issue one child query per parent (1 + N total queries). Common cause: iterating a collection and accessing a navigation property in a loop. Fix: use .Include to load children in the same query, or use explicit projection with .Select(u => new { u.Name, OrderCount = u.Orders.Count() }) to push the count into SQL. Diagnose N+1s by enabling EF logging and watching the SQL stream during a request.

Q31. What's the difference between EF Core and EF6 (the older Entity Framework)?

EF6 is the original Entity Framework, Windows-only, .NET Framework-only, still maintained for legacy. EF Core is the rewrite that ships with .NET Core and .NET 5+. EF Core is cross-platform, faster, has a smaller API surface, and supports modern features (async LINQ, owned types, query splitting, compiled queries). The 2026 reality: greenfield uses EF Core. Legacy code on .NET Framework still runs EF6. Migrations from EF6 to EF Core are a significant effort, not a one-line config change.

LINQ interview questions (5 Q)

Q32. What is LINQ and how does it work?

LINQ (Language Integrated Query) is C#'s SQL-like syntax for querying collections, databases, XML, and any source with a provider. Method syntax: users.Where(u => u.Age > 18).Select(u => u.Name). Query syntax: from u in users where u.Age > 18 select u.Name. The compiler translates query syntax to method syntax. No runtime difference. LINQ to Objects runs in-memory; LINQ to Entities translates to SQL via the EF provider.

Q33. What is deferred execution?

A LINQ query doesn't run when you write the expression. It runs when you enumerate the result (foreach, ToList, ToArray, Count, First, etc.). var query = users.Where(u => u.Age > 18); builds the query plan. query.ToList() materializes it. The performance implication: chaining multiple Where, Select, OrderBy operations doesn't multiply the work. They're composed into one operation that runs when you materialize.

Q34. What's the difference between IEnumerable and IQueryable?

IEnumerable<T> represents an in-memory sequence. Operations run via LINQ to Objects in C#. IQueryable<T> represents an expression tree that a provider (EF Core, LINQ to SQL, others) translates into a query against the data source. The interview-trap example: db.Users.Where(u => u.Age > 18).ToList() filters in SQL. db.Users.ToList().Where(u => u.Age > 18) pulls every row into memory then filters in C#. The second one is the canonical EF performance bug new grads ship to production.

Q35. What's the difference between First, FirstOrDefault, Single, and SingleOrDefault?

First returns the first matching element or throws if the source is empty. FirstOrDefault returns the first match or default(T) if empty. Single returns the only matching element or throws if there are zero or more than one. SingleOrDefault returns the only match or default if zero, throws if more than one. Use Single when you expect exactly one result and want a loud failure on bad data. Use FirstOrDefault when zero is a valid case to handle.

Q36. Write a LINQ query that groups users by city and returns the top 3 cities by user count.

var topCities = users
    .GroupBy(u => u.City)
    .Select(g => new { City = g.Key, Count = g.Count() })
    .OrderByDescending(x => x.Count)
    .Take(3)
    .ToList();

The interview signal: knowing the GroupBy projection produces an IGrouping<TKey, TElement>, knowing OrderByDescending vs OrderBy, knowing Take limits the result, knowing ToList materializes the query.

Blazor interview questions (5 Q)

Q37. What is Blazor and what does it solve?

Blazor is .NET's framework for building interactive web UIs using C# instead of JavaScript. Components are .razor files combining HTML, C# code, and bindings. Blazor solves the problem of writing the same logic on the server and client in two languages. The same component can run as a server-rendered page, a stateful Server interactive component, or a WebAssembly client component.

Q38. What's the difference between Blazor Server and Blazor WebAssembly?

Blazor Server runs components on the server and pushes UI updates to the browser via a persistent SignalR connection. Low initial download, real-time UI, but requires a stable connection and adds round-trip latency for every interaction. Blazor WebAssembly compiles the entire app (including the .NET runtime) to WebAssembly and runs in the browser. Larger initial download, offline-capable, no per-interaction round-trip. .NET 8 introduced 'Blazor Web Apps' that mix both modes per-component.

Q39. What is a Blazor component lifecycle?

Five lifecycle methods. OnInitialized and OnInitializedAsync run once when the component is first added to the render tree. OnParametersSet and OnParametersSetAsync run whenever the parent passes new parameter values. OnAfterRender and OnAfterRenderAsync run after each render, with a boolean indicating first render. Use OnInitialized for initial data loading. Use OnParametersSet when the component reacts to parameter changes. Use OnAfterRender for DOM interop that needs the rendered HTML.

Q40. How does data binding work in Blazor?

Two flavors. One-way binding via @variable renders the value into the HTML. Two-way binding via @bind="Property" syncs the input value back to the property on change. The default change event is onchange. Override with @bind:event="oninput" for immediate-on-keystroke updates. For complex objects, use @bind-Value on child components to propagate changes up.

Q41. What is StateHasChanged and when do you call it?

Blazor re-renders a component automatically when a parameter changes, an event handler fires, or a known async operation completes. When the component changes state outside one of those paths (e.g., from a timer, a background task, or an event raised by an injected service), Blazor doesn't know to re-render. Calling StateHasChanged() tells the renderer to schedule a re-render. Without it, the UI shows stale data. The interview signal: knowing that you rarely need StateHasChanged in normal event handlers, and that needing it often means there's a binding you should be using instead.

DevOps and CI/CD for .NET (4 Q)

Q42. What is NuGet and how do you manage package versions?

NuGet is .NET's package manager. Packages are published to nuget.org or a private feed. Reference packages via dotnet add package or by editing the <PackageReference> items in the .csproj file. The 2026 best practice: pin exact versions (Version="8.0.4") rather than ranges (Version="8.*") to make builds reproducible. Use dotnet list package --outdated to find updates. Use a lockfile (<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>) when you need reproducible restores across machines.

Q43. How do you build and deploy a .NET app to a Linux container?

dotnet publish -c Release produces a publish output. Use a Dockerfile with the official mcr.microsoft.com/dotnet/sdk image for the build stage and mcr.microsoft.com/dotnet/aspnet for the runtime stage. Multi-stage builds keep the final image small (~200MB for ASP.NET vs 800MB if you ship the SDK). For minimal images, use the alpine variant or .NET 8's native AOT for a self-contained binary with no runtime dependency.

Q44. What's the difference between framework-dependent and self-contained deployments?

Framework-dependent: the app expects the .NET runtime to be installed on the host. Smaller deployment, but the host must match the .NET version. Self-contained: the app ships with its own copy of the runtime, no host dependency. Larger deployment, but portable across hosts. Self-contained is the right choice for containers (the container is the host) and Linux deployments where the system-installed .NET version may not match.

Q45. How do you write a CI/CD pipeline for a .NET app?

The pattern: restore, build, test, publish, deploy. dotnet restore pulls packages. dotnet build -c Release --no-restore compiles. dotnet test --no-build runs tests. dotnet publish -c Release -o ./publish produces deployment artifacts. Deploy the publish folder via container, file copy, or service deploy. Most teams use GitHub Actions, GitLab CI, or another pipeline runner to wire these steps. The 2026 signal: knowing the --no-restore and --no-build flags optimize subsequent steps so you don't re-pull or re-compile.

How to prepare for a .NET interview (6 steps)

A focused three-week prep plan, scaled for a CS new grad who took one C# elective but has never shipped a production .NET service. Adjust if your starting point differs.

  1. Week 1: build a small ASP.NET Core API from scratch. Three endpoints, EF Core with SQLite, dependency injection, async controllers. Don't watch a tutorial. Read the official docs and write it yourself. The friction is the prep. When you hit an error, debug it; the debugging is how you learn. Total time: 8-12 hours.

  2. Week 2: drill the C# language internals. Six concepts: value vs reference types, boxing, async/await as state machine, IDisposable + dispose pattern, generics with constraints, delegates plus events. 60-90 minutes per concept, with one written example. Read official Microsoft docs, not third-party blogs. The docs are the source interviewers reference.

  3. Week 2 in parallel: memorize the .NET version history. .NET Framework 4.x (Windows, legacy). .NET Core 1-3 (cross-platform). .NET 5 (unification). .NET 6 LTS. .NET 7. .NET 8 LTS (active in 2026). .NET 9. Be able to state which is LTS, which the company likely runs, and how migrations work. The history question is almost certain in any enterprise interview.

  4. Week 3: practice the canonical OOP and SOLID questions. Abstract class vs interface, virtual vs abstract vs override vs new, the five SOLID principles with one C# example each. Build a small class hierarchy and exercise each concept. Be able to write a 5-line interface and an implementation out loud, no IDE.

  5. Week 3: run 3 timed mock interviews. End-to-end, 45 minutes each. First mock: C# and OOP. Second: ASP.NET Core plus EF Core scenario design. Third: Blazor plus LINQ depth questions. Narrate your reasoning out loud while coding. Silent coding is a known anti-pattern in live .NET rounds.

  6. Morning of the interview: warm up with your cheat sheet. Five minutes on the top 20 concepts. The act of writing the sheet from memory was the prep. The sheet itself is the warmup.

.NET interview format by company type

The same .NET language gets tested differently depending on the company. The breakdown for the five common company types running .NET in 2026:

Company typeStack versionC# depthASP.NET focusEF depthBlazorLegacy questions
Regional bank.NET Framework 4.8 + .NET 8 hybridMedium-HighWeb API + WCF legacyMediumLowHigh (migration path)
Insurance carrier.NET Framework 4.7-4.8, slow migrationMediumWeb Forms + ASP.NET MVCLowLowHigh
Healthcare network.NET 6 LTS or .NET 8HighASP.NET CoreHigh (HIPAA audit trails)Medium (internal tools)Medium
Gov contractor.NET 6 / .NET 8 (FedRAMP)HighASP.NET CoreMediumLowMedium (legacy systems)
.NET-native SaaS.NET 8 / .NET 9HighASP.NET Core + Minimal APIHighHighLow

Two patterns to notice. First, every company type tests C# at moderate-to-high depth. Even the legacy-heavy companies want to know you can work the modern language. Second, the legacy-questions slice concentrates at banks and insurance, where 15-year-old systems are still load-bearing. If you're interviewing for a bank, prepare to talk about .NET Framework 4.8, the migration path to .NET 8, and how you'd handle long-running systems with no test coverage. That conversation is the senior signal even at the entry level.

.NET interview cheat sheet

A one-page reference of the top 20 concepts, organized for the morning-of warmup. The act of writing this from memory is the prep; carrying it into the interview is the safety net.

#ConceptUse case / definitionPitfall
1Value vs reference typeStruct on stack, class on heapBoxing on object cast
2Boxing / unboxingValue-to-object copyHidden allocation in hot path
3async / awaitCooperative scheduling on TasksNot multithreading
4Task vs Task<T>Void async vs return-value asyncForgetting to await
5ConfigureAwait(false)Library code without sync contextMostly irrelevant in ASP.NET Core
6IDisposable + usingRelease unmanaged resourcesForgetting Dispose on owned resources
7Generics + constraintsType-safe reuseBoxing if T is value type unconstrained
8Delegate vs eventFunc pointer vs pub-subMemory leaks from forgotten unsub
9GC generationsGen 0 / 1 / 2Allocating short-lived in hot path
10Abstract vs interfaceImplementation vs contractC# 8 default methods blur the line
11virtual / abstract / override / newPolymorphism controlnew keyword almost always a bug
12DI lifetimes (Singleton / Scoped / Transient)One global, one per request, one per resolveCaptive dependencies
13Middleware orderUseRouting, UseAuth, UseEndpointsAuth before authentication = 401 every request
14DbContext lifecycleScoped per requestSharing across threads = exceptions
15Change tracker + AsNoTrackingTracking entities for SaveChangesForgetting AsNoTracking on read paths
16IEnumerable vs IQueryableIn-memory vs DB-translated queryToList() before Where = pull-then-filter
17Deferred executionQuery runs on enumerationSide-effect lambdas run every materialization
18EF migrationsSchema version controlEditing committed migrations
19N+1 queryOne parent query + N child queriesForeach over navigation property without Include
20Blazor Server vs WebAssemblySignalR server-side vs WASM client-sideServer needs sticky session for SignalR

Memorize the top half; the bottom half is the polish.

How to handle a .NET question you've never seen

The reality of a .NET interview is that you will hit at least one question you haven't seen. A behavior of the runtime, a niche EF feature, an edge case in async. The candidate who freezes loses the round. The candidate who reasons through it out loud often passes even when they get the wrong answer.

A four-step pattern for handling unfamiliar questions:

1. Restate the question in your own words. Slow down. Confirm what's being asked. Half the "tricky" questions become normal once you say them back. Example: "So you're asking what happens when an async method throws an exception that isn't observed before the Task is garbage collected. Would that crash the process or get swallowed silently? Let me think." That sentence buys you 10 seconds of thinking time and signals careful reasoning.

2. State what you know and what you don't. Don't pretend. "I know unobserved task exceptions used to crash the process in .NET Framework 4.0, but I think that changed in 4.5 and I'm not sure if .NET Core inherits the 4.5 behavior." Calibration beats confidence. Interviewers reward honest uncertainty more than they punish a wrong guess.

3. Reason from first principles. If you don't remember the answer, derive it. "Exceptions in an async method are captured into the returned Task. If no one awaits the Task, the exception sits there. The runtime needs to decide whether to surface it. In .NET Framework 4.0, it crashed the process. In 4.5+, I believe they made the default 'log and continue.'" That trail of reasoning is the work the interviewer is grading.

4. Test the hypothesis if you can. "Can I try this in a REPL or write a small repro?" is sometimes welcome and sometimes not, depending on the round. If allowed, do it. If not, walk through it on the whiteboard or in the editor with comments.

The pattern works because tricky .NET questions are rarely about memorization. They're about whether you understand the underlying model: the CLR, the async state machine, the EF change tracker, the DI container. Show your reasoning and you show your understanding.

Common .NET interview mistakes for CS new grads

The seven most-reported mistakes from new-grad .NET interviews in the 2025-2026 hiring cycle, in roughly the order of frequency:

Treating C# like Java. Writing every loop as a for loop instead of foreach or LINQ. Using a List instead of an array when the size is known. Reaching for Hashtable instead of Dictionary<TKey, TValue>. Throwing generic Exception instead of specific subclasses. The interviewer sees: candidate learned C# in coursework but didn't internalize the idioms.

Confusing value types and reference types. Assuming a struct passed to a method gets mutated by the method (it doesn't, it's copied). Assuming a class returned by a method is a fresh object (it isn't, just the same reference). Boxing accidentally by assigning an int to an object variable and not realizing the perf cost.

Misunderstanding async/await. Treating async as multithreading. Calling Task.Result or Task.Wait in synchronous code and deadlocking the UI thread. Forgetting that an unawaited Task can throw an exception that gets swallowed. Marking a method async without using await inside (the compiler warns; new grads ignore the warning).

Shipping the IEnumerable-vs-IQueryable EF perf bug. db.Users.ToList().Where(u => u.Age > 18) pulls every row into memory before filtering. The interviewer sees the bug in 5 seconds and the candidate doesn't see it at all. Knowing where ToList sits in the chain is the difference between a tutorial-grade LINQ user and a production-grade one.

Not knowing the .NET version landscape. Conflating .NET Framework 4.8 with .NET 8. Calling .NET Core 'the new version' in 2026 (it was renamed to just '.NET' starting with .NET 5 in 2020). Not knowing which version is the current LTS. The version-history question is the litmus test for whether the candidate has been around the stack at all.

Forgetting middleware order in ASP.NET Core. Putting UseAuthorization before UseAuthentication and not understanding why every request returns 401. Putting UseEndpoints before UseRouting and not understanding why routing doesn't work. The middleware-order question is the canonical ASP.NET Core trap.

Misusing DbContext lifetime. Registering DbContext as Singleton (it's not thread-safe). Holding a DbContext beyond one unit of work (memory leaks, stale change tracker). Sharing a DbContext across requests (concurrency exceptions). AddDbContext defaults to Scoped for a reason; new grads don't always trust the default.

One thing I'd add from watching new grads do this: don't try to memorize all seven the night before. Pick the two that match your specific gaps (almost always the IEnumerable-vs-IQueryable bug and the .NET version history) and close those. The other five take care of themselves once the foundation is there.

Key terms

Value type vs reference type
Value types (int, double, bool, struct, enum) store data directly. Reference types (class, interface, string, array, delegate) store a pointer to data on the managed heap. Value types pass by value; reference types pass the reference by value. Boxing happens when a value type is assigned to an object or interface, which triggers a hidden heap allocation.
async / await + Task
C#'s syntactic sugar for asynchronous programming. async marks a method that can pause; await pauses until an awaitable (Task, Task<T>, ValueTask) completes. The compiler rewrites the method into a state machine. Async is not multithreading; it's cooperative scheduling on top of the existing threading model.
IDisposable + using
IDisposable is the interface for releasing unmanaged resources (file handles, sockets, DB connections). The using statement guarantees Dispose runs even on exception. C# 8 added the using declaration syntax. The full dispose pattern handles both managed and unmanaged resources via a virtual Dispose(bool disposing) method.
Dependency injection (DI)
The design pattern where a class receives its dependencies through its constructor rather than creating them. ASP.NET Core has a built-in DI container with three lifetimes: Singleton (one for the app), Scoped (one per HTTP request), Transient (one per resolve). Captive dependencies (Scoped injected into Singleton) are caught by validation in development.
Middleware pipeline
The ordered chain of components in ASP.NET Core that handles each HTTP request and response. Each middleware can short-circuit, pass to the next via next(), or transform the response on the way back. Order matters: UseRouting before UseEndpoints, UseAuthentication before UseAuthorization.
EF Core change tracker + AsNoTracking
The in-memory record EF uses to track entity state (Added, Modified, Deleted, Unchanged). When SaveChanges runs, EF generates SQL based on the tracked changes. AsNoTracking skips tracking for read-only queries, saving the per-entity overhead. Most read paths in an API should be AsNoTracking.
IEnumerable vs IQueryable
IEnumerable<T> is an in-memory sequence; operations run via LINQ to Objects in C#. IQueryable<T> represents an expression tree that a provider (EF Core) translates into SQL. The classic EF perf bug is calling ToList() before Where(), which pulls every row into memory and then filters in C# instead of in the database.
Deferred execution
A LINQ query doesn't run when you write the expression; it runs when you enumerate the result (foreach, ToList, Count, First). Chaining multiple Where + Select + OrderBy operations composes into one operation that runs at materialization time, not at each step.
.NET Framework vs .NET Core vs .NET 8+
.NET Framework 4.x: Windows-only, 2002-2019, still in production at banks and insurance. .NET Core 1-3: cross-platform rewrite, 2016-2019. .NET 5: the unification, November 2020. .NET 6 LTS, .NET 7, .NET 8 LTS (active in 2026), .NET 9. Enterprise interviewers ask about the history as a litmus test.
Blazor Server vs Blazor WebAssembly
Blazor Server runs components on the server with a SignalR connection pushing UI updates. Low initial download, real-time UI, requires a persistent connection. Blazor WebAssembly compiles the app to WebAssembly and runs in the browser. Larger initial download, offline-capable, no round-trip latency. .NET 8's Blazor Web Apps mix both modes per-component.

Related guides


About the author: Alex Chen is the founder of InterviewChamp.AI, building AI interview prep for the new-grad CS market and writing about the modern interview gauntlet from the inside.

Related guides

Interview Process

System Design Interview Guide for CS New Grads (2026): Framework, Templates, Cheat Sheet

The new-grad system design interview is a vocabulary check, a structure check, and a communication check, not a senior architect evaluation. This guide gives you a 4-step framework, a 12-template cheat sheet, a 45-minute time budget, the five canonical problems that carry 80% of new-grad rotations, and a side-by-side of HLD vs LLD vs machine-learning-system-design. Built for the CS new grad who has solved 600 LeetCode problems but never drawn a load balancer.

Alex Chen ·

Read more →
Interview Process

The 2026 CS New-Grad Interview Loop: Phone Screen to Offer at Every Tier

The 2026 CS new-grad interview loop runs five steps (recruiter screen, technical screen, onsite, debrief, offer) but the shape of each step now depends on tier of company. This guide maps the loop for FAANG, mid-tier public, startup, consultancy, and research lab, with 2026 timelines and how AI-fraud concerns brought in-person rounds back.

Alex Chen ·

Read more →
Interview Process

Accounting Interview Questions for 2026: 40+ Questions for Staff Accountants, Big 4 Candidates, and CPA Pivots

Accounting interview questions in 2026 test six things at once: do you know GAAP cold, can you walk a transaction from journal entry to the three financial statements, can you read a balance sheet under pressure, do you understand the difference between Big 4 audit and corporate close work, can you handle the behavioral round without sounding rehearsed, and can you reason through a case study when the prompt is intentionally vague. If you're an accounting grad, a CPA candidate, or pivoting from finance/ops into staff accountant work, the technical bar isn't the killer. It's framing what you know in 60 seconds while a senior manager watches you on Zoom. This guide walks 40+ questions across six categories, the Big 4 vs corporate vs public-accounting split, and the four-week prep plan that actually works.

Alex Chen ·

Read more →

Frequently asked questions

What .NET interview questions should I prepare for in 2026?
Prepare across seven categories. C# language internals (value vs reference types, boxing, async/await, IDisposable). OOP and SOLID (interfaces, abstract classes, dependency injection). ASP.NET Core (middleware pipeline, controllers vs Minimal APIs, configuration). Entity Framework Core (DbContext lifecycle, change tracking, migrations). LINQ (deferred execution, IEnumerable vs IQueryable, method syntax vs query syntax). Blazor (Server vs WebAssembly, components, state). DevOps plus CI/CD (build pipelines, NuGet, Docker). Most new-grad .NET interviews lean 35% C# language, 20% ASP.NET Core, 15% EF + LINQ, 15% OOP + SOLID, and the rest on Blazor and DevOps.
What's the difference between .NET Framework, .NET Core, and .NET 8+?
.NET Framework was the Windows-only runtime from 2002 to 2019, with the final version 4.8 still receiving security patches but no new features. .NET Core was the rewrite that landed in 2016: cross-platform (Windows, Linux, macOS), open source, and stripped of Windows-specific dependencies. The two product lines unified in November 2020 as just '.NET 5', followed by .NET 6 (LTS, 2021), .NET 7, .NET 8 (LTS, 2023), and .NET 9 (2024). As of 2026, .NET 8 is the active LTS most enterprises run; .NET 9 is the current stable for non-LTS workloads. The interview-relevant takeaway: if the company runs banks-and-insurance-style legacy systems, you'll see .NET Framework 4.7/4.8 in production. New greenfield work is .NET 8 or .NET 9. Knowing which version handles which workload signals you've actually worked with the stack.
What's the difference between IEnumerable and IQueryable in LINQ?
Both represent a sequence of items. The difference is where the query runs. IEnumerable runs the query in-memory using LINQ to Objects. The data must already be loaded before you filter. IQueryable represents an expression tree that a provider (typically Entity Framework Core) translates into SQL and executes on the database. The interview-trap example: `db.Users.Where(u => u.Age > 18).ToList()` is IQueryable until ToList materializes it, so the WHERE runs in SQL. `db.Users.ToList().Where(u => u.Age > 18)` pulls every row into memory first and then filters in C#, which is the canonical EF performance bug new grads ship to production.
What is async/await in C# and how does it work under the hood?
async/await is C#'s syntactic sugar for asynchronous programming. When the compiler sees `await`, it rewrites the method into a state machine. The method runs synchronously until the first await on a non-completed task. At that point it returns a Task to the caller and registers a continuation. When the awaited task completes, the continuation resumes from where the method paused. The interview-relevant nuance is that async/await is not multithreading. It's cooperative scheduling on top of the existing threading model. A single-threaded UI app uses async/await to keep the UI responsive while I/O completes. A web server uses it to release the request thread back to the pool while waiting on a database call. The follow-up question is almost always 'what's the difference between Task.Run and await?' Task.Run schedules CPU-bound work on a thread pool thread. await pauses the current method until an existing task completes.
What is dependency injection in ASP.NET Core?
Dependency injection is the design pattern where a class receives the objects it needs through its constructor instead of creating them itself. ASP.NET Core has a built-in DI container configured in `Program.cs` via `builder.Services.AddSingleton<T>()`, `AddScoped<T>()`, or `AddTransient<T>()`. Singleton lives for the application lifetime. Scoped lives for one HTTP request. Transient creates a new instance every time it's resolved. The interview-trap follow-up: 'what happens if you inject a Scoped service into a Singleton?' Answer: you get a captive dependency. The Singleton holds the first Scoped instance forever, and subsequent requests don't get a fresh one. ASP.NET Core's validation in development mode catches this, but it ships to production if you bypass validation.
What's the difference between an abstract class and an interface in C#?
An abstract class can have method implementations, fields, constructors, and access modifiers. An interface (pre-C# 8) only declared method signatures and could not have implementations. C# 8 added default interface methods, blurring the line. The 2026 distinction is intent. Use an abstract class for an is-a relationship with shared implementation (a Vehicle base class with shared properties for all Car, Truck, Motorcycle subclasses). Use an interface for a can-do contract (IComparable, IDisposable, IEnumerable). A class can inherit one abstract class but implement many interfaces. The interview follow-up is usually about default interface methods: when to use them (versioning an interface without breaking existing implementations) and when not to (when you want abstract base class semantics).
What is Entity Framework Core's change tracker?
EF Core's change tracker is the in-memory record of what entities the DbContext is tracking and what state each is in (Added, Modified, Deleted, Unchanged, Detached). When you call SaveChanges, EF generates SQL based on the tracked changes. The interview-relevant nuance is that change tracking has a performance cost. Queries that return read-only data should use AsNoTracking to skip the tracking overhead. The other gotcha is the DbContext lifecycle: a DbContext is not thread-safe and should be scoped to one unit of work. In ASP.NET Core, this is one HTTP request via AddDbContext (scoped lifetime). Long-lived DbContext instances accumulate tracked entities and leak memory.
What is the ASP.NET Core middleware pipeline?
The middleware pipeline is the chain of components that processes each HTTP request and response. You configure it in `Program.cs` via `app.UseRouting()`, `app.UseAuthentication()`, `app.UseAuthorization()`, `app.UseEndpoints(...)`, and so on. Each middleware can short-circuit (return a response immediately), pass to the next middleware, or transform the response on the way back out. Order matters. UseAuthentication must come before UseAuthorization. UseRouting before UseEndpoints. The interview-trap question is usually 'what happens if you put UseAuthorization before UseAuthentication?' Answer: authorization runs before the user is identified, so every request fails with 401. Diagnosing middleware-order bugs is a senior signal at the new-grad tier.
What is Blazor and what's the difference between Blazor Server and Blazor WebAssembly?
Blazor is .NET's framework for building interactive web UIs using C# instead of JavaScript. Blazor Server runs the components on the server and uses a SignalR connection to push UI updates to the browser. Low initial download, real-time UI, but requires a persistent connection and round-trip latency for every interaction. Blazor WebAssembly compiles the entire app (including the .NET runtime) to WebAssembly and runs in the browser. Larger initial download, offline-capable, but the browser must download .NET. The 2026 best practice: Server for internal line-of-business apps where users are on a fast network and you want fast initial load. WebAssembly for public-facing apps where offline support matters or where you want to scale without server-side state. .NET 8 introduced 'Blazor Web Apps' that mix both modes per-component.
What's the difference between value types and reference types in C#?
Value types (int, double, bool, struct, enum) store their data directly. Reference types (class, interface, string, array, delegate) store a reference (pointer) to data on the managed heap. The interview-relevant consequences. Value types pass by value into methods, so modifying the parameter doesn't affect the caller. Reference types pass the reference by value, so the called method can mutate the object the caller holds. Value types live on the stack when local; reference types always live on the heap. Boxing happens when a value type is assigned to an object or interface variable: the value is copied to the heap and a reference is stored. Boxing is a hidden allocation that hurts hot-path performance, which is the trap question most new grads miss.
What is IDisposable and the using statement?
IDisposable is the interface for releasing unmanaged resources (file handles, database connections, sockets, OS handles). It has a single method, Dispose. The using statement guarantees Dispose runs even if an exception is thrown inside the block. C# 8 introduced the 'using declaration' syntax: `using var stream = new FileStream(...)` scopes the disposal to the enclosing block instead of nesting braces. The interview-relevant follow-up is the dispose pattern for classes that own both managed and unmanaged resources: implement IDisposable, provide a protected virtual Dispose(bool disposing) method, and call Dispose(true) from the public Dispose while Dispose(false) gets called from the finalizer. Most new-grad code only ever uses the consumer side, but interviewers ask about the implementer side.
What is LINQ and what's the difference between method syntax and query syntax?
LINQ (Language Integrated Query) is C#'s SQL-like syntax for querying collections, databases, XML, and any source with a LINQ provider. Method syntax uses extension methods chained together: `users.Where(u => u.Age > 18).OrderBy(u => u.Name).Select(u => u.Email)`. Query syntax is a SQL-style block: `from u in users where u.Age > 18 orderby u.Name select u.Email`. The compiler translates query syntax to method syntax. There's no runtime difference. Most teams prefer method syntax in 2026 because it composes more flexibly with non-LINQ operations and the lambda syntax is more familiar to developers from other languages. Query syntax is still useful for multi-source queries (joins) where the SQL-like readability wins.
What is dependency injection lifetime in ASP.NET Core?
Three lifetimes. Singleton: one instance created at app start, shared across all requests for the app's lifetime. Use for stateless services, configuration objects, expensive-to-construct dependencies. Scoped: one instance per HTTP request. Use for DbContext, services that depend on per-request state, anything that uses a unit-of-work pattern. Transient: a new instance every time it's resolved. Use for lightweight stateless services where capturing state would be a bug. The most common mistake is registering a DbContext as Singleton: it breaks change tracking, causes concurrency exceptions, and ships to production where it crashes under load. AddDbContext defaults to Scoped, which is the right choice.
How do I prepare for a .NET interview as a CS new grad?
Three weeks. Week 1: build a small ASP.NET Core API from scratch. Three endpoints, EF Core with SQLite, dependency injection, async controllers throughout. The hands-on work surfaces the questions you'll be asked. Week 2: drill the C# language internals (value vs reference types, boxing, async/await state machine, IDisposable, generics, delegates plus events). Read official docs, not third-party tutorials, because interviewers reference the docs. Week 3: rehearse the canonical questions out loud, narrate your reasoning during mock coding, walk through the .NET Framework vs Core vs .NET 8+ history (interviewers always ask). The week-one project is non-negotiable. Enterprise .NET interviewers can tell within 60 seconds whether you've built something or only studied for the test.
What's the most common .NET interview mistake new grads make?
Talking about C# without mentioning the runtime. The compiled IL, the JIT, the GC, the type system. A candidate who can write a foreach loop but can't explain why iterating a List allocates differently than iterating an array reads as someone who used C# but didn't learn it. The other common mistake is treating LINQ as magic, assuming every Where runs in SQL when it's actually IQueryable vs IEnumerable that determines where the filter runs. Interviewers grade depth, not just correctness. Knowing when EF materializes the query (ToList, ToArray, foreach, FirstOrDefault) is the signal that separates 'used LINQ in a tutorial' from 'shipped LINQ to production.'