FastPrepPalindrome Number
Problems/Palindrome Number

Palindrome Number

Kotak Mahindra Bank logoKotak Mahindra Bank● EasyFULLTIMEPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: In the first round of a Kotak Mahindra Bank SDE-2 loop, the interviewer asked the well-known Palindrome Number problem. The task is to tell whether an integer reads the same both ways. As a follow-up, they asked for a way that does not turn the number into a string.

The report gives no limits. Here, x can be any 32-bit signed integer, and negative numbers are never palindromes. Any correct method is accepted, and the editorial shows the no-string way.

Our version is about 95% the same as the reported question.

Given an integer x, return true if x is a palindrome, and false otherwise.

An integer is a palindrome when its decimal digits read the same from left to right and from right to left. A negative number is never a palindrome, because its minus sign has no match at the other end.

Follow-up: can you solve it without converting the integer to a string?

Function

isPalindrome(x: int) → boolean

Examples

Example 1

x = 121return = true

Read from left to right, the digits are 1, 2, 1. Read from right to left, they are also 1, 2, 1. So 121 is a palindrome.

Example 2

x = -121return = false

From left to right the number reads -121. From right to left it reads 121-. These are different, so the answer is false.

Example 3

x = 10return = false

From right to left the number reads 01, which is not the same as 10. So the answer is false.

Constraints

  • -2^31 <= x <= 2^31 - 1

More Kotak Mahindra Bank interview questions

  • Longest Common PrefixPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Longest Consecutive SequencePHONE SCREEN · Seen Nov 2026
  • Validate Binary Search TreePHONE SCREEN · Seen Nov 2026
  • Roman to IntegerPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • Remove Duplicates From Sorted Array In PlacePHONE SCREEN · ONSITE INTERVIEW · Seen Sep 2026
  • Best Time to Buy and Sell StockONSITE INTERVIEW · Seen Nov 2026
  • Best Time to Buy and Sell Stock IIONSITE INTERVIEW · Seen Nov 2026
  • Maximum Non-Adjacent Coins in Two RowsONSITE INTERVIEW · Seen Oct 2026
  • Search in Rotated Sorted ArrayONSITE INTERVIEW · Seen Oct 2026
  • Find the Index of the First Occurrence in a StringONSITE INTERVIEW · Seen Oct 2026

Similar questions at other companies

  • Automation Pipeline, Part 1: Single WorkerPlaid · PHONE SCREENPlaid interview questions
  • Subtract Two Large Number StringsStackAdapt · PHONE SCREENStackAdapt interview questions
  • Circular Primes Below a LimitAmazon · PHONE SCREEN
  • Streaming AverageXantium · PHONE SCREEN
  • Fair Coin from a Biased CoinAnthropic · PHONE SCREENAnthropic interview questions
  • Stack Formula InterpreterTypeSafe AI · PHONE SCREEN
  • Employee Count Median, Mean and ModeClay · PHONE SCREEN
  • Newton Square Root to a Guaranteed ToleranceSquarepoint Capital · PHONE SCREENSquarepoint Capital interview questions
  • Biased Coin: Probability of Exactly h HeadsAkuna Capital · PHONE SCREENAkuna Capital interview questions
  • Dice Sum That Is a Multiple of mSusquehanna International Group (SIG) · PHONE SCREENSusquehanna International Group (SIG) interview questions
All Kotak Mahindra Bank interview questionsSee Kotak Mahindra Bank hiring insights
Saved
class Solution {
    public boolean isPalindrome(int x) {
        // Write your code here.
    }
}
Checking account…