# 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