← Amazon questions

Nearest palindrome to a number

Filed under Amazon

Given a string representing an integer, find the closest integer (not including itself) that is a palindrome. The 'closest' is defined as the absolute difference minimized. If there is a tie, return…

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Amazon questions

Collected from public candidate posts and coding forums. Updated Nov 2026.