Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Palindrome Function Practice

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

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

EcoStruxure monitoring interfaces may display short labels that need consistent validation. Write a function that determines whether a given word is a palindrome, meaning it reads the same forward and backward when letter case is ignored.

Formal Specification

Implement is_palindrome(word), where word is a non-empty string containing only English alphabetic characters. Return True if the word is a palindrome, and False otherwise. Do not create a reversed copy of the string unless you use it in an alternative solution.

Constraints

  • 1 <= len(word) <= 100,000
  • word contains only English alphabetic characters
  • Letter case must be ignored
  • Return either True or False

Function Signature

def is_palindrome(word):
Your solutionPython 3
You need to log in / sign up to run or submit.
Run your code to see test output