C# coding challenges

341 challenges you can solve in C#, from first loops to graphs, dynamic programming and machine learning. Write your code in the browser, run the tests instantly and get an AI review.

Easy · 193 Medium · 119 Hard · 29

Skills you'll practise: Nested loopsDigit extractionCountingLoopsString splittingConditionsSieve of Eratosthenes2D listsArithmeticBig number arithmeticCycle detectionDivisibility
  • Python · C++ · C#
  • Automated tests
  • AI code review
  • Community solutions
341
Challenges
245
Solutions shared
9
Languages

All challenges

Search by name or topic, or filter by difficulty.

341 challenges
Medium

Diamond Pattern

Print a solid diamond of stars made of a pyramid and its mirror image.

You'll learn Nested loopsSymmetry
CS1High schoolIntermediateLoopsNested-loopsPatterns
No solutions yet
Easy

Binomial Coefficient

Count the ways to choose k items out of n (n choose k).

You'll learn Pascal's triangleOverflow-safe arithmetic
BeginnerCS1High schoolLoopsNumbersmath
No solutions yet
Easy

Perfect Square Check

Decide whether an integer is the square of a whole number.

You'll learn Integer square rootEdge cases
BeginnerCS1High schoolLoopsNumbersmath
No solutions yet
Medium

Prime Factorization

Break a number into its prime factors, listed from smallest to largest with repetition.

You'll learn Trial divisionSquare root bound
CS1High schoolIntermediateLoopsNumber-theoryNumbersPrimesmath
No solutions yet
Medium

Box Blur

Blur a grayscale image by replacing each pixel with the rounded average of its 3 by 3 neighborhood.

You'll learn Neighborhood loopsBounds checking
CS1CS50 styleGridsHomeworkImage processingIntermediateIntro programmingMatricesStudent-beginner
No solutions yet
Easy

Checkerboard Pattern

Draw a checkerboard of # and . cells with the given number of rows and columns.

You'll learn Nested loopsParity
BeginnerCS1GridsHigh schoolLoopsMatricesNested-loopsPatterns
No solutions yet
Medium

Bank Queue Simulation

Simulate customers waiting in one line for several bank tellers and report the waiting times.

You'll learn SimulationQueues
AP Computer ScienceCS1ClassesHomeworkIntermediateIntro programmingOOPQueuesStudent-beginner
No solutions yet
Medium

Number to Words

Spell a whole number in English words, such as "one hundred twenty-three".

You'll learn Lookup tablesDecomposing numbers
CS1High schoolIntermediateLoopsNumbersmath
No solutions yet
Medium

Maximum Path Sum in a Triangle

Find the largest sum on a path from the top of a number triangle to its bottom row.

You'll learn Dynamic programmingBottom-up computation
Competitive-programmingDynamic-programmingIntermediateNumber-theoryProject Euler styleTreesmath
No solutions yet
Medium

Runoff Election

Run an instant runoff election on ranked ballots, eliminating the weakest candidates round by round.

You'll learn Simulation in rounds2D arrays
CS1CS50 styleHomeworkIntermediateIntro programmingSortingStudent-beginnerVoting
No solutions yet
Medium

Largest Product in a Grid

Find the largest product of k numbers in a straight line in a grid.

You'll learn 2D grid traversalDirection vectors
Competitive-programmingDynamic-programmingGridsIntermediateMatricesNumber-theoryProject Euler stylemath
No solutions yet
Easy

Inverted Pyramid

Print a centered pyramid of stars upside down, with the widest row on top.

You'll learn Nested loopsPadding
BeginnerCS1High schoolLoopsNested-loopsPatterns
No solutions yet
Medium

Library Checkout System

Run a small library system: add copies, check books out with a three book limit, return them and answer queries.

You'll learn Maps of listsCommand processing
AP Computer ScienceCS1ClassesHomeworkIntermediateIntro programmingOOPStudent-beginner
No solutions yet
Medium

Plurality Election

Count one vote per voter and return every candidate with the most votes.

You'll learn Counting with mapsFinding all maxima
CS1CS50 styleHomeworkIntermediateIntro programmingSortingStudent-beginnerVoting
No solutions yet
Easy

Mirror an Image

Flip a pixel grid left to right, like the mirror button in a photo app.

You'll learn 2D arraysReversing a list
BeginnerCS1CS50 styleGridsHomeworkImage processingIntro programmingMatricesStudent-beginner
No solutions yet
Medium

Sparse Grid

Keep a mostly empty grid as a list of its non-zero cells and answer get, count, row sum and column removal operations.

You'll learn Sparse storageMap keys
AP Computer ScienceCS1ClassesGridsHomeworkIntermediateIntro programmingMatricesOOPStudent-beginner
No solutions yet
Easy

Temperature Table

Build a Fahrenheit to Celsius conversion table with one decimal place.

You'll learn Loops with a stepNumber formatting
BeginnerCS1ConditionsFunctionsHomeworkIntro programmingStudent-beginner
No solutions yet
Medium

DNA Short Tandem Repeats

For each short tandem repeat, find the longest run of back-to-back copies in a DNA sequence.

You'll learn Substring matchingLongest run counting
CS1CS50 styleHomeworkIntermediateIntro programmingStudent-beginner
No solutions yet