FastPrepNext Palindrome Number
Problems/Next Palindrome Number

Next Palindrome Number

Benchling logoBenchling● MediumFULLTIMEPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in a Benchling full-time phone screen. We follow the exercise in the report. The report leaves out some input limits and some interface details. We chose those. Our version is about 95% the same as the reported question.

Given a nonnegative decimal integer as number without leading zeroes, return the smallest palindromic integer that is strictly larger, also as a string.

Function

nextPalindrome(number: String) → String

Examples

Example 1

number = "100"return = "101"

101 is the first larger palindrome.

Example 2

number = "999"return = "1001"

All digits carry into a longer palindrome.

Constraints

  • 1 <= number.length <= 100000.
  • number contains only decimal digits and has no leading zero unless it is 0.

More Benchling interview questions

  • Bounded HTTP Retry FlowPHONE SCREEN · Seen Nov 2025
  • Future-Aware Cache EvictionPHONE SCREEN · Seen Aug 2025
  • Generate All Contiguous Protein ChainsPHONE SCREEN · Seen Jul 2024
  • Eight-Direction Keyboard Typing TimePHONE SCREEN · Seen Apr 2022
  • Generate Proteins from Contiguous Named SequencesPHONE SCREEN · Seen Aug 2021
  • Apply Overlapping HTML Formatting RangesPHONE SCREEN · Seen Feb 2019
  • Validate Nested JSON Against a SchemaONSITE INTERVIEW · Seen Dec 2025
  • Degenerate DNA Substring SearchONSITE INTERVIEW · Seen Jun 2024
  • Longest Substring Without Repeating CharactersONSITE INTERVIEW · Seen Jul 2021
  • 2048 Move SimulatorOA · Seen Feb 2019

Similar questions at other companies

  • Add Signed Character ArraysByteDance · PHONE SCREENByteDance interview questions
  • Transform L/R Pieces on a Circular BoardGoogle · PHONE SCREEN · ONSITE INTERVIEWGoogle interview questions
  • Palindrome Match PercentageApple · ONSITE INTERVIEWApple interview questions
  • Evaluate an Arithmetic Expression Written in WordsBrex · PHONE SCREEN
  • Longest Palindromic SubstringSiemens · PHONE SCREEN
  • Integer to English Words in USD and INR StylesVeeam · PHONE SCREEN
  • Reverse Words in a StringAgoda · PHONE SCREENAgoda interview questions
  • Longest Palindromic SubstringIBM · PHONE SCREENIBM interview questions
  • Reorderable Task Scheduler With CooldownWaymo · PHONE SCREENWaymo interview questions
  • Find All Pythagorean TripletsDell Technologies · PHONE SCREENDell Technologies interview questions
All Benchling interview questionsSee Benchling hiring insights
Saved
class Solution {
    public String nextPalindrome(String number) {
        // Write your code here.
    }
}
Checking account…