🔷 .NET Interview Questions

Master .NET interviews with questions on C#, ASP.NET Core, Entity Framework, and the .NET ecosystem

Explain the difference between .NET Framework, .NET Core, and .NET 5+

Easy

.NET Framework: Windows-only, legacy platform (up to version 4.8). Includes WPF, Windows Forms, ASP.NET. No longer actively developed for new features.

.NET Core: Cross-platform, open-source reimplementation (versions 1.0-3.1). Designed for cloud, microservices, and containers.

.NET 5+: Unified platform (5, 6, 7, 8, 9...). Combines .NET Framework and .NET Core. Cross-platform, modern, and the future of .NET. Even versions are LTS (Long-Term Support).

C#

What are Records in C# and how do they differ from Classes?

Medium

Records are reference types designed for immutable data models with value-based equality. Introduced in C# 9.0, they provide a concise syntax for creating data-centric types.

Key Differences:

  • Records have value-based equality by default (classes have reference equality)
  • Records support with-expressions for non-destructive mutation
  • Records have built-in ToString() implementation
  • Records are immutable by default (but can be made mutable)
C#

Explain async/await and Task Parallel Library (TPL) in .NET

Hard

async/await is C#'s syntax for asynchronous programming, making it easier to write non-blocking code. The Task Parallel Library (TPL) provides the foundation for parallel and asynchronous programming.

C#

What is Dependency Injection in ASP.NET Core and how does it work?

Medium

Dependency Injection (DI) is a design pattern where objects receive their dependencies from external sources rather than creating them. ASP.NET Core has built-in DI container that manages object lifetimes.

Service Lifetimes:

  • Transient: Created each time they're requested
  • Scoped: Created once per client request (HTTP request)
  • Singleton: Created once for the application lifetime
C#

Explain LINQ and demonstrate advanced query operations

Medium

LINQ (Language Integrated Query) provides a uniform way to query different data sources using C# syntax. It supports method syntax and query syntax for writing expressive queries.

C#

Interview Tips for .NET