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

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

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

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
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

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

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

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

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

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

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

Goldbach Partition

Write an even number as the sum of two primes, using the smallest possible first prime.

You'll learn Primality testingSearching from the smallest candidate
CS1Dynamic-programmingHigh schoolIntermediateLoopsNumber-theoryNumbersPrimesmath
No solutions yet
Medium

Lexicographic Permutation

Find the k-th arrangement of some distinct characters in dictionary order.

You'll learn Factorial number systemCombinatorics
Competitive-programmingIntermediateNumber-theoryProject Euler styleRecursionmath
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

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

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

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

Champernowne Digits

Find digits at given positions of the string 123456789101112... made by writing out the counting numbers.

You'll learn Digit countingBlock skipping
Competitive-programmingIntermediateNumber-theoryProject Euler stylemath
No solutions yet