.NET

.NET Practice Exercises

Build production-ready .Net backends through hands-on challenges, one concept at a time.

.NET 10.NET 10
Read the .NET overview
Module 1

Dependency Injection

Learn how the container builds your objects instead of you: registering an interface against its implementation, letting constructors receive what they need rather than calling new, resolving every implementation of one interface at once, and choosing the lifetime that makes state shared or fresh.

4
About this challenge

This problem covers choosing how long each service should live, so a counter shared by the whole application keeps counting while a value that belongs to one request starts fresh every time.

About this challenge

This problem covers letting the container build a whole chain of collaborating objects, so a service and everything beneath it arrives ready to use instead of being constructed by hand at the top.

About this challenge

This problem covers applying a chain of discount rules to a price one after another, with the rules coming from the container as a set rather than being listed by hand, and the order they were registered in deciding the order they apply.

About this challenge

This problem covers sending one message through every notification channel the application has, counting deliveries across the whole application while keeping each request's own details separate, and reporting what each channel did.

Module 2

Configuration and Options

Learn how an application reads its settings: binding a configuration section to a typed class, layering files and environment variables so the right value wins, and refusing to start when a setting is wrong.

4
About this challenge

This problem covers reading email server settings out of configuration into a typed class, then using those settings to report the connection details and to preview how an email would be sent.

About this challenge

This problem covers layering settings from a base file, an environment specific file and environment variables, so each setting takes its value from the highest layer that sets it and falls back to the layer below when it does not.

About this challenge

This problem covers checking configuration values as the application starts, so a bad setting stops it straight away with a message naming what is wrong, instead of failing later inside a request.

About this challenge

This problem covers binding a nested block of payment settings into typed objects, checking them as the application starts, and reporting the gateway profile without ever exposing the API key itself.

Module 3

Minimal APIs and Routing

Learn how routes become endpoints: mapping the verbs of a resource, constraining what a URL segment will match, taking query values straight into handler parameters, and sharing one prefix across a group.

4
About this challenge

This problem covers the three basic endpoints of a resource, listing everything, fetching one by its id, and adding a new one, each answering with the right status code and pointing the caller at what was just created.

About this challenge

This problem covers letting the routing table itself reject a badly formed URL, so a lookup by order number only matches whole numbers and a lookup by tracking code only matches a real code, and anything else never reaches the code behind it.

About this challenge

This problem covers taking search filters straight from the query string as typed handler parameters, each falling back to a sensible default when the caller leaves it out, and turning away a value that is not of the right type.

About this challenge

This problem covers building the five endpoints of a task tracker behind one shared URL prefix, so listing can be filtered, creating points at what it made, and updating or deleting something that is not there says so.

Module 4

Model Binding and Validation

Learn how a request turns into objects your code can trust: binding a JSON body to a typed record, pulling values from headers and the query string, stating the rules on the model itself, and reporting every field that failed.

4
About this challenge

This problem covers taking a JSON signup body straight into a typed record on the handler, filling in defaults for anything left out, and turning away a body that cannot be read or arrives as the wrong kind of content.

About this challenge

This problem covers stating the rules a product has to satisfy on the product itself, then storing one that passes and answering one that fails with the names of the fields that were wrong.

About this challenge

This problem covers pulling one value out of a request header and another out of the query string straight into handler parameters, requiring the header, defaulting the query value, and answering differently depending on which one is wrong.

About this challenge

This problem covers checking an order that arrives across three places at once, the URL, a request header and the body, then reporting every part that was wrong together, and storing the order only once all of it holds.

Module 5

Middleware

Learn how every request passes through a pipeline before and after your endpoint: measuring and logging a call, answering one yourself without going further, putting the stages in an order that works, and carrying one id through all of them.

4
About this challenge

This problem covers timing every request as it passes through the application and leaving one log entry for it, recording the method, the path, the status it ended with and how long it took, without changing the answer itself.

About this challenge

This problem covers putting a switch in front of the whole application, so that while it is on every request is turned away with the same notice and told when to come back, and while it is off nothing about the normal answers changes.

About this challenge

This problem covers putting the stages a request passes through into the right order, so failures anywhere are caught and turned into a proper answer, and a protected endpoint is guarded before it ever runs.

About this challenge

This problem covers giving every request one id that follows it all the way through the application, so each stage and each log line reports the same one, and it comes back on the response whatever happened to the request.

Module 6

LINQ and Collections

Learn how to turn stored data into an answer: filtering and projecting to just what a caller should see, grouping and aggregating into a report, and settling a query's result so it stops changing underneath you.

4
About this challenge

This problem covers turning the catalog the warehouse keeps into a listing a customer can see, dropping what is out of stock or outside the asked-for price range, ordering what is left by price, and leaving the internal fields behind.

About this challenge

This problem covers gathering recorded sales into one line per category, reporting how many each holds, what they add up to and what they average, and listing the richest category first with ties settled by name.

About this challenge

This problem covers taking a handover report and settling it then and there, so the copy kept says what the log said at that moment however the log changes afterwards, while a fresh run always reports the log as it stands.

About this challenge

This problem covers ranking customers by what they have spent, reporting how many orders each placed and what they average, and pinning a ranking so the pinned board keeps saying what it said when it was taken.

Module 7 · Coming soon

Async Fundamentals

Learn how an application stays responsive while it waits: awaiting work instead of blocking on it, starting several calls at once so they overlap rather than queue, passing the caller's cancellation through so giving up actually stops the work, and letting one failing source cost its own result rather than the whole answer.

4

Non-Blocking Report Endpoint

easyNo attempts yet

Parallel Price Fetch

easyNo attempts yet

Cancelable Long Export

easyNo attempts yet

Aggregated Dashboard Loader

easyNo attempts yet
Module 8 · Coming soon

Advanced Dependency Injection

Learn how a container is taught to build things it cannot construct on its own: registering a service through a factory delegate that decides at resolve time, telling several implementations of one interface apart by key, registering an open generic once so every closed type resolves from it, and keeping the lifetime each consumer gets correct.

4

Factory-Based Registration

mediumNo attempts yet

Keyed Payment Providers

mediumNo attempts yet

Open Generic Repository Registration

mediumNo attempts yet

Pluggable Export Engine

mediumNo attempts yet
Module 9 · Coming soon

Options and Feature Management

Learn how an application reads its settings: binding a configuration section to a typed class, giving each tenant its own named set so one never overwrites another, reading values afresh per request so a change is honoured by the very next one, keeping a long lived reader in step as settings change, and refusing to start when a setting is wrong.

4

Reloadable Feature Settings

medium1 / 1 solved

Named Tenant Options

mediumNo attempts yet

Options Change Notifications

mediumNo attempts yet

Feature Flag Service

mediumNo attempts yet
Module 10 · Coming soon

Middleware, Filters and Error Handling

Learn how a request is shaped before and after it reaches your code: validating input in a filter attached to the endpoint rather than inside the handler, turning any unhandled failure into one consistent error body, limiting how often a caller may ask, and ordering those stages so each sees what it is meant to see.

4

Endpoint Validation Filter

mediumNo attempts yet

Global Exception Handler

mediumNo attempts yet

Api Rate Limiter

mediumNo attempts yet

Hardened Public API Pipeline

mediumNo attempts yet
Module 11 · Coming soon

EF Core Fundamentals

Learn how to make the database do the work: loading related rows in one command instead of many, projecting to just the columns a page shows, filtering, sorting and paging in SQL rather than in memory, and reading without tracking when nothing is going to be saved.

3

Library Loans Query

mediumNo attempts yet

Read-Only Reporting Queries

mediumNo attempts yet

Paged Product Listing

mediumNo attempts yet
Module 12 · Coming soon

Authentication and Authorization

Learn how an API decides who a caller is and what they may reach: validating a bearer token against the issuer, audience, signature and expiry it is configured with, gating routes with a named policy rather than a check inside the handler, and writing a custom requirement that judges a caller from their own claims

4

Jwt Protected Endpoints

mediumNo attempts yet

Policy-Gated Admin Area

mediumNo attempts yet

Minimum Tenure Requirement

mediumNo attempts yet

Multi-Tier Access API

medium1 / 1 solved

About this path

This path covers the building blocks of a .NET 10 web app: dependency injection, configuration, minimal APIs and routing, model binding and validation, middleware, and LINQ. You should be able to read and write basic C# before you start. No earlier ASP.NET Core experience is needed. The LINQ module uses real reporting tasks, such as grouping sales and finding top customers.

Frequently asked questions

4

What will I practice in this path?

6 modules: Dependency Injection, Configuration and Options, Minimal APIs and Routing, Model Binding and Validation, Middleware and LINQ and Collections. More modules are on the way.

How many challenges are there, and how hard are they?

24 challenges, all easy.

What does this path run on?

Challenges run on .NET 10.

Do I need to install anything?

No. Every challenge runs in a browser-based IDE with everything already set up, and your code is graded automatically against a test suite.

We use cookies that are necessary to run Staffcoder, and optional analytics cookies to see which pages get used. Analytics stays off unless you accept. Read our Cookie Policy.