Skip to content

Blog

Members Public

Challenge 3: Power of 2

We solve by making use of the & operator in computers. There are many ways to solve this, of which two approaches are simple, and one is a more complex but better solution.

Members Public

Twitter Registration: Single Responsibility Principle

We design Twitter registration software with the help of the single responsibility principle that contains a notification service, database repository, account service, and execution class.

Members Public

Introduction to Bit Manipulation

In order to ace coding interviews for tech companies, it is necessary to understand Bitwise operators, which are usually fast compared to arithmetic and other math operations.

Members Public

Switch Sign of a Number

We make use of bit manipulation to solve this problem. using a NOT operator.

Members Public

Subsets Or Powerset

In subsets or powerset problem, we need to write a program that finds all possible subsets (the power set) of a given input. The solution set must not contain duplicate elements.

Subsets/PowerSet
Members Public

Challenge 2: Check If a Given Number is Even/Odd

This is an example of another Bitwise question. Think of the rightmost bit of a number and think of some logic that could solve this.

Members Public

Counting Bits II

This is an extension to the counting set bits problem, counting the number of set bits or 1's present in a number. In here we see solutions in Java, JavaScript, Cpp, and TypeScript.

Members Public

Challenge 1: Count Set Bits Or Number of 1 bit's

This is a traditional problem counting the number of set bits or 1's present in a number. Let’s see how we can count the set bits using the AND operator.

Members Public

Bitwise AND, Computations, and Examples

A Bitwise AND is a binary operation that takes two equal-length binary representations and performs the logical AND operation on each pair of the corresponding bits. This is equivalent to multiplying them.

Members Public

Introduction to Bitwise AND operator

Bitwise AND is the most commonly used logical Bitwise operator. It is represented by a sign (&). AND operator is the same as the AND gate we studied in the chapter on digital electronics.