C++ coding challenges

226 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 · 134 Medium · 68 Hard · 24

Skills you'll practise: CountingDigit extractionString splitting2D listsArithmeticFormulasListsLoopsConditionsDivisibilityFloating pointGradient descent
  • Python · C++ · C#
  • Automated tests
  • AI code review
  • Community solutions
226
Challenges
2
Solutions shared
3
Languages

All challenges

Search by topic, language, or difficulty.

226 challenges
Easy

Sum the Valid Numbers

Add up the entries that are whole numbers and skip everything else, the way try/except handles bad input.

You'll learn Try/exceptInput validation
BeginnerParsingStrings
No solutions yet
Easy

Bank Account Rules

Protect an account's balance behind deposit and withdraw rules, rejecting invalid operations.

You'll learn EncapsulationBusiness rules
BeginnerSimulation
No solutions yet
Easy

Linked List Operations

Simulate a linked list: add at either end, remove from the front or by value, and reverse it.

You'll learn Linked listsSimulation
Data-structuresSimulation
No solutions yet
Easy

WhenAll Total Time

Find how long a program takes when each group of tasks runs together with Task.WhenAll and groups run one after another.

You'll learn Async/awaitTask.WhenAll
ArraysBeginner
No solutions yet
Easy

Growing a Dynamic Array

Simulate how a dynamic array doubles its capacity and count the reallocations and copied elements.

You'll learn Dynamic arraysAmortised cost
ArraysSimulationmath
No solutions yet
Easy

Unique Records

Remove duplicate records that are equal by value, keeping the first of each in order.

You'll learn RecordsValue equality
BeginnerStrings
No solutions yet
Easy

To-Do List

Keep a list of tasks: add them, mark them done, remove them and report what is still pending.

You'll learn Typed collectionsRecords
BeginnerSimulationStrings
No solutions yet
Easy

Split a List Into Chunks

Cut a list into consecutive groups of a fixed size, with a shorter last group if needed.

You'll learn SlicingBatching
ArraysBeginner
No solutions yet
Easy

Sort by a Chosen Key

Sort people by name or by age with a comparer chosen at run time, breaking ties consistently.

You'll learn ComparersSorting
ArraysSorting
No solutions yet
Easy

Format an Invoice

Print invoice lines and a total with amounts stored in cents, formatted as dollars and cents.

You'll learn Money in centsString formatting
BeginnerStrings
No solutions yet