Compass interview question

Product index question, palindrome, algorithms