Programming Challenges

Strengthen your problem-solving skills with language-neutral challenges you can solve in Python, C++, C#, Java, JavaScript, Go, Rust, Kotlin or Swift. Every submission is checked by automated tests and reviewed by AI.

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

Light Board

Simulate a board of lights where pressing one flips it and its neighbors, and answer count queries.

You'll learn 2D boolean gridsNeighbor offsets
AP Computer ScienceCS1ClassesGridsHomeworkIntermediateIntro programmingMatricesOOPStudent-beginner
No solutions yet
Hard

Edge Detection (Sobel Filter)

Run the Sobel filter over a grayscale pixel grid and return the edge strength of every pixel.

You'll learn 2D grid traversalConvolution kernels
AdvancedCS1CS50 styleGridsHomeworkImage processingIntro programmingMatricesStudent-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

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

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

Base Converter

Convert a number written in one base (2 to 36) to another base.

You'll learn Positional notationRepeated division
BeginnerCS1High schoolLoopsNumbersmath
No solutions yet
Easy

Count Primes in a Range

Count how many prime numbers lie between two bounds, both included.

You'll learn Sieve of EratosthenesRange counting
BeginnerCS1High schoolLoopsNumber-theoryNumbersPrimesmath
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
Easy

Payroll With Overtime

Compute each employee's weekly pay in cents with time and a half after 40 hours and double time after 50.

You'll learn Piecewise rulesInteger rounding
BeginnerCS1ConditionsFinanceFunctionsHomeworkIntro programmingStudent-beginner
No solutions yet
Medium

Hidden Word Clue

Build the clue for a word guessing game: exact letters, letters in the wrong spot, and misses.

You'll learn String buildingLetter counting
AP Computer ScienceCS1ClassesGamesHomeworkIntermediateIntro programmingOOPStudent-beginner
No solutions yet
Easy

First Fibonacci With N Digits

Find the position of the first Fibonacci number that has n digits.

You'll learn Big number arithmeticSequences
BeginnerBig integersCompetitive-programmingNumber-theoryProject Euler stylemath
No solutions yet
Easy

Smallest Multiple

Find the smallest positive number that every integer in a range divides evenly.

You'll learn Greatest common divisorLeast common multiple
BeginnerCompetitive-programmingConditionsFinanceFunctionsNumber-theoryProject Euler stylemath
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

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