Showing posts with label amazon. Show all posts
Showing posts with label amazon. Show all posts

Twin Primes

A Math oriented question asked at a recent Amazon interview.

Q : Given any twin prime pair, prove that the number between the twin primes is always divisible by 6.

Twin Prime (from Wiipedia) :

A twin prime is a prime number that differs from another prime number by two. Except for the pair (2, 3), this is the smallest possible difference between two primes. Some examples of twin prime pairs are (3, 5), (5, 7), (11, 13), (17, 19), (29, 31), (41, 43), ... (821, 823), etc. Sometimes the term twin prime is used for a pair of twin primes; an alternative name for this is prime twin.

Panlindrome Dates

Asked at a recent Amazon interview : 2001-01-02 is a palindrome date.
Find the previous closest palindore date?

[ALGO] Is Binary Search Tree

Given a binary tree, verify if it is Binary Search Tree
 
Moviehole-madhurtanwani © 2010 | Designed by Chica Blogger | Back to top