Frequently Asked Questions Calculate the Hamming Distance between two Integers Problem Statement Given two integers, calculate the hamming distance between them. Solution Explanation Hamming Distance between integers is defined as the number of indexes where the two bits differ. For example, given integers

Array Find Two Numbers in an Array Which Sum Up to K Problem Statement Given an array of integers, find out two indices such that the sum of the numbers at that indices matches K. For example, {4, 6, 8, 1, 9} and K = 15,

Linked List Check if a LinkedList has a cycle Problem Statement Given a single linked list, verify if the list has a cycle. A linked list has a cycle if a node's reference points back to an earlier node in the chain.

Array Best Time to Buy and Sell Stock Problem Statement Given an array 'stocks' in which each value at index 'i' is the stock price on day 'i', Find the maximum profit you can make by performing atmost one Buy and

Interview Questions Add Binary Leetcode Problem Statement Given two binary strings, return their sum (also a binary string). For example,a = "11", b = "1" Return "100". Solution Explanation The question is very

Binary Search First Bad Version Leetcode Problem Statement Suppose you have n versions [1, 2, ..., n] and you want to find out the first bad one, which causes all the following ones to be bad. You are given an

Leetcode Easy Reverse a LinkedList Java Problem Statement Reverse a singly linked list. Given a single linked list, reverse it in place. Explanation Given a linked list like below, 1 -> 2 -> 3 -> 4

Array Climbing Stairs Leetcode Problem Statement You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can