Classes coding challenges

Practise classes with 8 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.

Easy · 1 Medium · 7

Skills you'll practise: 2D boolean gridsArray scanningCharacter scanningCommand processingLetter countingMap keysMaps of listsNeighbor offsetsObject stateQueuesRunning statisticsSimulation
  • 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.

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

Word Scramble

Scramble words by swapping each vowel with the consonant right after it, scanning left to right.

You'll learn Character scanningSwapping
AP Computer ScienceBeginnerCS1ClassesGamesHomeworkIntro programmingOOPStudent-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
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
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

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

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
Medium

Longest Run of Rolls

Find where the longest run of equal consecutive dice rolls starts and how long it is.

You'll learn Array scanningTracking the best result
AP Computer ScienceCS1ClassesDiceHomeworkIntermediateIntro programmingOOPProbabilityStudent-beginner
No solutions yet