# Category Archives: Bit Magic

Parity of a number refers to whether it contains an odd or even number of 1-bits. The number has “odd parity”, if it contains odd… Read More
Round 1 (APTITUDE) : 20 mcqs in 30 minutes of time -0.25 negative marking Questions were from core computer science subjects and one blood relation… Read More
Given two numbers you are required to check whether they are anagrams of each other or not in binary representation.Examples:   Input : a = 8,… Read More
Given a non-negative number n and two values l and r. The problem is to unset the bits in the range l to r in… Read More
Given a non-negative number n and two values l and r. The problem is to toggle the bits in the range l to r in… Read More
Round 1 (Online Test): Four Programming Questions- a) Given a string find number of different substrings that are palindromes. b) In a matrix we can… Read More
Given a non-negative number n. The problem is to toggle the last m bits in the binary representation of n. A toggle operation flips a… Read More
Given a number n. The problem is to efficiently check whether n is a multiple of 4 or not without using arithmetic operators. Examples:   Input :… Read More
Given an array of n integers. Find out number of pairs in array whose XOR is odd.Examples :   Input : arr[] = { 1, 2,… Read More
Given a non-negative number n. The problem is to set the rightmost unset bit in the binary representation of n. If there are no unset… Read More
Given a positive integer ‘n’ having ‘x’ number of set bits in its binary representation. The problem is to find the previous smaller integer(greatest integer… Read More
The problem is to convert the given binary number (represented as string) to its equivalent octal number. The input could be very large and may… Read More
Given two numbers m and n. Find the position of the rightmost different bit in the binary representation of numbers. It is guaranteed that such… Read More
Given an array such that all its terms is either 0 or 1.You need to tell the number represented by a subarray a[l..r] is odd… Read More
Given a number n. The problem is to check whether every bit in the binary representation of the given number is set or not. Here… Read More