📘 Day 23 – Bit Manipulation Problems (QA Focused)

Practice these problems to strengthen your understanding of bitwise operators in Python. These are the type of coding challenges that can appear in QA Automation Engineer interviews.

Problem 1: Odd or Even

Write a program to check if a number is odd or even using bitwise operators (without using the modulus operator).

Example:

Problem 2: Power of 2

Write a function that checks if a given number is a power of 2.

Example:

Problem 3: Unique Number in a List

Given a list where every element appears twice except one element, find that unique element using bitwise operators.

Example:

Problem 4: Swap Two Numbers

Swap two numbers without using a temporary variable. Use bitwise XOR operator.

Example: