# Category Archives: Mathematical

There are n bikes and each can cover 100 km when fully fueled. What is the maximum amount of distance you can go using n… Read More
Location: Guagaon Position: Software Developer I decided to write this post because when i was preparing, I didn’t find any help on google about the… Read More
Given a number ‘n’, how to check if n is a Fibonacci number. First few Fibonacci numbers are 0, 1, 1, 2, 3, 5, 8,… Read More
Online round: 1. There exist a binary tree with each node containing a character (lower case letters for leaf nodes and upper case letters for… Read More
Given a set of points in the plane. the convex hull of the set is the smallest convex polygon that contains all the points of… Read More
Given a set of points in the plane. the convex hull of the set is the smallest convex polygon that contains all the points of… Read More
Given a polygon and a point ‘p‘, find if ‘p‘ lies inside the polygon or not. The points lying on the border are considered inside.… Read More
Given two line segments (p1, q1) and (p2, q2), find if the given line segments intersect with each other.Before we discuss the solution, let us… Read More
Given n numbers, each with some frequency of occurrence. Return a random number with probability proportional to its frequency of occurrence. Example:  Let following be… Read More
Consider a row of N coins of values V1 . . . Vn, where N is even. We play a game against an opponent by… Read More
Given an array of size n, generate and print all possible combinations of r elements in array. For example, if input array is {1,… Read More
Evaluate an expression represented by a String. The expression can contain parentheses, you can assume parentheses are well-matched. For simplicity, you can assume only binary… Read More
Given n dice each with m faces, numbered from 1 to m, find the number of ways to get sum X. X is the summation… Read More
Given a positive integer, write a function that returns true if the given number is a palindrome, else false. For example, 12321 is a palindrome,… Read More
Let us consider the following problem to understand Segment Trees.We have an array arr[0 . . . n-1]. We should be able to  Find the… Read More