Pergunta de entrevista da empresa Gentex Corporation

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