Coding Interviews Questions

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.

Find Hamming Distance between two integers

In this lesson, we find the number of positions where

Two Sum problem, 4 different ways to solve it

In this two-sum problem, we use various approaches to solve the problem from brute force to an optimized approach. We also discuss the take-offs and talk about complexity analysis.

Check If the Given Array Is Monotonic

An array is called monotonic if the index of each element increases from the first to the last or decreases from the first to the last.

How To Check If The Kth Bit Is Set/Unset

In the kth bit set/unset problem, we need to write a program that checks whether the kth bit of a number is either 1 or 0.

Subsets Or Powerset, A Faang Interview Question

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.

How to find a missing number in java

In this article, we'll learn various ways to find the missing number in an array. We use a memoization approach, a mathematical approach, and the most optimized way using the XOR operator.

How to reverse the letters in a string in Java

In this article, we'll learn various ways to reverse strings in Java. An algorithmic approach with a flow chart and steps. Using java API methods to solve this problem and rotate kth elements or characters in an array.