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) :
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?
Find the previous closest palindore date?
Reverse words in a sentence
Given an array of characters, reverse the words in the sentence.
For example, if the sentence is "Reverse these words", then the output should be "words these reverse".
Source : this interview q
For example, if the sentence is "Reverse these words", then the output should be "words these reverse".
Source : this interview q
Subscribe to:
Posts (Atom)