Intermediate coding challenges

Practise intermediate with 51 coding challenges, from easy to hard. Every challenge runs in your browser with instant tests, an AI review of your code and community solutions to compare.

Medium · 51

Skills you'll practise: Nested loopsPrimality testingSymmetryModular arithmeticBit shiftsCombinatoricsDynamic programmingLookup tablesPrime factorizationRecurrencesSimulationString building
  • Python · C++ · C#
  • Automated tests
  • AI code review
  • Community solutions
341
Challenges
241
Solutions shared
9
Languages

All challenges

Search by name or topic, or filter by difficulty.

51 challenges
Medium

Step Tracker Class

Simulate a step tracker object: record daily steps and answer total, active day, average and best day queries.

You'll learn Object stateRunning statistics
AP Computer ScienceCS1ClassesHomeworkIntermediateIntro programmingOOPStudent-beginner
No solutions yet
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
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
Medium

Amicable Pair

List every amicable pair whose two numbers are both at most a limit.

You'll learn Divisor-sum sievePair checks
CS1High schoolIntermediateLoopsNumber-theoryNumbersPrimesmath
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
Medium

Longest Collatz Chain

Find the starting number up to a limit whose Collatz chain is longest.

You'll learn MemoizationSimulation
Competitive-programmingIntermediateNumber-theoryProject Euler stylemath
No solutions yet
Medium

Name Scores

Sort a list of names and add up each name's letter value times its position.

You'll learn Sorting stringsCharacter codes
Competitive-programmingIntermediateNumber-theoryProject Euler stylemath
No solutions yet
Medium

Palindromic Number Pyramid

Print a centered pyramid where each row counts up to its row number and back down.

You'll learn Nested loopsPalindromes
CS1High schoolIntermediateLoopsNested-loopsPalindromesPatterns
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

Sum of Big Numbers

Add up a list of numbers too long for any built-in integer type.

You'll learn Big number arithmeticString processing
Big integersCompetitive-programmingIntermediateNumber-theoryProject Euler stylemath
No solutions yet
Medium

Hollow Diamond

Print the outline of a diamond: only the first and last star of each row.

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

Butterfly Pattern

Print a butterfly: two star triangles facing each other that grow until they touch, then shrink again.

You'll learn Nested loopsSymmetry
CS1High schoolIntermediateLoopsNested-loopsPatterns
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
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

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
Medium

Grayscale Filter

Turn a grid of packed RGB pixels into grayscale using weighted channel brightness.

You'll learn Bit shiftingInteger rounding
Bit manipulationCS1CS50 styleGridsHomeworkImage processingIntermediateIntro programmingMatricesStudent-beginner
No solutions yet
Medium

Reverse the Bits

Reverse the order of the lowest width bits of a number.

You'll learn Bit shiftsBit masks
Bit manipulationCS1High schoolIntermediateLoopsNumbersmath
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