gitGood.dev

C# Interview Questions

Practice C# questions covering .NET framework, LINQ, async/await, generics, delegates, and enterprise application patterns.

28
Total Questions
10
Easy
14
Medium
4
Hard
Showing 1-20 of 28 questionsPage 1 of 2
Sign up to start practicing these questionsSign up free →
Value vs Reference Types
QuizEasy
Nullable Reference Types
QuizEasy
async/await Mechanics
QuizMedium
Interface vs Abstract Class
QuizEasy
LINQ Deferred Execution
QuizMedium
Delegates vs Events
QuizMedium
When to Use Struct
QuizMedium
Span<T> and Memory<T>
QuizHard
Expression-Bodied Members
QuizEasy
Record Types
QuizMedium
Garbage Collection
QuizMedium
IDisposable Pattern
QuizMedium
Extension Methods
QuizEasy
Pattern Matching
QuizMedium
Covariance and Contravariance
QuizHard
Task vs ValueTask
QuizHard
ref, in, out Parameters
QuizMedium
Thread-Safe Collections
QuizMedium
Boxing and Unboxing
QuizEasy
Source Generators
QuizHard

Frequently Asked Questions

What C# topics should I study for interviews?

Core topics include OOP principles in C#, LINQ, async/await patterns, generics, delegates and events, exception handling, interfaces vs abstract classes, and dependency injection. Framework-specific topics include Entity Framework, ASP.NET Core, and the .NET runtime (GC, JIT).

Is C# still relevant for modern development?

Absolutely. C# powers enterprise applications, game development (Unity), cloud services (Azure), and cross-platform apps (.NET MAUI). Microsoft's continued investment in .NET and C# keeps it among the top programming languages. It's especially dominant in enterprise and game development.

How does async/await work in C#?

async marks a method as asynchronous. await pauses execution until the Task completes without blocking the thread. The compiler transforms async methods into state machines. Use async/await for I/O-bound operations (HTTP calls, database queries, file operations) to keep applications responsive.

What is LINQ and how is it used?

Language Integrated Query provides SQL-like syntax for querying collections, databases, and XML in C#. It supports method syntax (collection.Where().Select()) and query syntax (from x in collection where...). LINQ improves readability and reduces boilerplate for data manipulation.

What are delegates and events in C#?

Delegates are type-safe function pointers that reference methods. Events are a pattern built on delegates for publish-subscribe communication. Action<T> and Func<T> are built-in delegate types. Events are used extensively in UI frameworks, game development, and event-driven architectures.

How does garbage collection work in .NET?

The .NET GC uses generational collection (Gen 0, 1, 2) based on object lifetime. Short-lived objects are collected quickly in Gen 0. Long-lived objects promote to higher generations. The Large Object Heap handles objects over 85KB. Understanding GC helps with performance optimization and avoiding memory pressure.

Explore Other Categories