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

πŸ“š .NET Interview Questions

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

Phase 24 — Legacy .NET and Migration

Working with and modernising legacy .NET: .NET Framework, ASP.NET MVC 5 and Web API 2, Web Forms, WCF, Windows Services, EF6 and ADO.NET, and the strategies and tools to migrate them incrementally to .NET 10.

  1. What is .NET Standard, and when would you still target netstandard2.0 instead of multi-targeting net48 and net10.0?
    Beginner Theory Legacy Technologies
  2. Why is IHttpContextAccessor risky in background work, and what should you pass instead?
    Junior Theory Legacy Technologies
  3. How would you move a Web Forms app from in-process session to a distributed store before migrating, and why does it matter?
    Intermediate Theory Legacy Technologies
  4. Your WCF service is called by an external partner over SOAP and by three internal .NET services. How would you migrate it to .NET 10 without breaking anyone?
    Intermediate Theory Legacy Technologies
  5. How do you call a legacy SOAP or WCF service from a .NET 10 application, and what are the gotchas?
    Intermediate Theory Legacy Technologies
  6. How do you introduce EF Core migrations to an existing production database that was managed by EF6 migrations or by hand?
    Mid-Level Theory Legacy Technologies
  7. Your ASP.NET app starts throwing 'Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool' at peak times. How do you find the cause?
    Mid-Level Theory Legacy Technologies
  8. Private Bytes keeps growing but the managed heap is flat in your .NET Framework app. What does that tell you, and how do you find a native leak?
    Senior Debugging Legacy Technologies
  9. What is the difference between .NET Framework and modern .NET (.NET Core, .NET 5 and later)? What changed, how does each one's support lifecycle work, and why do both still exist in 2026?

    Covers .NET Framework 4.x versus modern .NET: runtime and platform differences, side-by-side versus in-place installs, the support policies (Windows-bound versus LTS/STS) and why companies still run both.

    Beginner Theory Legacy Technologies Β· πŸ”— 3 follow-ups
  10. How do ASP.NET MVC 5 and Web API 2 differ from ASP.NET Core? Explain System.Web, Global.asax, HttpContext.Current and web.config, and what replaces each of them in .NET 10.

    Covers the classic ASP.NET stack (System.Web, IIS integrated pipeline, Global.asax, HttpModules, HttpContext.Current, web.config, separate MVC and Web API) and the ASP.NET Core equivalents (Program.cs, middleware, IHttpContextAccessor, appsettings.json, unified MVC).

    Junior Theory Legacy Technologies Β· πŸ”— 3 follow-ups
  11. How does ASP.NET Web Forms work? Explain the page lifecycle, ViewState and postbacks, why teams loved it, the problems it causes, and why it has no direct successor in modern .NET.

    Covers the Web Forms model: server controls, the page lifecycle events, ViewState and its size and security, postbacks and event handlers, why it suited desktop developers, and why Microsoft did not port it (Razor Pages and Blazor are the closest replacements).

    Intermediate Theory Legacy Technologies Β· πŸ”— 2 follow-ups
  12. What is WCF? Explain the ABCs (address, binding, contract), the common bindings, SOAP and the WS-* standards, why it was so popular in enterprises, and what replaces it on .NET 10.

    Covers Windows Communication Foundation: service, data and operation contracts, endpoints, bindings (basicHttp, wsHttp, netTcp, netNamedPipe), SOAP and WS-Security/ReliableMessaging/transactions, configuration in web.config, and the modern options (gRPC, REST, CoreWCF, the WCF client packages).

    Intermediate Theory Legacy Technologies Β· πŸ”— 2 follow-ups
  13. What is the difference between a classic Windows Service and a .NET Worker Service? Explain how each is hosted, installed and logged, and how you would build a background service on .NET 10 that runs as a Windows service.

    Covers ServiceBase-based Windows Services on .NET Framework (InstallUtil, OnStart/OnStop, Event Log) versus Worker Services on the Generic Host (BackgroundService, UseWindowsService, sc.exe, ILogger, systemd and containers).

    Junior Theory Legacy Technologies Β· πŸ”— 2 follow-ups
  14. You are migrating a data layer from Entity Framework 6 to EF Core on .NET 10. Which behaviour differences bite during the move? Cover EDMX models, lazy loading, client evaluation, cascade and relationship conventions, and how you would migrate safely.

    Covers the practical EF6-to-EF Core differences: no EDMX or ObjectContext, lazy loading off by default, client evaluation removed in EF Core 3.0, query translation and split queries, conventions, cascade delete, many-to-many, stored procedure mapping, and running EF6 on .NET 10 as a stepping stone.

    Mid-Level Theory Legacy Technologies Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  15. Which ADO.NET basics are still worth knowing when you mostly use EF Core? Explain SqlConnection, SqlCommand, SqlDataReader and parameters, how connection pooling really works, and the bugs you find in legacy ADO.NET code.

    Covers raw ADO.NET with Microsoft.Data.SqlClient: connection lifetime and pooling (pool per connection string, Max Pool Size, pool exhaustion), commands and parameters versus string concatenation, readers versus DataSet/DataTable, async APIs, transactions, and the typical legacy bugs.

    Mid-Level Theory Legacy Technologies Β· πŸ”— 2 follow-ups Β· πŸ›  1 real-world
  16. A legacy ASP.NET MVC 5 app on .NET Framework 4.8 and IIS keeps growing in memory and the application pool recycles every few hours, logging users out. You can't change much code and can't attach a debugger in production. How do you find the cause and fix it?

    Covers diagnosing a memory leak in a .NET Framework app on IIS: reading the recycle cause (private memory limit, regular time interval), Performance Monitor counters, capturing dumps with ProcDump or Debug Diagnostic Tool, analysing with WinDbg/SOS or PerfView, common legacy leak sources, and low-risk mitigations.

    Senior Debugging Legacy Technologies Β· πŸ”— 2 follow-ups Β· πŸ›  1 real-world
  17. Code review: a legacy Web API 2 OrdersController reads the user from HttpContext.Current, keeps a static list of recent orders, builds SQL by string concatenation over a synchronous SqlConnection, and reads a payment gateway key from web.config appSettings. What do you flag, ranked by severity, and what does the .NET 10 rewrite look like?

    A senior code review of legacy Web API 2 code: secrets in web.config, SQL injection, thread-unsafe static state, HttpContext.Current coupling, undisposed connections and synchronous I/O, with a ranked list of findings, kind review comments, and the ASP.NET Core rewrite using DI, options, Key Vault and async parameterised data access.

    Senior CodeReview Legacy Technologies Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  18. How would you ship a library to NuGet that supports both .NET Framework 4.8 and .NET 10, and how do you decide when to drop the net48 target?
    Mid-Level Coding Migration Topics
  19. Your Worker Service runs in Kubernetes and loses in-flight work on every deployment. How do you make shutdown graceful?
    Mid-Level Coding Migration Topics
  20. Before you migrate a .NET Framework application to .NET 10, how do you do the compatibility analysis? What do you check in the dependencies, the APIs you call, the NuGet packages and any Windows-only code, which tools do you use, and what does the output of that analysis look like?

    Covers compatibility analysis before a .NET Framework to .NET 10 migration: dependency graphs, unsupported APIs (System.Web, WCF server, AppDomains, remoting), NuGet package support, Windows-only code, the tooling (GitHub Copilot app modernisation, the legacy Upgrade Assistant analyser, platform compatibility analysers) and turning findings into a migration backlog.

    Intermediate Theory Migration Topics Β· πŸ”— 3 follow-ups

🌐 Sangam's Webring

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