Palindrome Number
EasyMathMath
Solve this the way you would in the interview: out loud, on a timer, with an AI interviewer asking follow-ups while you code. You get a scored report at the end.
Practice this as a mock interviewFree to start, no account neededProblem
Given an integer x, return true if x is a palindrome, and false otherwise.
A palindrome reads the same forward and backward.
Examples
Input: x = 121
Output: true
121 reads as 121 from left to right and from right to left.
Input: x = -121
Output: false
From left to right, it reads -121. From right to left, it reads 121-. Therefore it is not a palindrome.
Input: x = 10
Output: false
Reads 01 from right to left. Therefore it is not a palindrome.
Constraints
- -2^31 <= x <= 2^31 - 1
What the interviewer grades
A correct solution is one of five scores. The report also grades problem understanding (did you clarify inputs and edge cases before coding), problem solving, communication while you work, code quality, and testing. See a sample report, or read up on the pattern in the lessons.