Pattern · Bit Manipulation

Bit Manipulation interview questions

132 bit manipulation problems tagged across recent interview reports. Drilled most heavily by google, amazon, and bloomberg.

Founder's read

Bit Manipulation covers 132 problems across interviews at Google, Amazon, Bloomberg, and IBM. The pattern involves operations on individual bits: AND, OR, XOR, shifts, and toggles. Most candidates underestimate it. A single bit insight, recognizing when a problem reduces to a bitmask, a parity check, or a power-of-two test, unlocks problems that look impossible at first read. If a hard Bit Manipulation problem lands in your live OA, StealthCoder solves it in seconds, invisible to the proctor.

Most-asked bit manipulation problems

#ProblemDiff# Companies
01Divide Two IntegersMEDIUM12
02Find the Duplicate NumberMEDIUM12
03Add BinaryEASY11
04Beautiful ArrangementMEDIUM6
05Gray CodeMEDIUM4
06Cinema Seat AllocationMEDIUM3
07Find Minimum Time to Finish All JobsHARD3
08Find The Original Array of Prefix XorMEDIUM3
09Binary GapEASY2
10Closest Subsequence SumHARD2
11Complement of Base 10 IntegerEASY2
12Find the Maximum Sum of Node ValuesHARD2
13IP to CIDRMEDIUM2
14Apply Bitwise Operations to Make Strings EqualMEDIUM1
15Apply Operations on Array to Maximize Sum of SquaresHARD1
16Bitwise AND of Numbers RangeMEDIUM1
17Bitwise OR of All Subsequence SumsMEDIUM1
18Bitwise ORs of SubarraysMEDIUM1
19Bitwise XOR of All PairingsMEDIUM1
20Can I WinMEDIUM1
21Can Make Palindrome from SubstringMEDIUM1
22Chalkboard XOR GameHARD1
23Construct the Minimum Bitwise Array IEASY1
24Construct the Minimum Bitwise Array IIMEDIUM1
25Convert a Number to HexadecimalEASY1
26Count Complete Tree NodesEASY1
27Count Number of Maximum Bitwise-OR SubsetsMEDIUM1
28Count Pairs Of Similar StringsEASY1
29Count Pairs With XOR in a RangeHARD1
30Count Paths That Can Form a Palindrome in a TreeHARD1
31Count the Number of Consistent StringsEASY1
32Count the Number of Square-Free SubsetsMEDIUM1
33Counting BitsEASY1
34Encode NumberMEDIUM1
35Fair Distribution of CookiesMEDIUM1
36Find a Value of a Mysterious Function Closest to TargetHARD1
37Find if Array Can Be SortedMEDIUM1
38Find Longest Awesome SubstringHARD1
39Find Products of Elements of Big ArrayHARD1
40Find Subarray With Bitwise OR Closest to KHARD1
41Find the DifferenceEASY1
42Find the Prefix Common Array of Two ArraysMEDIUM1
43Find the Shortest SuperstringHARD1
44Flipping an ImageEASY1
45Frequencies of Shortest SupersequencesHARD1
46Groups of StringsHARD1
47Integer ReplacementMEDIUM1
48K-th Symbol in GrammarMEDIUM1
49Largest Combination With Bitwise AND Greater Than ZeroMEDIUM1
50Letter Case PermutationMEDIUM1

Showing top 50 of 132 bit manipulation problems by # companies asking.

The hedge for the live OA

You can't drill every bit manipulation variant before the assessment. StealthCoder runs invisibly during screen share and solves whichever variant they throw at you. No browser extension. No detection signature. Built by an Amazon engineer who realized the OA tests how well you memorized 200 problems, not how well you code.

Get StealthCoder
What this means

Bit Manipulation problems fall into a few recognizable shapes: single-bit checks (is this a power of two?), range queries (bitwise AND of a range), XOR properties (self-canceling, identity), and state compression (representing sets as integers). The pattern often hides inside dynamic programming or greedy problems where the state or the operation is bitwise. Start with binary-gap and add-binary to anchor the basics, then move to bitwise-and-of-numbers-range and bitwise-xor-of-all-pairings for range logic. Interview difficulty jumps at can-i-win and bitwise-ors-of-subarrays because they demand both bit insight and search strategy. Google and Amazon ask 27 and 19 of these problems respectively, so drilling subtypes matters. StealthCoder is the hedge for the variant you didn't drill, when the live problem asks for a bitmask trick you haven't practiced yet.

Companies that hire most on bit manipulation

The honest play

132 bit manipulation problems. You won't drill them all. Pass anyway.

Bit Manipulation is one of the patterns interviews actually filter on. Memorizing every variant in a week is a fantasy. StealthCoder is the hedge: an AI overlay invisible during screen share. It reads the problem and surfaces a working solution in under 2 seconds, no matter which bit manipulation flavor lands in your live OA. Built by an Amazon engineer who realized the OA tests how well you memorized 200 problems, not how well you code. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Bit Manipulation interview FAQ

How many Bit Manipulation problems should I drill before an interview?+

With 132 total problems in this pattern, focus on 20-30 core drills. Cover binary basics, range AND queries, XOR properties, and at least one bitmask DP problem. Google and Amazon ask heavily on this, prioritize companies on your target list.

Is Bit Manipulation essential or just a 'nice to have'?+

It's essential at Google (27 problems), Amazon (19), and Bloomberg (18). It often appears not as a pure bit problem but hiding inside a DP, greedy, or array problem. Missing the bitwise insight leaves you stuck.

How do I recognize a Bit Manipulation problem in a live interview?+

Watch for keywords: power of two, single bit set, XOR, AND, OR, bitmask, parity, toggle. If the problem mentions constraints like powers or duplicate handling, try XOR first. If it's a range query, think bitwise AND or OR.

Which company drills Bit Manipulation the hardest?+

Google leads with 27 problems, followed by Amazon (19), Bloomberg (18), and IBM (18). If you're interviewing there, dedicate extra time to range operations and XOR subtypes.

What's the fastest way to learn Bit Manipulation if I'm weak on it?+

Start with add-binary and binary-gap to build confidence with shifts and bit checks. Then jump to bitwise-and-of-numbers-range to see range logic. One insight per drill. Don't cram all 132 problems, prioritize breadth of patterns over volume.

Problem and frequency data sourced from public community-maintained interview-report repos. Problems and trademarks © LeetCode.