IBM interview question

Check if prime or not? Rotate an array