# Bit Manipulation DSA Problems

> 238 Bit Manipulation coding problems for placements and interviews, sorted easiest first, with hints and company tags. Free practice on InternHack.

Canonical: https://www.internhack.in/learn/dsa/bit-manipulation
Last updated: 2026-11-28

238 bit manipulation problems for coding interviews and campus placements, with hints and company tags. Below are the first 100 of 238: 49 easy, 0 medium and 51 hard. Practise them free on InternHack and track what you have solved.

## Bit Manipulation problems, easiest first

1. [Add Binary](https://www.internhack.in/learn/dsa/problem/add-binary) (Easy)
2. [Binary Gap](https://www.internhack.in/learn/dsa/problem/binary-gap) (Easy)
3. [Binary Number with Alternating Bits](https://www.internhack.in/learn/dsa/problem/binary-number-with-alternating-bits) (Easy)
4. [Binary Prefix Divisible By 5](https://www.internhack.in/learn/dsa/problem/binary-prefix-divisible-by-5) (Easy)
5. [Binary Watch](https://www.internhack.in/learn/dsa/problem/binary-watch) (Easy)
6. [Bitwise OR of Adjacent Elements](https://www.internhack.in/learn/dsa/problem/bitwise-or-of-adjacent-elements) (Easy)
7. [Bitwise OR of Even Numbers in an Array](https://www.internhack.in/learn/dsa/problem/bitwise-or-of-even-numbers-in-an-array) (Easy)
8. [Check if Bitwise OR Has Trailing Zeros](https://www.internhack.in/learn/dsa/problem/check-if-bitwise-or-has-trailing-zeros) (Easy)
9. [Complement of Base 10 Integer](https://www.internhack.in/learn/dsa/problem/complement-of-base-10-integer) (Easy)
10. [Construct the Minimum Bitwise Array I](https://www.internhack.in/learn/dsa/problem/construct-the-minimum-bitwise-array-i) (Easy)
11. [Convert a Number to Hexadecimal](https://www.internhack.in/learn/dsa/problem/convert-a-number-to-hexadecimal) (Easy)
12. [Count Complete Tree Nodes](https://www.internhack.in/learn/dsa/problem/count-complete-tree-nodes) (Easy)
13. [Count Monobit Integers](https://www.internhack.in/learn/dsa/problem/count-monobit-integers) (Easy)
14. [Count Pairs Of Similar Strings](https://www.internhack.in/learn/dsa/problem/count-pairs-of-similar-strings) (Easy)
15. [Count the Number of Consistent Strings](https://www.internhack.in/learn/dsa/problem/count-the-number-of-consistent-strings) (Easy)
16. [Count Triplets with Even XOR Set Bits I](https://www.internhack.in/learn/dsa/problem/count-triplets-with-even-xor-set-bits-i) (Easy)
17. [Counting Bits](https://www.internhack.in/learn/dsa/problem/counting-bits) (Easy)
18. [Divide Array Into Equal Pairs](https://www.internhack.in/learn/dsa/problem/divide-array-into-equal-pairs) (Easy)
19. [Find the Difference](https://www.internhack.in/learn/dsa/problem/find-the-difference) (Easy)
20. [Find the K-or of an Array](https://www.internhack.in/learn/dsa/problem/find-the-k-or-of-an-array) (Easy)
21. [Find the K-th Character in String Game I](https://www.internhack.in/learn/dsa/problem/find-the-k-th-character-in-string-game-i) (Easy)
22. [Find the XOR of Numbers Which Appear Twice](https://www.internhack.in/learn/dsa/problem/find-the-xor-of-numbers-which-appear-twice) (Easy)
23. [First Letter to Appear Twice](https://www.internhack.in/learn/dsa/problem/first-letter-to-appear-twice) (Easy)
24. [Flipping an Image](https://www.internhack.in/learn/dsa/problem/flipping-an-image) (Easy)
25. [Hamming Distance](https://www.internhack.in/learn/dsa/problem/hamming-distance) (Easy)
26. [Longest Nice Substring](https://www.internhack.in/learn/dsa/problem/longest-nice-substring) (Easy)
27. [Maximum Strong Pair XOR I](https://www.internhack.in/learn/dsa/problem/maximum-strong-pair-xor-i) (Easy)
28. [Minimum Bit Flips to Convert Number](https://www.internhack.in/learn/dsa/problem/minimum-bit-flips-to-convert-number) (Easy)
29. [Minimum Operations to Collect Elements](https://www.internhack.in/learn/dsa/problem/minimum-operations-to-collect-elements) (Easy)
30. [Missing Number](https://www.internhack.in/learn/dsa/problem/missing-number) (Easy)
31. [Number Complement](https://www.internhack.in/learn/dsa/problem/number-complement) (Easy)
32. [Number of 1 Bits](https://www.internhack.in/learn/dsa/problem/number-of-1-bits) (Easy)
33. [Number of Bit Changes to Make Two Integers Equal](https://www.internhack.in/learn/dsa/problem/number-of-bit-changes-to-make-two-integers-equal) (Easy)
34. [Number of Even and Odd Bits](https://www.internhack.in/learn/dsa/problem/number-of-even-and-odd-bits) (Easy)
35. [Number of Steps to Reduce a Number to Zero](https://www.internhack.in/learn/dsa/problem/number-of-steps-to-reduce-a-number-to-zero) (Easy)
36. [Palindrome Permutation](https://www.internhack.in/learn/dsa/problem/palindrome-permutation) (Easy)
37. [Power of Four](https://www.internhack.in/learn/dsa/problem/power-of-four) (Easy)
38. [Power of Two](https://www.internhack.in/learn/dsa/problem/power-of-two) (Easy)
39. [Prime Number of Set Bits in Binary Representation](https://www.internhack.in/learn/dsa/problem/prime-number-of-set-bits-in-binary-representation) (Easy)
40. [Reverse Bits](https://www.internhack.in/learn/dsa/problem/reverse-bits) (Easy)
41. [Set Mismatch](https://www.internhack.in/learn/dsa/problem/set-mismatch) (Easy)
42. [Shortest Subarray With OR at Least K I](https://www.internhack.in/learn/dsa/problem/shortest-subarray-with-or-at-least-k-i) (Easy)
43. [Single Number](https://www.internhack.in/learn/dsa/problem/single-number) (Easy)
44. [Smallest Number With All Set Bits](https://www.internhack.in/learn/dsa/problem/smallest-number-with-all-set-bits) (Easy)
45. [Sort Integers by The Number of 1 Bits](https://www.internhack.in/learn/dsa/problem/sort-integers-by-the-number-of-1-bits) (Easy)
46. [Sum of All Subset XOR Totals](https://www.internhack.in/learn/dsa/problem/sum-of-all-subset-xor-totals) (Easy)
47. [Sum of Values at Indices With K Set Bits](https://www.internhack.in/learn/dsa/problem/sum-of-values-at-indices-with-k-set-bits) (Easy)
48. [Two Out of Three](https://www.internhack.in/learn/dsa/problem/two-out-of-three) (Easy)
49. [XOR Operation in an Array](https://www.internhack.in/learn/dsa/problem/xor-operation-in-an-array) (Easy)
50. [Apply Operations on Array to Maximize Sum of Squares](https://www.internhack.in/learn/dsa/problem/apply-operations-on-array-to-maximize-sum-of-squares) (Hard)
51. [Chalkboard XOR Game](https://www.internhack.in/learn/dsa/problem/chalkboard-xor-game) (Hard)
52. [Closest Subsequence Sum](https://www.internhack.in/learn/dsa/problem/closest-subsequence-sum) (Hard)
53. [Concatenated Divisibility](https://www.internhack.in/learn/dsa/problem/concatenated-divisibility) (Hard)
54. [Count Pairs With XOR in a Range](https://www.internhack.in/learn/dsa/problem/count-pairs-with-xor-in-a-range) (Hard)
55. [Count Paths That Can Form a Palindrome in a Tree](https://www.internhack.in/learn/dsa/problem/count-paths-that-can-form-a-palindrome-in-a-tree) (Hard)
56. [Distribute Repeating Integers](https://www.internhack.in/learn/dsa/problem/distribute-repeating-integers) (Hard)
57. [Find a Value of a Mysterious Function Closest to Target](https://www.internhack.in/learn/dsa/problem/find-a-value-of-a-mysterious-function-closest-to-target) (Hard)
58. [Find Longest Awesome Substring](https://www.internhack.in/learn/dsa/problem/find-longest-awesome-substring) (Hard)
59. [Find Minimum Time to Finish All Jobs](https://www.internhack.in/learn/dsa/problem/find-minimum-time-to-finish-all-jobs) (Hard)
60. [Find Nth Smallest Integer With K One Bits](https://www.internhack.in/learn/dsa/problem/find-nth-smallest-integer-with-k-one-bits) (Hard)
61. [Find Number of Ways to Reach the K-th Stair](https://www.internhack.in/learn/dsa/problem/find-number-of-ways-to-reach-the-k-th-stair) (Hard)
62. [Find Products of Elements of Big Array](https://www.internhack.in/learn/dsa/problem/find-products-of-elements-of-big-array) (Hard)
63. [Find Subarray With Bitwise OR Closest to K](https://www.internhack.in/learn/dsa/problem/find-subarray-with-bitwise-or-closest-to-k) (Hard)
64. [Find Sum of Array Product of Magical Sequences](https://www.internhack.in/learn/dsa/problem/find-sum-of-array-product-of-magical-sequences) (Hard)
65. [Find the K-th Character in String Game II](https://www.internhack.in/learn/dsa/problem/find-the-k-th-character-in-string-game-ii) (Hard)
66. [Find the Maximum Sequence Value of Array](https://www.internhack.in/learn/dsa/problem/find-the-maximum-sequence-value-of-array) (Hard)
67. [Find the Maximum Sum of Node Values](https://www.internhack.in/learn/dsa/problem/find-the-maximum-sum-of-node-values) (Hard)
68. [Find the Minimum Cost Array Permutation](https://www.internhack.in/learn/dsa/problem/find-the-minimum-cost-array-permutation) (Hard)
69. [Find the Shortest Superstring](https://www.internhack.in/learn/dsa/problem/find-the-shortest-superstring) (Hard)
70. [Find Weighted Median Node in Tree](https://www.internhack.in/learn/dsa/problem/find-weighted-median-node-in-tree) (Hard)
71. [Find XOR Sum of All Pairs Bitwise AND](https://www.internhack.in/learn/dsa/problem/find-xor-sum-of-all-pairs-bitwise-and) (Hard)
72. [Frequencies of Shortest Supersequences](https://www.internhack.in/learn/dsa/problem/frequencies-of-shortest-supersequences) (Hard)
73. [Groups of Strings](https://www.internhack.in/learn/dsa/problem/groups-of-strings) (Hard)
74. [Kth Ancestor of a Tree Node](https://www.internhack.in/learn/dsa/problem/kth-ancestor-of-a-tree-node) (Hard)
75. [Make the XOR of All Segments Equal to Zero](https://www.internhack.in/learn/dsa/problem/make-the-xor-of-all-segments-equal-to-zero) (Hard)
76. [Maximize Grid Happiness](https://www.internhack.in/learn/dsa/problem/maximize-grid-happiness) (Hard)
77. [Maximize Score After N Operations](https://www.internhack.in/learn/dsa/problem/maximize-score-after-n-operations) (Hard)
78. [Maximize the Number of Partitions After Operations](https://www.internhack.in/learn/dsa/problem/maximize-the-number-of-partitions-after-operations) (Hard)
79. [Maximize Value of Function in a Ball Passing Game](https://www.internhack.in/learn/dsa/problem/maximize-value-of-function-in-a-ball-passing-game) (Hard)
80. [Maximum AND Sum of Array](https://www.internhack.in/learn/dsa/problem/maximum-and-sum-of-array) (Hard)
81. [Maximum Bitwise AND After Increment Operations](https://www.internhack.in/learn/dsa/problem/maximum-bitwise-and-after-increment-operations) (Hard)
82. [Maximum Genetic Difference Query](https://www.internhack.in/learn/dsa/problem/maximum-genetic-difference-query) (Hard)
83. [Maximum Good People Based on Statements](https://www.internhack.in/learn/dsa/problem/maximum-good-people-based-on-statements) (Hard)
84. [Maximum Good Subtree Score](https://www.internhack.in/learn/dsa/problem/maximum-good-subtree-score) (Hard)
85. [Maximum Number of Achievable Transfer Requests](https://www.internhack.in/learn/dsa/problem/maximum-number-of-achievable-transfer-requests) (Hard)
86. [Maximum Number of Groups Getting Fresh Donuts](https://www.internhack.in/learn/dsa/problem/maximum-number-of-groups-getting-fresh-donuts) (Hard)
87. [Maximum Number of Moves to Kill All Pawns](https://www.internhack.in/learn/dsa/problem/maximum-number-of-moves-to-kill-all-pawns) (Hard)
88. [Maximum Points After Collecting Coins From All Nodes](https://www.internhack.in/learn/dsa/problem/maximum-points-after-collecting-coins-from-all-nodes) (Hard)
89. [Maximum Score Words Formed by Letters](https://www.internhack.in/learn/dsa/problem/maximum-score-words-formed-by-letters) (Hard)
90. [Maximum Strong Pair XOR II](https://www.internhack.in/learn/dsa/problem/maximum-strong-pair-xor-ii) (Hard)
91. [Maximum Students Taking Exam](https://www.internhack.in/learn/dsa/problem/maximum-students-taking-exam) (Hard)
92. [Maximum Total Reward Using Operations II](https://www.internhack.in/learn/dsa/problem/maximum-total-reward-using-operations-ii) (Hard)
93. [Maximum XOR With an Element From Array](https://www.internhack.in/learn/dsa/problem/maximum-xor-with-an-element-from-array) (Hard)
94. [Minimize OR of Remaining Elements Using Operations](https://www.internhack.in/learn/dsa/problem/minimize-or-of-remaining-elements-using-operations) (Hard)
95. [Minimum Cost to Connect Two Groups of Points](https://www.internhack.in/learn/dsa/problem/minimum-cost-to-connect-two-groups-of-points) (Hard)
96. [Minimum Cost Walk in Weighted Graph](https://www.internhack.in/learn/dsa/problem/minimum-cost-walk-in-weighted-graph) (Hard)
97. [Minimum Incompatibility](https://www.internhack.in/learn/dsa/problem/minimum-incompatibility) (Hard)
98. [Minimum Number of Flips to Convert Binary Matrix to Zero Matrix](https://www.internhack.in/learn/dsa/problem/minimum-number-of-flips-to-convert-binary-matrix-to-zero-matrix) (Hard)
99. [Minimum Number of K Consecutive Bit Flips](https://www.internhack.in/learn/dsa/problem/minimum-number-of-k-consecutive-bit-flips) (Hard)
100. [Minimum One Bit Operations to Make Integers Zero](https://www.internhack.in/learn/dsa/problem/minimum-one-bit-operations-to-make-integers-zero) (Hard)

## Companies that ask bit manipulation problems

- [Google](https://www.internhack.in/learn/dsa/companies/google): 60 of these problems
- [Amazon](https://www.internhack.in/learn/dsa/companies/amazon): 40 of these problems
- [Meta](https://www.internhack.in/learn/dsa/companies/meta): 33 of these problems
- [Bloomberg](https://www.internhack.in/learn/dsa/companies/bloomberg): 30 of these problems
- [Microsoft](https://www.internhack.in/learn/dsa/companies/microsoft): 30 of these problems
- [Apple](https://www.internhack.in/learn/dsa/companies/apple): 9 of these problems
- [Adobe](https://www.internhack.in/learn/dsa/companies/adobe): 7 of these problems
- [IBM](https://www.internhack.in/learn/dsa/companies/ibm): 6 of these problems
- [TCS](https://www.internhack.in/learn/dsa/companies/tcs): 6 of these problems
- [Oracle](https://www.internhack.in/learn/dsa/companies/oracle): 6 of these problems
- [Nvidia](https://www.internhack.in/learn/dsa/companies/nvidia): 5 of these problems
- [Infosys](https://www.internhack.in/learn/dsa/companies/infosys): 5 of these problems

## Before your interview

Most resumes are filtered by software before a recruiter reads them. [Check your resume ATS score free](https://www.internhack.in/ats-score/try), no signup needed.

## Other DSA topics

- [Array](https://www.internhack.in/learn/dsa/array) (1869)
- [String](https://www.internhack.in/learn/dsa/string) (775)
- [Hash Table](https://www.internhack.in/learn/dsa/hash-table) (708)
- [Math](https://www.internhack.in/learn/dsa/math) (564)
- [Dynamic Programming](https://www.internhack.in/learn/dsa/dynamic-programming) (557)
- [Sorting](https://www.internhack.in/learn/dsa/sorting) (464)
- [Greedy](https://www.internhack.in/learn/dsa/greedy) (407)
- [Depth-First Search](https://www.internhack.in/learn/dsa/depth-first-search) (314)
- [Binary Search](https://www.internhack.in/learn/dsa/binary-search) (298)
- [Matrix](https://www.internhack.in/learn/dsa/matrix) (246)
- [Breadth-First Search](https://www.internhack.in/learn/dsa/breadth-first-search) (245)
- [Tree](https://www.internhack.in/learn/dsa/tree) (235)
- [Two Pointers](https://www.internhack.in/learn/dsa/two-pointers) (217)
- [Prefix Sum](https://www.internhack.in/learn/dsa/prefix-sum) (204)
- [Database](https://www.internhack.in/learn/dsa/database) (197)
- [Heap (Priority Queue)](https://www.internhack.in/learn/dsa/heap-priority-queue) (196)
- [Simulation](https://www.internhack.in/learn/dsa/simulation) (177)
- [Counting](https://www.internhack.in/learn/dsa/counting) (174)
- [Binary Tree](https://www.internhack.in/learn/dsa/binary-tree) (169)
- [Stack](https://www.internhack.in/learn/dsa/stack) (167)

## Related

- [Home](https://www.internhack.in/)
- [Learn](https://www.internhack.in/learn)
- [DSA](https://www.internhack.in/learn/dsa)
