Next Palindrome Number
Updated
Problem statement
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) → StringExamples
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.numbercontains only decimal digits and has no leading zero unless it is0.
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