Pergunta de entrevista da empresa Fast Enterprises

Write pseudo code function to check if a given number is prime or not. Is there anyway you can optimize your given solution?