Tag coding interview questions

Transpose Matrix using Python

Transpose Matrix using Python

Transpose Matrix is one of the popular problems in coding interviews. This problem requires you to manipulate a matrix by flipping its rows and columns. So, if you want to know how to transpose a matrix, this article is for…

Buddy Strings using Python

Buddy Strings using Python

Buddy Strings is a popular problem in coding interviews. In this problem, you need to check if it is possible to get two strings, different from exactly a swap of two letters. So, if you want to learn how to…

Binary Search using Python

Binary Search using Python

Binary Search is an algorithm used to find an element in a sorted array by repeatedly dividing the search interval in half. In coding interviews, there is always a question on any search algorithm. So, if you want to learn…

Set Mismatch using Python

Set Mismatch using Python

Set Mismatch is a popular question in coding interviews. In this problem, you need to find two numbers in an array that are missing or duplicated. So, if you want to know how to solve this problem using Python, this…

Reorder Routes using Python

Reorder Routes using Python

Reorder routes to make all paths lead to the city zero is a popular question in coding interviews. In this problem, you need to reorder the connections between the cities so that all paths lead to the city labelled as…

Relative Ranks using Python

Relative Ranks using Python

The problem of relative ranks is a popular coding interview question. Here you will be given an array of integers representing the scores of athletes, assuming that the athletes with the 1st rank will have the highest score, and you…

Hamming Distance using Python

Hamming Distance using Python

The problem of hamming distance between two integers is a popular coding interview question. Here you will be given two integers, and you need to calculate the number of positions at which the corresponding bits of the integers are different. So, if…

Assign Cookies using Python

Assign Cookies using Python

The problem of assigning cookies is a popular coding interview question. Here you will be given a list of children with their greed factors and a list of cookies with their sizes. To solve this problem, you need to assign…

Counting Bits using Python

Counting Bits using Python

Counting Bits is a popular coding interview question. Here you will be given an integer, and you have to return an array of length (length of the integer + 1) by counting the number of 1’s in the binary representation…

Move Zeroes using Python

Move Zeroes using Python

Moving zeroes is one of the popular questions in coding interviews. Here we need to move all the 0’s in an array to the end of the array while keeping the order of non-zero elements the same. So, if you…

Ugly Number using Python

Ugly Number using Python

Ugly numbers are the numbers whose prime factors are limited to 2, 3, and 5. Finding the Ugly number is a popular question in coding interviews. Here you need to check if a number is an ugly number or not.…

Add Digits using Python

Add Digits using Python

The problem of adding digits is a popular coding interview question. Here we need to add all the digits of the integer till we get to a single-digit integer. So, if you want to know how to solve this problem using…

Power of Two using Python

Power of Two using Python

The problem of Power of Two is a popular coding interview question. Here we need to check whether the input value is the power of two or not. So, if you want to know how to solve this problem using Python, this…

Majority Element using Python

Majority Element using Python

The majority element problem is one of the popular coding interview questions. Here we need to find the element that appears more than the other element in an array. So, if you want to know how to solve this problem,…

Single Number using Python

Single Number using Python

The Single Number problem is one of the popular coding interview questions. Here you will be given an array of integers where each item appears twice except for one that we need to find. So, if you want to know how…

Pascal’s Triangle using Python

Pascal's Triangle using Python

Pascal’s Triangle is one of the popular coding interview questions. It is asked in the coding interviews by FAANG companies many times. In Pascal’s Triangle problem, we need to return the number of rows of a Pascal’s Triangle. So, if…

Plus One using Python

Plus One using Python

The Plus One problem is one of the popular coding interview questions. It is asked in the coding interviews by companies like FAANG many times. Here you need to increment the last digit of an array by one and return…