.NET coding challenges

We have a number of .NET coding challenges which feature ASP.NET Core and C# interview questions for you to practice online.

Some of them feature our online code editor so you can write the code yourself and see if it builds.

Whether you are wanting to become a C# developer or looking for a new job, our exercises will help you to learn coding.

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.
Using data annotations for Web API model validation

Using data annotations for Web API model validation

This .NET coding challenge tests how to use data annotations for model validation in an ASP.NET Core Web API endpoint by assigning them to model properties.