Veeva Systems Interview Question

Questions were related to Selenium, Java, and TestNG. I was asked to write code to reverse a string, find if the year is a leap year or not, and check how many words "apple" can be formed out of a random string.