Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Palindrome Checker

EasyPython00:00
Practice interviewer
In session
5 left
00:00

Your question is Palindrome Checker. Start with the requirements on the right.

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.

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):
Your solutionPython 3
You need to log in / sign up to run or submit.
Run your code to see test output