C# skill check
Practise the C# that interviews actually probe: value versus reference types, LINQ, async and await, generics, and exception flow, with code you read and reason about.
15
Questions
14 min
Timer can't pause
Multiple choice
C# 12 on .NET 8
Choose a level
Question type
Topics
- Value and reference types
- Strings
- LINQ
- async and await
- Generics
- Exceptions
- Collections
- Properties and records
Do
Use scratch paper or a notepad to work things out. Skip a question and come back to it later.
Don't
Run the code or look up answers during the check. Open the check in more than one tab or window.
Easy · Mixed · 15 questions · 14 min
By starting, you agree to the Terms and Privacy Policy.
Practice checks each answer as you go, with an explanation. The exam is checked when you submit; 9 of 15 passes and earns a certificate.
Checking your levels…
Certificates come from the certified exam: pass with 9 of 15 while signed in. View a sample certificate.
Sample C# questions with answers
These are never used in a check, so seeing their answers here won't give anything away.
Question 1 · Easy · Value and reference types
What is the primary behavioral difference when assigning a variable of a struct type compared to a variable of a class type?- A.A struct variable copies its data by value, whereas a class variable copies the reference to the same object on the heap.
- B.A struct variable creates a shallow reference, whereas a class variable creates an independent deep clone.
- C.A struct variable requires explicit memory deallocation, whereas a class variable is managed by the garbage collector.
- D.A struct variable can store null by default, whereas a class variable cannot store null unless marked nullable.
Show answer
A. A struct variable copies its data by value, whereas a class variable copies the reference to the same object on the heap.
Structs are value types in C#, so assignment copies the complete value (all fields). Classes are reference types, so assignment copies only the reference pointing to the instance in memory.Question 2 · Easy · Strings
Why is using StringBuilder generally preferred over repeated string concatenation with the '+' operator inside a large loop?- A.StringBuilder stores characters uncompressed in unmanaged memory to bypass garbage collection entirely.
- B.StringBuilder performs string operations across multiple CPU threads concurrently.
- C.System.String is immutable, so repeated '+' creates a new string object and copies data on every iteration.
- D.The '+' operator cannot handle null values inside loops and throws NullReferenceException.
Show answer
C. System.String is immutable, so repeated '+' creates a new string object and copies data on every iteration.
C# strings are immutable, meaning any concatenation creates a new string instance and copies characters, leading to high memory allocations. StringBuilder maintains an internal mutable buffer to append in-place efficiently.Question 3 · Moderate · Exceptions
What is the difference between writingthrow;and 'throw ex;' inside acatch (Exception ex)block?- A.'throw ex;' automatically wraps the exception in a new TargetInvocationException, whereas
throw;does not. - B.
throw;suppresses the exception filter evaluation, whereas 'throw ex;' allows exception filters to re-evaluate. - C.
throw;preserves the original call stack trace, while 'throw ex;' resets the stack trace to the catch site. - D.
throw;only works inside finally blocks, whereas 'throw ex;' must be used in catch blocks.
Show answer
C.
throw;preserves the original call stack trace, while 'throw ex;' resets the stack trace to the catch site.Usingthrow;re-throws the current exception without altering its stack trace, while 'throw ex;' resets the stack trace entry point to the location where it is re-thrown.- A.'throw ex;' automatically wraps the exception in a new TargetInvocationException, whereas
Question 4 · Advanced · async and await
What is the effect of calling.ConfigureAwait(false)inside an ASP.NET Core request pipeline on .NET 8?- A.It prevents deadlocks caused by the ASP.NET Core SynchronizationContext.
- B.It has virtually no effect because ASP.NET Core does not have a SynchronizationContext.
- C.It detaches the HttpContext from AsyncLocal storage, causing HttpContext to become null.
- D.It forces the continuation to run on a background thread instead of the I/O completion port.
Show answer
B. It has virtually no effect because ASP.NET Core does not have a SynchronizationContext.
Unlike legacy ASP.NET on .NET Framework, ASP.NET Core has no SynchronizationContext; continuations already resume on thread pool threads, making ConfigureAwait(false) largely a no-op.
How scoring and certificates work
- Each check has 15 multiple-choice questions with one correct answer, and one timer for the whole check. A question you leave unanswered scores nothing.
- Practice is free without an account and shows whether each answer is right as you go, with an explanation.
- The certified exam is scored when you submit. 60% passes, which is 9 of 15. Easy unlocks Moderate, and Moderate unlocks Advanced.
- Passing the exam while signed in earns a free certificate, valid for one year, with its own verification page. See a sample certificate.