Bit Manipulation
Work directly with the binary digits of numbers, using AND, OR, XOR and shifts. The tell is a space limit, a pair-cancelling property or powers of two, as in Single Number. It often gives constant space and very little code.
15 problems · 8 with a video · 3 to practice in an AI round
| # | Problem | Difficulty | Video | AI round |
|---|---|---|---|---|
| 1 | Single Number | Very easy | AI round | |
| 2 | Add Binary | Easy | — | AI round |
| 3 | Single Number II | Medium | AI round | |
| 4 | Power of Two | Easy | ||
| 5 | Number of 1 Bits | Easy | ||
| 6 | Single Number III | Medium | ||
| 7 | Divide Two Integers | Medium | ||
| 8 | Reverse Bits | Easy | — | |
| 9 | Set Mismatch | Easy | — | |
| 10 | Find the Difference | Easy | — | |
| 11 | Number of Steps to Reduce a Number to Zero | Very easy | — | |
| 12 | K-th Symbol in Grammar | Medium | — | |
| 13 | Minimum Bit Flips to Convert Number | Very easy | ||
| 14 | XOR Operation in an Array | Very easy | ||
| 15 | Palindrome Permutation | Easy | — |
Sort by what interviews ask
Sign in to see how many companies ask each problem, sort all 500 by it or by likes, and tick off what you solve.
Practice in an AI round
Three of these are AI rounds: 30 minutes, an AI agent beside your code, then a scored report.
Practice Single Number in an AI roundYour first AI round is free.