Domanda di colloquio di Gentex Corporation

How would you optimize the prime number algorithm for size vs speed?