
This course includes our updated coding exercises so you can practice your skills as you learn.
See a demo
Watch the instructor walk through the code step by step to show how each exercise is solved, and use the short, focused videos to compare your solution with mine.
Count character frequencies in a word by iterating with a foreach loop to build a result dictionary, then validate with tests; alternatively solve it with linq using GroupBy and ToDictionary.
Leverage the null conditional and null coalescing assignment operators to safely handle missing player data, initialize the highest score when needed, and update it when a higher score arrives.
Explore using a C# switch expression with when clauses to calculate shipping costs by order total and customer status, offering a concise alternative to if-else and validating with tests.
sum the numbers in an array from a start index inclusive to an end index exclusive, handling negative starts or start greater than end, using the range operator and sum.
Override the base text formatter in derived classes, such as ShoutFormatter and WhisperFormatter, using virtual methods and string interpolation to trim, uppercase or lowercase, and wrap messages in distinct formats.
Learn to implement a C# extension method on DayOfWeek that detects weekends by checking Saturday and Sunday, using a static class and a static method with this parameter.
Use a stack to check if parentheses are balanced: push opening, pop on closing; if you pop from empty or finish with a nonempty stack, return false; otherwise return true.
Implement a log method in C# that prints messages with a unique id starting at 1, using a static constructor and string interpolation, and increment the id after each log.
Define a generic pair class in C# that holds two values of the same type; include read-only first and second properties, a constructor, and a swap method using tmp.
Determine the tic-tac-toe winner by validating a 3x3 grid and checking rows, columns, and diagonals for X or O, using helper methods and a nullable result.
Learn to implement IComparer for custom sorting by book title, including a BookTitleComparer with a Compare method that handles nulls and uses case-insensitive string.Compare for List.Sort.
Sort messages by timestamp in descending order using LINQ, then map them to formatted strings. Format timestamps with ToString(format) or inline interpolated strings, and verify results with tests.
Use LINQ to filter a timestamped message collection sorted oldest to newest, skipping messages before today with SkipWhile and taking the first N from the remainder.
Practice defining expression-bodied members in a temperature converter, including a constructor, a read only property, a Celsius property with getter and setter for a Kelvin field, and Fahrenheit conversion method.
Implement a copy constructor for the book class that copies the fields and properties from another Book object, throws ArgumentNullException if null, and creates a new instance.
Practice implementing a simple sorting algorithm with bubble sort, swapping adjacent numbers across passes until the largest elements settle at the end, using a swap flag to stop early.
Explore how to determine if a type implements an interface using reflection, validating the interface with IsInterface and checking GetInterfaces with LINQ Any.
Implement a converter in c# to serialize a person object to json using the built‑in JsonSerializer and deserialize json back into a person object.
Learn how to extract a slice of a string using the Span type, given a starting index and length, and compare it with substring for memory-safe, efficient slicing in C#.
Define a custom RunMe attribute for methods and implement GetMarkedMethodNames(type) to return names of methods decorated with RunMe using reflection, GetMethods with BindingFlags and bitwise or, then GetCustomAttribute to filter.
Merge two user collections into one by using LINQ UnionBy with email as the key, discarding duplicates from the second collection.
Implement a generic CalculateAverage method using INumber<T> to work across numeric types via generic math. Sum all elements, then divide by the count to compute the average.
Implement deferred object creation with Lazy<T> to create the report only when the first access occurs, reuse it on later accesses, and avoid unnecessary work in ReportManager.
Query environment details with RuntimeInformation and Environment to return the operating system, number of logical processors, and whether the process is 64‑bit.
Split a collection of integers into full, equal-sized chunks with the GetFullChunks method, using LINQ's Chunk, throwing an exception for sizes below one and filtering to exclude incomplete final chunks.
Create a generic extension method for IEnumerable<T> that doubles all items by yielding each item twice, with proper null checks and static class requirements.
Practice computing basic statistics from a dataset of employee incomes by sorting to find min and max, using a LINQ average, and implementing median and mode with clear tie handling.
Validate a collection of contest participants, ensuring all are non-null, at least 18, with non-empty names and emails, and unique emails using LINQ All and a hashset.
Generate a random wizard name by selecting a name and a title from two lists, then join them with the word the, using the next method on the random instance.
Welcome to “C# — 100 Coding Exercises”—the most practical way to level up your C# skills, one problem at a time.
Learning to code isn’t just about watching videos—it’s about rolling up your sleeves and solving real problems. This course gives you 100 bite-sized, in-browser coding challenges, covering everything from the basics to advanced C# features. No setup or extra tools required—just open your browser and start coding.
Why practice with real coding exercises?
Mastering C# means practice, not just theory. These exercises are designed to help you really think in C#—so you’ll build the habits and confidence you need for any coding task.
Whether you’re preparing for job interviews, looking to sharpen your skills for your current job, or just love the satisfaction of solving problems, this course will get you there.
Each exercise is focused and practical, teaching core C# concepts, real-world problem-solving, and the kind of thinking that employers value.
What will you gain?
The ability to tackle a huge variety of real-world coding problems—loops, collections, LINQ, pattern matching, error handling, algorithms, and more.
Experience with modern C#—from tuple returns and nullable types, to reflection, operator overloading, custom attributes, and generic math.
The “muscle memory” to write code that’s clean, robust, and ready for interviews or professional work.
Step-by-step solutions for every exercise—you’ll get both a written explanation and a solution video (unlike many other exercise courses), so you can choose how you learn best.
For many problems, you’ll see more than one way to solve the task—helping you understand C# from multiple angles.
What makes this course different?
Hands-on learning—Solve every challenge directly in your browser. No downloads or installations needed.
Real variety—From simple tasks like string manipulation and list filtering to advanced problems involving generics, events, LINQ, and more. There’s something here for every level.
Immediate feedback—Submit your solution and see the results instantly, so you learn fast and keep improving.
Solution videos for every exercise—See the video walkthrough whenever you need them, or just check the written solution if you prefer.
Interview readiness—Practicing with real coding challenges is the best way to prepare for C# interviews and coding assessments.
Your path to C# mastery
I’m a .NET Technical Lead with 10+ years of industry experience, and I’ve built these exercises to help you build real, job-ready C# skills.
Whether you’re new to C#, coming back after a break, or just want to sharpen your edge, I’ll help you level up—one exercise at a time.
Additional perks:
Lifetime access and free updates—get all new exercises and improvements.
This course is covered by Udemy’s 30-day Refund Policy, so you can try it out risk-free.
Enroll now and start solving your way to C# mastery!