Quizzes

C# quizzes

Choose a quiz and test your understanding of a focused concept.

C# Catch Multiple Exceptions Quiz: Filters, TryParse, and Safer Error Handling

Test your C# knowledge on catching multiple exceptions, using exception filters, and preferring TryParse for invalid input.

C# Quiz: Using Directives Inside vs Outside a Namespace

Test your understanding of C# using directive scope, name resolution, aliases, and why StyleCop prefers imports inside namespaces.

C# Version Numbers Quiz: C# vs .NET Framework Explained

Test your understanding of C# language versions versus .NET Framework and .NET releases, and learn why “C# 3.5” is incorrect.

Case-Insensitive String.Contains in C# Quiz

Test your understanding of case-insensitive string matching in C# using Contains, IndexOf, StringComparison, and common pitfalls.

Deep Copy and Object Cloning in C# Quiz

Test your understanding of deep copy, shallow copy, DeepCopy methods, and cloning pitfalls in C# with practical quiz questions.

How to Cast an int to an Enum in C# Quiz

Test your understanding of casting ints to enums in C#, validation with Enum.IsDefined, common mistakes, and safe usage patterns.

How to Enumerate an Enum in C#: Quiz on Enum.GetValues and Enum.GetNames

Test your understanding of iterating over C# enum values with Enum.GetValues, GetNames, common mistakes, and real-world uses.

How to Generate a Random Integer in C# Quiz

Test your understanding of generating random integers in C# using Random.Next(), ranges, pitfalls, and real-world examples.

How to Iterate Over a Dictionary in C#: foreach, Keys, Values, and KeyValuePair Quiz

Test your understanding of iterating over C# dictionaries with foreach, Keys, Values, deconstruction, and common mistakes.

String vs string in C#: Quiz on Type Aliases, Usage, and Common Mistakes

Test your understanding of `string`, `String`, and `System.String` in C# with practical questions on aliases, style, behavior, and usage.