Webroot interview question

algorithm for prime number and palindrome