Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started
Palindrome Without Built-ins
00:00
5 left

Palindrome Without Built-ins

EasyPython

Problem

Kumaran Systems support utilities may need to validate identifiers that must read the same from left to right and right to left. Write a function that determines whether a given string is a palindrome without using a built-in palindrome function or reversing the string.

Formal Specification

Implement is_palindrome(text), where text is a string. Return True if the characters appear in the same order from both directions, and return False otherwise. Treat uppercase and lowercase letters as different characters, and consider spaces and punctuation as ordinary characters.

Constraints

  • 0 <= len(text) <= 10^5
  • text contains printable ASCII characters
  • Uppercase and lowercase characters are treated as different
  • Spaces and punctuation are treated as ordinary characters

Function Signature

def is_palindrome(text):
Interviewer

Your question is Palindrome Without Built-ins. Start with the requirements in the Question tab.

Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.

You need to log in / sign up to run or submit.
CodePython 3
You need to log in / sign up to run or submit.Ln 2
Run your code to see test output here.