Bit manipulation coding challenges

Practise bit manipulation with 5 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 · 2 Medium · 3

Skills you'll practise: Bit shiftsBit masksBit shiftingInput validationInteger roundingMinimum of valuesNested loopsParityXOR
  • 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.

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

Remove Gray From RGB

Remove the gray part of an RGB color by subtracting the smallest channel from all three.

You'll learn Minimum of valuesInput validation
BeginnerBit manipulationCS1ConditionsFunctionsHomeworkIntro programmingStudent-beginner
No solutions yet
Easy

Binary Triangle

Print a right triangle of alternating 1s and 0s where each row starts with the opposite digit of the row above.

You'll learn Nested loopsParity
BeginnerBit manipulationCS1High schoolLoopsNested-loopsPatterns
No solutions yet
Medium

Gray Code

List the n-bit reflected binary Gray code, where neighbors differ in exactly one bit.

You'll learn XORBit shifts
Bit manipulationCS1High schoolIntermediateLoopsNumbersmath
No solutions yet