Bit Manipulation DSA Problems

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 (Easy)
  2. Binary Gap (Easy)
  3. Binary Number with Alternating Bits (Easy)
  4. Binary Prefix Divisible By 5 (Easy)
  5. Binary Watch (Easy)
  6. Bitwise OR of Adjacent Elements (Easy)
  7. Bitwise OR of Even Numbers in an Array (Easy)
  8. Check if Bitwise OR Has Trailing Zeros (Easy)
  9. Complement of Base 10 Integer (Easy)
  10. Construct the Minimum Bitwise Array I (Easy)
  11. Convert a Number to Hexadecimal (Easy)
  12. Count Complete Tree Nodes (Easy)
  13. Count Monobit Integers (Easy)
  14. Count Pairs Of Similar Strings (Easy)
  15. Count the Number of Consistent Strings (Easy)
  16. Count Triplets with Even XOR Set Bits I (Easy)
  17. Counting Bits (Easy)
  18. Divide Array Into Equal Pairs (Easy)
  19. Find the Difference (Easy)
  20. Find the K-or of an Array (Easy)
  21. Find the K-th Character in String Game I (Easy)
  22. Find the XOR of Numbers Which Appear Twice (Easy)
  23. First Letter to Appear Twice (Easy)
  24. Flipping an Image (Easy)
  25. Hamming Distance (Easy)
  26. Longest Nice Substring (Easy)
  27. Maximum Strong Pair XOR I (Easy)
  28. Minimum Bit Flips to Convert Number (Easy)
  29. Minimum Operations to Collect Elements (Easy)
  30. Missing Number (Easy)
  31. Number Complement (Easy)
  32. Number of 1 Bits (Easy)
  33. Number of Bit Changes to Make Two Integers Equal (Easy)
  34. Number of Even and Odd Bits (Easy)
  35. Number of Steps to Reduce a Number to Zero (Easy)
  36. Palindrome Permutation (Easy)
  37. Power of Four (Easy)
  38. Power of Two (Easy)
  39. Prime Number of Set Bits in Binary Representation (Easy)
  40. Reverse Bits (Easy)
  41. Set Mismatch (Easy)
  42. Shortest Subarray With OR at Least K I (Easy)
  43. Single Number (Easy)
  44. Smallest Number With All Set Bits (Easy)
  45. Sort Integers by The Number of 1 Bits (Easy)
  46. Sum of All Subset XOR Totals (Easy)
  47. Sum of Values at Indices With K Set Bits (Easy)
  48. Two Out of Three (Easy)
  49. XOR Operation in an Array (Easy)
  50. Apply Operations on Array to Maximize Sum of Squares (Hard)
  51. Chalkboard XOR Game (Hard)
  52. Closest Subsequence Sum (Hard)
  53. Concatenated Divisibility (Hard)
  54. Count Pairs With XOR in a Range (Hard)
  55. Count Paths That Can Form a Palindrome in a Tree (Hard)
  56. Distribute Repeating Integers (Hard)
  57. Find a Value of a Mysterious Function Closest to Target (Hard)
  58. Find Longest Awesome Substring (Hard)
  59. Find Minimum Time to Finish All Jobs (Hard)
  60. Find Nth Smallest Integer With K One Bits (Hard)
  61. Find Number of Ways to Reach the K-th Stair (Hard)
  62. Find Products of Elements of Big Array (Hard)
  63. Find Subarray With Bitwise OR Closest to K (Hard)
  64. Find Sum of Array Product of Magical Sequences (Hard)
  65. Find the K-th Character in String Game II (Hard)
  66. Find the Maximum Sequence Value of Array (Hard)
  67. Find the Maximum Sum of Node Values (Hard)
  68. Find the Minimum Cost Array Permutation (Hard)
  69. Find the Shortest Superstring (Hard)
  70. Find Weighted Median Node in Tree (Hard)
  71. Find XOR Sum of All Pairs Bitwise AND (Hard)
  72. Frequencies of Shortest Supersequences (Hard)
  73. Groups of Strings (Hard)
  74. Kth Ancestor of a Tree Node (Hard)
  75. Make the XOR of All Segments Equal to Zero (Hard)
  76. Maximize Grid Happiness (Hard)
  77. Maximize Score After N Operations (Hard)
  78. Maximize the Number of Partitions After Operations (Hard)
  79. Maximize Value of Function in a Ball Passing Game (Hard)
  80. Maximum AND Sum of Array (Hard)
  81. Maximum Bitwise AND After Increment Operations (Hard)
  82. Maximum Genetic Difference Query (Hard)
  83. Maximum Good People Based on Statements (Hard)
  84. Maximum Good Subtree Score (Hard)
  85. Maximum Number of Achievable Transfer Requests (Hard)
  86. Maximum Number of Groups Getting Fresh Donuts (Hard)
  87. Maximum Number of Moves to Kill All Pawns (Hard)
  88. Maximum Points After Collecting Coins From All Nodes (Hard)
  89. Maximum Score Words Formed by Letters (Hard)
  90. Maximum Strong Pair XOR II (Hard)
  91. Maximum Students Taking Exam (Hard)
  92. Maximum Total Reward Using Operations II (Hard)
  93. Maximum XOR With an Element From Array (Hard)
  94. Minimize OR of Remaining Elements Using Operations (Hard)
  95. Minimum Cost to Connect Two Groups of Points (Hard)
  96. Minimum Cost Walk in Weighted Graph (Hard)
  97. Minimum Incompatibility (Hard)
  98. Minimum Number of Flips to Convert Binary Matrix to Zero Matrix (Hard)
  99. Minimum Number of K Consecutive Bit Flips (Hard)
  100. Minimum One Bit Operations to Make Integers Zero (Hard)

Companies that ask bit manipulation problems

Before your interview

Most resumes are filtered by software before a recruiter reads them. Check your resume ATS score free, no signup needed.

Other DSA topics