.NET coding challenges

Improve your C# knowledge

Improve your C# knowledge

Test yourself with our coding challenges to help improve your C# coding knowledge.

Code your solution

Code your solution

Our coding challenges come with an online code editor so you code your solution and see if it compiles.

View compile exceptions

View compile exceptions

You will be able to view any exception messages when trying to build your solution.

Or choose one of our many C# coding challenges to test your knowledge:

Convert hours, minutes and seconds into a time formatted string

Convert hours, minutes and seconds into a time formatted string

Pass in the hours, minutes and seconds into a method and get it to return a time formatted string which should include leading zeros.
Contains online code editor
Work out the number of days between two dates

Work out the number of days between two dates

Write a C# function to work out the difference between two dates and return the number of days in this coding challenge.
Contains online code editor
Removing the last character from a string

Removing the last character from a string

This coding challenge involves writing a C# method that will removing the last character from a string and returning the value.
Contains online code editor
Write a C# function to convert MPH to KPH

Write a C# function to convert MPH to KPH

Take our coding challenge to write a C# function with the necessary parameters that converts miles-per-hour (MPH) to kilometres-per-hour (KPH) and vice-versa.
Contains online code editor
Guess the SOLID principle from C# code - Part 2

Guess the SOLID principle from C# code - Part 2

The SOLID principles is a popular technical question in a .NET job interview, so take our coding challenge to see if you know which principle we are using.
Initialising a C# static class won't compile

Initialising a C# static class won't compile

This coding challenge looks at initialising a C# static class in .NET and why the code will throw a compile error.
Add an extension method to a C# class

Add an extension method to a C# class

See if you can add a static extension method to a class and not modify the original type with our C# coding challenge
Add a hosted service to an ASP.NET Core app

Add a hosted service to an ASP.NET Core app

See if you can add a background hosted service in an ASP.NET Core app with our .NET coding challenge
Why does inheritance in a C# class not always compile?

Why does inheritance in a C# class not always compile?

A coding challenge to find out why class inheritance in C# doesn't always compile a .NET application and how to resolve it.
How to read an appsettings.json value in ASP.NET Core

How to read an appsettings.json value in ASP.NET Core

See if you can read an appsettings.json configuration value from IConfiguration in an ASP.NET Core with our .NET coding challenge.