Amazon Interview Question

Find all prime numbers no bigger than x

Interview Answer

Anonymous

May 25, 2012

The fastest way is to use Sieve of Eratosthenes. http://en.wikipedia.org/wiki/Sieve_of_Eratosthenes#Implementation