LESSON 14 / 75·2 min readAdvanced

Bit manipulation

Must knowConcept lesson
01 Understand02 Recall03 Prepare

Important concepts

  • AND, OR, XOR
  • Left shift, right shift
  • Bit masks
  • Set/clear/toggle bit
  • Count set bits
  • Find missing number
  • Power of two
  • Single number problem

Problems to practice

  • Single Number
  • Number of 1 Bits
  • Missing Number
  • Bitwise AND of Range
  • Reverse Bits

Interview guidance

Bit manipulation is common in low-level optimization and tricky interview problems.


PAUSE & RECALL

Can you explain it without the notes?

Bit manipulation

Use your own words. Explain an example and one limitation before checking the explanation.

Check your explanation

Important concepts

CONNECT IT TO YOUR INTERVIEW

Turn this concept into a clear answer.

Practice this concept
YOUR NEXT STEP

Keep connecting the ideas.

Next lesson: Sliding window and two pointers

Adapted from 14_DSA_MASTER.md · “14. Bit manipulation”. Examples are study fragments; framework behavior can depend on your version.