# Interview

## Calculate the Total Amount of Points using Java

The challenge Our football team finished the championship. The result of each match look like “x:y”. Results of all matches are recorded in the collection.… Read More »Calculate the Total Amount of Points using Java

## FizzBuzz in Java

The challenge Write a program that outputs the string representation of numbers from 1 to n. But for multiples of three it should output “Fizz” instead… Read More »FizzBuzz in Java

## Get the Next Small Integer in Python

The challenge Write a function: def solution(A) that, given an array A of N integers, returns the smallest positive integer (greater than 0) that does… Read More »Get the Next Small Integer in Python

## Find Numbers with Even Number of Digits using Java

The challenge Given an array nums of integers, return how many of them contain an even number of digits. Example 1: Input: nums = [12,345,2,6,7896] Output: 2 Explanation: 12… Read More »Find Numbers with Even Number of Digits using Java

## How to use a Java HashSet by example

What is a HashSet A HashSet is an unordered collection containing unique elements. It has the standard collection operations Add, Remove, Contains, but since it… Read More »How to use a Java HashSet by example

## Get The Shortest Path in Binary Matrix using Python

The challenge In an N by N square grid, each cell is either empty (0) or blocked (1). A clear path from top-left to bottom-right has length k if and… Read More »Get The Shortest Path in Binary Matrix using Python

## Palindrome Partitioning in Python

The problem Given a string s, partition s such that every substring of the partition is a palindrome. Return all possible palindrome partitioning of s. Example: Input: “aab” Output: [… Read More »Palindrome Partitioning in Python

## Best Time to Buy and Sell Stock with Python

The problem Say you have an array prices for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum… Read More »Best Time to Buy and Sell Stock with Python

## Find the Minimum Absolute Difference in BST using Java

The question Given a binary search tree with non-negative values, find the minimum absolute difference between values of any two nodes. Example: Input: 1 \ 3 /… Read More »Find the Minimum Absolute Difference in BST using Java

## Find Maximum Subarrays using Java

The problem Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum. Example: Input:… Read More »Find Maximum Subarrays using Java

## Finding Number Complements using Java

The problem Given a positive integer num, output its complement number. The complement strategy is to flip the bits of its binary representation. Example 1: Input: num =… Read More »Finding Number Complements using Java

## Self Dividing Numbers using Python

Introduction A self-dividing number is a number that is divisible by every digit it contains. For example, 128 is a self-dividing number because 128 % 1 == 0, 128… Read More »Self Dividing Numbers using Python

## Remove the Outermost Parentheses using Python

The Question A valid parentheses string is either empty (“”), “(” + A + “)”, or A + B, where A and B are valid parentheses strings, and + represents string concatenation.  For example, “”, “()”, “(())()”,… Read More »Remove the Outermost Parentheses using Python

## How to get the Range Sum of Binary Search Tree using Java

Given the root node of a binary search tree, return the sum of values of all nodes with value between L and R (inclusive). The binary search tree is guaranteed to… Read More »How to get the Range Sum of Binary Search Tree using Java

## How to duplicate zeros in place using Python

Given a fixed length array arr of integers, duplicate each occurrence of zero, shifting the remaining elements to the right. Note that elements beyond the length of the… Read More »How to duplicate zeros in place using Python

## How to Reorder Data in Log Files using Python

Let’s say that you have an array or a list, or logs. Each of these logs is a space-delimited string of words. For example: logs… Read More »How to Reorder Data in Log Files using Python

## What is Fizz Buzz?

Fizz buzz is a common programming interview question. The problem statement usually reads something like this: Write a short program that prints each number from… Read More »What is Fizz Buzz?

## How to write a Quicksort Algorithm in Python

While there are libraries available for all programming languages that offer abilities to sort list, arrays and collections, it is important to know how this… Read More »How to write a Quicksort Algorithm in Python

## How to Reverse a String or List using Python

Python comes with the power of slicing. Let’s try it with a String: Now let’s try the same with a List: As we can see… Read More »How to Reverse a String or List using Python

## How to Reverse a Binary Tree in Python

Reversing a Binary Tree is a common programming interview question. By learning how to Reverse a Binary Tree in Python, you are working towards fundamental… Read More »How to Reverse a Binary Tree in Python