Morgan Stanley Interview Question

Q: How would you write an algorithm to find palindromes Q: How would you write an algorithm to find prime numbers Q: How would you write an algorithm to find the top ten common words in a string.