##
Check if a number is Palindrome
April 5, 2013

Given an integer, write a function that returns true if the given number is palindrome, else false. For example, 12321 is palindrome, but 1451 is not palindrome.

April 5, 2013

Given an integer, write a function that returns true if the given number is palindrome, else false. For example, 12321 is palindrome, but 1451 is not palindrome.

December 28, 2012

Given a number n, write an efficient function to print all prime factors of n. For example, if the input number is 12,

December 26, 2012

There are two vessels of capacities ‘a’ and ‘b’ respectively. We have infinite water supply. Give an efficient algorithm to make exactly 1 litre of water in one of the vessels.

December 10, 2012

The value of Exponential Function e^x can be expressed using following Taylor Series. e^x = 1 + x/1! + x^2/2! + x^3/3! + ……

December 8, 2012

Write code to convert a given number into words. For example, if “1234” is given as input, output should be “one thousand two hundred thirty four”.

December 6, 2012

There are some glasses with equal capacity as 1 litre. The glasses are kept as follows:

November 12, 2012

An array of size n is given. The array contains digits from 0 to 9. Generate the largest number using the digits in the array such that the number is divisible by 2, 3 and 5.

November 5, 2012

Given a stream of numbers, generate a random number from the stream. You are allowed to use only O(1) space and the input is in the form of stream, so can’t store the previously seen numbers.

November 1, 2012

Pascal’s triangle is a triangular array of the binomial coefficients. Write a function that takes an integer value n as input and prints first n lines of the Pascal’s triangle. Following are the first 6 rows of Pascal’s Triangle.

October 23, 2012

We know the Pascal’s Identity very well, i.e. ncr = n-1cr + n-1cr-1

October 18, 2012

Reservoir sampling is a family of randomized algorithms for randomly choosing k samples from a list of n items,