C# MCQ
Test your C# knowledge with 100 multiple choice questions covering fundamentals to advanced concepts, with instant feedback and explanations.
What company developed C#?
2What runtime executes C# code?
3How do you print to the console in C#?
4What keyword is used to declare a variable that cannot be reassigned?
5Which C# data type stores a sequence of characters?
6What is the entry point of a C# console application?
7What is a namespace in C#?
8What does the var keyword do in C#?
9What is an interface in C#?
10What is the difference between class and struct in C#?
11What is a property in C#?
12What does the override keyword do?
13What is the purpose of using statement?
14What is LINQ?
15What are generics in C#?
16What is a delegate in C#?
17What is an event in C#?
18What does async/await do in C#?
19What is the null-conditional operator ?. in C#?
20What is the null coalescing operator ?? in C#?
21What is an enum in C#?
22What is exception handling in C# using try-catch?
23What is an array in C#?
24What is a List<T> in C#?
25What is the difference between == and .Equals() for strings in C#?
26What is the sealed keyword in C#?
27What is string interpolation in C#?
28What is a static class in C#?
29What does the base keyword do?
30What is the purpose of IDisposable?
31What is a lambda expression in C#?
32What is the difference between Task and Thread in C#?
33What is an abstract class in C#?
34What does the as keyword do?
35What is boxing in C#?
36What is a partial class?
37What is the => syntax used for in property declarations?
38What is the difference between Array and ArrayList in C#?
39What is the this keyword in C#?
40What are primary constructors in C# 12?
What is the difference between IEnumerable<T> and IQueryable<T>?
2What is a Task in C# and how does it differ from void async methods?
3What is the IEnumerable<T> interface and yield return?
4What is the difference between Func<T, TResult> and Action<T>?
5What is a record type in C# (C# 9+)?
6What are nullable reference types in C# 8+?
7What is pattern matching in C#?
8What are extension methods in C#?
9What is the difference between ref and out parameters?
10What is an indexer in C#?
11What is covariance and contravariance in C# generics?
12What is a CancellationToken?
13What is the difference between lock and Monitor in C#?
14What is an attribute in C#?
15What is LINQ's deferred execution?
16What is the Span<T> type in C#?
17What does ConfigureAwait(false) do?
18What is the difference between ValueTask and Task?
19What is a source generator in C#?
20What is the init accessor in C# 9?
21What is an implicit operator in C#?
22What is the Decorator pattern in C# and when would you use it?
23What is the purpose of IAsyncEnumerable<T>?
24What is the difference between string and StringBuilder for performance?
25What is a Lazy<T> in C#?
26What is the using declaration (C# 8)?
27What is object pooling in C# and when should you use it?
28What is the IProgress<T> interface?
29What is the difference between Func<T, TResult> and Expression<Func<T, TResult>>?
30What are channels in .NET System.Threading.Channels?
31What is the Action<> and Func<> delegate shorthand for?
32What are default interface methods in C# 8?
33What is top-level statements in .NET 6+?
34What is the Roslyn API?
35What is the File-Scoped Namespace in C# 10?
36What is global using in C# 10?
37What is collection expressions in C# 12?
38What is the frozen collections in .NET 8?
39What is the difference between IEnumerable and IReadOnlyCollection in C#?
40What is the purpose of the params keyword in C#?
What is the .NET runtime's GC generational model?
2What is the difference between managed and unmanaged resources in .NET?
3What is the Dispose pattern and when should you implement a finalizer?
4What is IL (Intermediate Language) and how does the JIT compile it?
5What is the difference between SemaphoreSlim and Semaphore?
6What is the Expression<T> type?
7What is the purpose of the unsafe keyword in C#?
8What is covariant return types in C# (C# 9)?
9What is the difference between Thread.Sleep and Task.Delay?
10What is a ref struct in C# and what restrictions apply?
11What is .NET's NativeAOT compilation?
12What is the .NET runtime's tiered compilation?
13What is the .NET Runtime Performance Improvement approach with Spans?
14What is the C# abstract record and how does it interact with pattern matching?
15What is the Dispose Pattern and GC.SuppressFinalize interaction?
16What is the .NET System.Text.Json source generation?
17What is the .NET green thread (Task) versus OS thread performance model?
18What is MVVM pattern and how does it relate to C# data binding?
19What is the .NET Memory Model and how does it differ from the JMM?
20What is the difference between Debug and Release configurations in .NET?