Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started
Palindrome Checker
00:00
5 left

Palindrome Checker

EasyPython

Problem

As part of automated validation for ASM Technologies test inputs, determine whether a given string is a palindrome. A palindrome reads the same from left to right and right to left.

Implement a function that compares characters exactly. Matching is case-sensitive, and spaces, punctuation, and other characters must be treated as part of the string.

Formal Specification

Given a string text, return a Boolean value:

  • Return True if text is a palindrome.
  • Return False otherwise.

Constraints

  • 0 <= len(text) <= 10^5
  • text contains printable ASCII characters
  • Comparison is case-sensitive
  • Spaces and punctuation are treated as ordinary characters

Function Signature

def is_palindrome(text):
Interviewer

Your question is Palindrome Checker. 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.