Master Bit Manipulation For Coding Interviews
Bit Manipulation is a powerful technique that solves bit-related problems mostly in constant time.

Table of Contents
Course Overview
In this course, you will learn how to solve problems using bit manipulation, a powerful technique that can be used to optimize your algorithmic and problem-solving skills.
This is one of the most important/critical topics when someone starts preparing for coding interviews for FAANG companies.
To kick things off, you’ll start by learning about the number system and how it’s represented. Then you’ll learn about the six bitwise operators: AND, OR, NOT, XOR, and bit shifting. Throughout, you will get tons of hands-on experience working through practice problems to help sharpen your understanding. By completing this course, you can solve problems faster and more efficiently.
What do you get?
- 44 lessons were categorized based on topics.
- 28 challenges.
- 27+ Illustrations and sketches
- 271 solutions provided.
- Solutions are written in
Java
,Python
,JavaScript
,C++
, andTypeScript
. - GitHub repository access(Java, JavaScript)
Takeaway Skills
- Master problem-solving that involves bit manipulation.
- Master the bit manipulation allows you to organize all inputs in binary representation at the memory levels.
- Master how the bit-level operations are computed. Understand that bit-level operations are based on all the arithmetic operations built into all languages.
- Solve problems that are commonly asked in coding interviews related to bit manipulation.
- These bit tricks could help in competitive programming in running algorithms, mostly in
O(1)
time.
Est. Time: 5hrs to complete.
Course Contents
Getting Started
- Introduction to Bit Manipulation (preview)
- What is Bit Manipulation? (preview)
Number Systems, Bitwise, and Binary
- Introduction to Number Systems (preview)
- Decimal Number System (preview)
- Binary Number System and Representation (preview)
- What are Bitwise Operators? (preview)
- Count the Number of Digits in an integer (preview)
- Convert Decimal Numbers to Binary Numbers (preview)
Bitwise AND
- Introduction to AND Operator
- Bitwise And, Computations, and Examples
- Challenge 1: Count Set Bits Or Number of 1 bit's (preview)
- Solution Review: Count Set Bits Or Number of 1 bit's (preview)
- Counting Bits II
- Challenge 2: Check If a Given Number is Even/Odd
- Solution Review: Check If a Given Number is Even/Odd
- Challenge 3: Power of 2 (preview)
- Solution Review: Power of 2 (preview)
Bitwise OR
- Introduction to OR Operator
- Bitwise OR, Computations, and Examples
- Number Of Flips Required To Make a|b Equal to c
Bitwise NOT
Bitwise XOR
- Introduction to XOR
- Bitwise XOR, Computations, and Examples
- Swap Two Numbers
- Find Odd Occurring Element
- Detect If Two Integers Have Opposite Signs
- Hamming Distance
- Challenge 1: Single Number
- Solution Review: Single Number
- Challenge 2: Missing Number
- Solution Review: Missing Number
Bit Shifting - Left, Right
Bitwise Left Shift Problems
- Find the Bit Length of a Number
- Check If Kth Bit Is Set/Unset Using Left Shift
- Subsets Or Powerset (preview)
- Challenge 1: Get the First Set Bit Position Using the Left Shift
- Solution Review: Get The First Set Bit Position Using the Left Shift
Bitwise Right Shift problems
- Check If Kth Bit Is Set/Unset Using Right Shift
- Challenge 1: Get the First Set Bit Position Using the Right Shift
- Solution Review: Get the First Set Bit Position Using the Right Shift
Final Thoughts
This concludes the course on bit manipulation.
This course has taught you how to re-write arithmetic operators like +, -, /, *
into left, right shift, and other bit-level operations.
I hope the learning you gained in this course will be useful in solving Leetcode, Hackerrank, HackerEarth, Codeforces, Codechef, and other online coding challenges. This will also help you with interviews at FAANG or other top tech companies.
I wish you good luck and hope this course makes a difference in your coding journey!
Note: In the upcoming edits, you will see the following items:
- Solutions in Rust and Go.
- A few medium and hard problems were asked in recent FAANG and fast-paced startup coding interviews.
Happy Coding 👨🏻💻 !!
If you have finished the course, I'm super happy for you 🥳, and it's been a pleasure to be part of your professional journey.
I'm working hard in my spare time to keep the site up and running and to update the site with the most requested features. So long as people are having fun, I want to keep the site going.
If you'd like to say thanks, I'd really appreciate a coffee :)

👨🏻💻 Gopi Gorantala Newsletter
Join the newsletter to receive the latest updates in your inbox.