🔷 .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).
What are Records in C# and how do they differ from Classes?
MediumRecords 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)
Explain async/await and Task Parallel Library (TPL) in .NET
Hardasync/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.
What is Dependency Injection in ASP.NET Core and how does it work?
MediumDependency 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
Explain LINQ and demonstrate advanced query operations
MediumLINQ (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.
Interview Tips for .NET
- ✓ Understand the evolution from .NET Framework to modern .NET
- ✓ Know async/await deeply - it's used everywhere in modern .NET
- ✓ Be familiar with Dependency Injection and service lifetimes
- ✓ Practice LINQ queries - both syntax styles
- ✓ Understand Entity Framework Core and database migrations
- ✓ Know modern C# features (records, pattern matching, null-safety)
- ✓ Be ready to discuss ASP.NET Core middleware pipeline