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

Double Staircase

Print two staircases of # blocks that face each other across a two-space gap.

You'll learn Nested loopsPadding
CS1CS50 styleHigh schoolIntermediateLoopsNested-loopsPatterns
No solutions yet
Easy

Output Range With Increment

List the numbers from a start value toward an end value, moving by a fixed step.

You'll learn Loop conditionsEdge cases
BeginnerCS1ConditionsFunctionsHomeworkIntro programmingStudent-beginner
No solutions yet
Medium

Counting Sundays

Count the months in a range of years that begin on a Sunday.

You'll learn Date arithmeticModular arithmetic
Competitive-programmingDates and timesIntermediateNumber-theoryProject Euler stylemath
No solutions yet
Hard

Ranked Pairs Winner

Find the ranked pairs winner of an election by locking head-to-head victories that do not make a cycle.

You'll learn Graph cycle detectionCustom sorting
AdvancedCS1CS50 styleHomeworkIntro programmingSortingStudent-beginnerVoting
No solutions yet
Medium

Integer to Roman

Write a whole number from 1 to 3999 as a Roman numeral.

You'll learn Greedy algorithmsLookup tables
CS1High schoolIntermediateLoopsNumbersmath
No solutions yet
Easy

Season From Month and Day

Given a month name and a day, return the season of the year in the Northern Hemisphere.

You'll learn Chained conditionsInput validation
BeginnerCS1ConditionsDates and timesFunctionsHomeworkIntro programmingStudent-beginner
No solutions yet
Hard

Non-Abundant Sums

Add up the numbers up to a limit that cannot be written as the sum of two abundant numbers.

You'll learn Divisor sievePair enumeration
AdvancedCompetitive-programmingNumber-theoryPrimesProject Euler stylemath
No solutions yet
Easy

Hollow Pyramid

Print the outline of a centered pyramid: its two slanted sides and a solid base.

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

Pentagonal Pair

Count pairs of pentagonal numbers whose sum is pentagonal too.

You'll learn Integer square rootsPair enumeration
Competitive-programmingIntermediateNumber-theoryProject Euler stylemath
No solutions yet
Medium

Number Diamond

Print a diamond whose rows count up from 1 to a peak and back down.

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

Number Letter Counts

Count the letters needed to write every number from 1 to n in English words.

You'll learn String buildingBreaking numbers into parts
Competitive-programmingIntermediateNumber-theoryProject Euler stylemath
No solutions yet
Easy

Hollow Right Triangle

Print only the outline of a right triangle of stars.

You'll learn Nested loopsConditions
BeginnerCS1High schoolLoopsNested-loopsPatterns
No solutions yet
Easy

Interstate Highway Numbers

Classify an interstate highway number as a primary or auxiliary route and give its direction.

You'll learn Remainder arithmeticBranching
BeginnerCS1ConditionsFunctionsHomeworkIntro programmingStudent-beginner
No solutions yet
Easy

Mad Lib Builder

Fill the bracketed blanks of a story template with words, in order.

You'll learn String scanningCounters
BeginnerCS1ConditionsFunctionsHomeworkIntro programmingStudent-beginner
No solutions yet
Easy

Sum of Proper Divisors

Add up every divisor of n that is smaller than n.

You'll learn Divisor pairsSquare root bound
BeginnerCS1High schoolLoopsNumber-theoryNumbersPrimesmath
No solutions yet
Easy

Countdown Until Matching Digits

Count down from a two-digit number until both digits are the same.

You'll learn While loopsDigit extraction
BeginnerCS1ConditionsFunctionsHomeworkIntro programmingStudent-beginner
No solutions yet
Medium

Euler's Totient

Count the integers from 1 to n that share no common factor with n.

You'll learn Prime factorizationProduct formula
CS1High schoolIntermediateLoopsNumber-theoryNumbersPrimesmath
No solutions yet
Easy

Floyd's Triangle

Build Floyd's triangle: the counting numbers written in rows of length 1, 2, 3 and so on.

You'll learn Nested loopsRunning counters
BeginnerCS1High schoolLoopsNested-loopsPatternsShortest-path
No solutions yet