Pregunta de entrevista de Gentex Corporation

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