.NET coding challenges

Every week, we post a number of .NET coding challenges which feature ASP.NET Core and C# interview questions for you to practice online.

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

Watch the video where we answer some of the challenges:

Each challenge will feature a programming exercise for you to solve. Some are for beginners. Some are more advanced. Once you have finished with the exercise, you can reveal the answer.

Using the Route attribute in an ASP.NET Core Web API

Using the Route attribute in an ASP.NET Core Web API

Learn how to use the Route attribute in an ASP.NET Core Web API controller with our C# coding challenge
Dependency injection circular dependency dangers in .NET

Dependency injection circular dependency dangers in .NET

Take our ASP.NET Core coding challenge where we explore the circular dependency dangers with the IoC container in dependency injection.
Using a partial class in C#

Using a partial class in C#

Take our C# coding challenge where we add the partial keyword so we can add two identical class names without any compile errors.
Configuring an appsettings.json environment

Configuring an appsettings.json environment

Take our ASP.NET Core coding challenge that will configure an appsettings.json environment variable to Production.
Using an interface in C#

Using an interface in C#

This C# coding challenge looks at how an interface works in C# and why an inherited class won't compile.
Add a connection string to appsettings.json

Add a connection string to appsettings.json

Take our .NET coding challenge to add a connection string to appsettings.json so an ASP.NET Core app can connect to a SQL Server database.
Using the yield statement in C#

Using the yield statement in C#

This C# coding challenge looks at the yield statement and how to use it in a collection like a list or an array.
Using Theory in xUnit for unit tests

Using Theory in xUnit for unit tests

Take our .NET coding challenge which uses Theory in xUnit for writing parameterised unit tests.
Using the abstract modifier in C#

Using the abstract modifier in C#

This C# coding challenge looks at how the abstract modifier works in C# and why an inherited abstract class won't compile.
Inject services with different lifetimes with .NET

Inject services with different lifetimes with .NET

Take our .NET coding challenge to use ASP.NET Core dependency injection to inject services with different lifetimes.