🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← All topics

Bit Manipulation Quiz: questions with answers

8 questions, each with the answer and a short explanation.

Take the timed quiz + get a certificate →
  1. Q1. What is 5 ^ 3 (XOR)?
  2. Q2. What is 6 & 3 (AND)?
  3. Q3. What is 1 << 4?
  4. Q4. Every number appears twice except one. Which operation finds the single number in O(1) space?
  5. Q5. What does n & (n − 1) do?
  6. Q6. Which numbers are powers of two? (select all that apply)
  7. Q7. How many 1 bits does 13 have?
  8. Q8. In Java, which shift fills with 0s even for negative numbers?