Practice & Learn

🧩 Code Challenges Hub

Test your skills with hands-on coding challenges. Choose a topic and start practicing!

28
Total
11
Topics
8
Beginner
20
Advanced

Showing 28 challenge(s)

Intermediate #5
Create a Class

Create a simple 'Person' class with a 'Name' property and an 'Introduce()' method.

ClassesAndOOP Start
Intermediate #14
Create an Object

Create an object of the Person class, set the Name to 'John', and call the Introduce() method.

ClassesAndOOP Start
Intermediate #15
Add a Constructor

Add a constructor to the Person class that takes a name parameter and sets the Name property.

ClassesAndOOP Start
Beginner #11
Read User Input

Write a program that asks the user for their name and greets them.

ConsoleApp Start
Beginner #16
Simple Calculator

Write a program that asks for two numbers and prints their sum.

ConsoleApp Start
Intermediate #17
Guessing Game

Write a program that generates a random number and asks the user to guess it.

ConsoleApp Start
Beginner #1
Hello World

Write a program that prints 'Hello, C# Mastery Hub!' to the console.

CSharpFundamentals Start
Beginner #2
Add Two Numbers

Write a program that adds two numbers (5 and 3) and prints the result.

CSharpFundamentals Start
Beginner #3
Check Even or Odd

Write a program that checks if a number (e.g., 7) is even or odd.

CSharpFundamentals Start
Intermediate #4
Fix the Bug

The code below has a bug. Find and fix it so it prints 'Hello World!'

CSharpFundamentals Start
Beginner #12
Calculate Average

Write a program that calculates the average of three numbers: 10, 20, and 30.

CSharpFundamentals Start
Intermediate #13
Find the Largest Number

Write a program that finds the largest of three numbers: 15, 8, and 22.

CSharpFundamentals Start
Advanced #29
Create a GitHub Workflow

Create a GitHub Actions workflow that builds a .NET project.

Deployment Start
Advanced #30
Deploy to Azure

Write the steps to deploy an ASP.NET Core app to Azure App Service.

Deployment Start
Intermediate #25
Create a MAUI Page

Create a simple ContentPage with a Label in XAML.

DotNetMaui Start
Intermediate #26
Add a Button

Add a Button to your MAUI page that displays a message when clicked.

DotNetMaui Start
Intermediate #19
Create a Razor Page

Create a Razor Page that displays a welcome message.

RazorPages Start
Intermediate #20
Pass Data to View

Pass a message from the PageModel to the view using ViewData.

RazorPages Start
Intermediate #27
Create a Dataset

Create a DataTable with columns: ProductId, Name, Price.

RdlcReports Start
Intermediate #28
Add Data to Dataset

Add rows to the Products DataTable with sample data.

RdlcReports Start
Advanced #31
Use Parameterized Query

Write a SQL query that uses parameters to prevent SQL injection.

Security Start
Advanced #32
Add Security Headers

Add X-Content-Type-Options and X-Frame-Options headers to an ASP.NET Core app.

Security Start
Beginner #21
Write a SELECT Query

Write a SQL query that selects all columns from a 'Students' table.

SqlServer Start
Beginner #22
Filter with WHERE

Write a SQL query that selects students with age greater than 18.

SqlServer Start
Intermediate #23
Create a Connection

Write C# code that creates a connection to SQL Server using a connection string.

VsSqlConnection Start
Advanced #24
Execute a Query

Write C# code that executes a SELECT query and reads the results using SqlDataReader.

VsSqlConnection Start
Intermediate #10
Create a Simple Form

Create a Windows Forms app with a button that shows a message box when clicked.

WindowsForms Start
Intermediate #18
Add a Label

Add a Label control to your form and update its text when a button is clicked.

WindowsForms Start