Top 100 C# Interview Questions and Answers

C# interview questions from language fundamentals to the type system, delegates, LINQ, async and memory — with code examples and the follow-ups interviewers ask.

13 questionsFree · Updated for 2026

C# questions are the largest part of any .NET interview. This collection runs from the fundamentals a fresher is asked to the runtime and concurrency detail expected at 3–5 years.

Fundamentals

4 questions
01What is C#?

C# is a modern, statically typed, object-oriented (and increasingly functional) programming language from Microsoft. It compiles to Intermediate Language (IL) that runs on the .NET runtime (the CLR), which…

Read detailed answer
02What is the difference between a value type and a reference type?

A value type (struct, enum, int, bool, DateTime) holds its data directly; assigning or passing it copies the value. A reference type (class, interface, array, delegate, string) holds a reference to an object…

Read detailed answer
03What is the difference between ref and out parameters?

Both pass an argument by reference so the method can modify the caller's variable. ref requires the variable to be initialised before the call and the method may read it. out does not require initialisation…

Read detailed answer
04What is the difference between string and StringBuilder?

string is immutable — every concatenation or modification allocates a new string object. StringBuilder is a mutable buffer; appends modify it in place (growing an internal array as needed). Use StringBuilder…

Read detailed answer

Type system & OOP

2 questions
05What is boxing and unboxing in C#?

Boxing is wrapping a value type in an object (or interface) reference so it can live on the heap — it happens implicitly when you assign an int to an object. Unboxing is the explicit cast back to the value…

Read detailed answer
06What is the difference between an abstract class and an interface?

An abstract class is a base class you can't instantiate; it can hold state (fields), constructors, and a mix of implemented and abstract members, and a class can inherit only one. An interface is a contract —…

Read detailed answer

Delegates, LINQ & queries

3 questions
07What are delegates in C#?

A delegate is a type-safe reference to a method — effectively a function pointer with a signature. You can store methods in delegate variables, pass them as arguments, and invoke them later. Func<>, Action<>…

Read detailed answer
08What is LINQ in C#?

LINQ (Language-Integrated Query) is a uniform way to query data — in-memory collections, databases, XML, JSON — using C# operators like Where, Select, OrderBy, GroupBy and Join, in either method syntax or…

Read detailed answer
09What is the difference between IEnumerable and IQueryable?

IEnumerable<T> represents an in-memory sequence; LINQ operators run as compiled delegates and iterate objects client-side. IQueryable<T> represents a query against a remote provider (e.g. a database); LINQ…

Read detailed answer

Async & the runtime

4 questions
10How do async and await work in C#?

async/await let you write non-blocking asynchronous code that reads sequentially. await on an incomplete Task returns control to the caller and registers a continuation; when the awaited operation finishes,…

Read detailed answer
11What is the CLR (Common Language Runtime)?

The CLR is the execution engine for .NET. It loads assemblies, JIT-compiles Intermediate Language (IL) to native machine code, enforces type safety, manages memory with the garbage collector, and provides…

Read detailed answer
12What is the difference between managed and unmanaged code?

Managed code runs under the CLR, which handles memory, type safety and exceptions — normal C#/.NET code. Unmanaged code runs directly on the OS with no CLR services — C/C++ libraries, COM components, OS…

Read detailed answer
13How does garbage collection work in .NET?

The .NET GC is a generational, mark-and-compact collector. New objects go in Gen 0; objects that survive a collection are promoted to Gen 1, then Gen 2. Most collections are small, fast Gen 0 sweeps. The GC…

Read detailed answer
Back to the interview hub