Exact Palindrome Check
Updated
Problem statement
A string is a palindrome when reading it backward gives the same string. Given a string s, return true if it is a palindrome and false if it is not.
Take every character as it is:
'K'and'k'are different characters.- Nothing is skipped: a space must line up with a space, and a digit with the same digit.
Function
isExactPalindrome(s: String) → booleanExamples
Example 1
s = "dog god"return = trueBackward, "dog god" is again "dog god". The space sits in the middle, so it matches itself. The answer is true.
Example 2
s = "Kayak"return = falseThe first character is an uppercase K and the last one is a lowercase k. Case counts, so they are different and the answer is false.
Example 3
s = "top spot"return = falseBackward, the string reads "tops pot". The space is in a different place, so the answer is false.
Constraints
1 <= s.length <= 10^4scontains only English letters (uppercase or lowercase), digits and spaces.
More DocuSign Onsite Interview questions
- Count Binary SubstringsONSITE INTERVIEW · Seen Sep 2026
- Two Positions That Add Up to a TargetPHONE SCREEN · ONSITE INTERVIEW · Seen Sep 2026
- Compress Consecutive Integer RangesONSITE INTERVIEW · Seen Aug 2026
- JSON Schema Object ValidatorONSITE INTERVIEW · Seen Aug 2026
- Most Transactions Kept Without Going NegativeONSITE INTERVIEW · Seen May 2025
- Three-Part Splits With a Light MiddleONSITE INTERVIEW · Seen May 2025
- Combine Two Sorted Lists Into OneONSITE INTERVIEW · Seen Apr 2022
- Paired Words That Share a SubstringONSITE INTERVIEW · Seen Apr 2022
- Reverse the Characters of a TextPHONE SCREEN · ONSITE INTERVIEW · Seen Apr 2022
- Reverse the Order of a Linked ListONSITE INTERVIEW · Seen Feb 2020
Similar questions at other companies
- Check if a String Is a PalindromeCisco · PHONE SCREENCisco interview questions
- Halfway Course in a Single TrackCrunchyroll · PHONE SCREENCrunchyroll interview questions
- Longest Spoken PrefixElevenLabs · ONSITE INTERVIEWElevenLabs interview questions
- Reverse a StringAmazon · PHONE SCREEN
- Palindrome Check Ignoring SymbolsWalmart · ONSITE INTERVIEWWalmart interview questions
- Reverse a String Keeping Dashes in PlaceNykaa · ONSITE INTERVIEWNykaa interview questions
- Reverse a String ManuallyNewgen Software · PHONE SCREEN
- Reverse a String with Two PointersSnowflake · PHONE SCREENSnowflake interview questions
- Palindrome with One DeletionWhatNot · PHONE SCREENWhatNot interview questions
- Valid Word AbbreviationMeta · PHONE SCREENMeta interview questions