# Is this a valid palindrome? | Aced

Aced (formerly Exponent) publishes a public search API over its indexed pages; the guide is at https://www.aced.io/agents/agent-access.

Source: https://www.aced.io/questions/4056/validate-palindrome-check
Source observed: 2026-11-04T22:21:40.776Z
Last checked: 2026-11-04T22:21:40.776+00:00
Indexed: 2026-11-06T19:14:11.943+00:00

---

# Is this a valid palindrome?

We provide interview-preparation questions, practice tools, interview experiences, and related courses through Aced (formerly Exponent). This coding question is rated **Easy** and concerns data structures and algorithms.

## Problem

Given a string `s`, return `true` if it is a palindrome and `false` otherwise. Treat `s` as a palindrome after:

1. Converting uppercase letters to lowercase.
2. Removing all non-alphanumeric characters.
3. Checking whether the resulting string reads identically forward and backward.

Implement a function named `isPalindrome`.

### Examples

- `s = "H123!@321h"` → `true`
- `s = "race a car"` → `false`

### Constraints

- `1 <= s.length <= 2 * 10^5`
- `s` can contain any printable ASCII characters.

The question includes two additional challenge sections, labeled **Challenge 1** and **Challenge 2**. The solution tab is available in the interface, and code execution includes editor, share, output, test-results, and console views. Sign up to run code: [Sign up to run code](https://www.aced.io/signup?src=lesson).

## Interview metadata

The rendered interface associates this question with **+612 interviews** and identifies the most recently reported asking period as **7 months ago**. It lists these roles:

- [Software Engineer](https://www.aced.io/questions?role=swe) — 7
- [Data Engineer](https://www.aced.io/questions?role=data-engineer) — 2
- [Machine Learning Engineer](https://www.aced.io/questions?role=ml-engineer)
- [Data Scientist](https://www.aced.io/questions?role=data-science)
- [QA Engineer](https://www.aced.io/questions?role=qa-engineer)

Listed companies include [Meta](https://www.aced.io/questions?company=meta-facebook) — 3, [Google](https://www.aced.io/questions?company=google), [Datadog](https://www.aced.io/questions?company=datadog), [Apple](https://www.aced.io/questions?company=apple), Walmart Labs, Oracle, Adobe, Goldman Sachs, TATA CONSULTANCY SERVICES, and Deutsche Bank. The question categories are Data Structures & Algorithms and Coding.

## Community and interview experiences

No community answers have been contributed yet. Four interview experiences are associated with this question:

- [Google · 7 months ago](https://www.aced.io/experiences/google-staff-machine-learning-engineer-interview-03c9c6) — A Machine Learning Engineer at Staff / L6 described a comforting interviewer and recommended preparing the evaluation portion, failover strategy, and model choices.
- [Datadog · 8 months ago](https://www.aced.io/experiences/datadog-software-engineer-intern-interview-7857ae) — A Software Engineer intern said it was important to slow down, articulate the thought process clearly, and use the STAR method.
- [Meta · 10 months ago](https://www.aced.io/experiences/meta-facebook-staff-software-engineer-interview-57171d) — A Software Engineer at Staff / L6 described recruiter screening, an online coding interview, and a four-round online loop consisting of two coding interviews, system design, and behavioral interviewing with an engineering manager.
- [Meta · a year ago](https://www.aced.io/experiences/meta-facebook-software-engineer-interview-907e36) — A Software Engineer at Mid Level / L4 described a referral, recruiter chat, CodeSignal, a live technical screen, an engineering-philosophy questionnaire, and an onsite covering DSA, system design, behavioral interviewing, and an AI-enabled coding round. The interviewee said Meta supplied a preparation PDF, portal videos, mock system-design resources, and an AI-round practice environment, and attributed the unsuccessful outcome to an unorganized response to an API-design-style chess problem in system design.

## Related questions

- [Check if a string is a K-Palindrome.](https://www.aced.io/questions/1175/check-k-palindrome-string)
- [Find the palindromes.](https://www.aced.io/questions/3218/find-palindromes)

## Related courses

![Machine Learning Engineer Interview Prep](https://images.ctfassets.net/x78yjrjc11pq/6UfkHxUyLQVfDHSfLNQtWa/1be1539a65b4f6f15201f5b573c0a578/ML_Engineer_Interview_Prep_Course.jpeg?w=800&h=800&fm=webp&q=75)

### [Machine Learning Engineer Interview Prep](https://www.aced.io/courses/ml-engineer)

We cover mock interviews, frameworks, senior-candidate advice, ML system design, core concepts, coding, behavioral interviews, and more for candidates targeting machine-learning roles at Meta, Google, Amazon, Apple, Microsoft, Nvidia, and other companies.

![Data Science Interview Prep](https://images.ctfassets.net/x78yjrjc11pq/3U4C5C0OkDR0UeGch4AmlE/7ad489430b676a088cb973307fe77884/Data_Science_Interview_Prep_Course.jpeg?w=800&h=800&fm=webp&q=75)

### [Data Science Interview Prep](https://www.aced.io/courses/data-science)

We cover statistics, experimentation, coding, SQL, machine learning, behavioral interviews, mock interviews, frameworks, and advice from senior candidates for data-science interviews at Google, Amazon, Microsoft, Meta, Apple, and other companies.

## Aced interview-preparation areas

We provide courses and resources for Product Management, Forward Deployed Engineering, Engineering Management, Software Engineering, System Design, Data Science, Machine Learning, and Data Engineering, along with AI Engineering, Investment Banking, Generative AI, Security Engineer, TPM, Solutions Architect, UX / Product Design, and BizOps & Strategy. We also provide question libraries, interview loops, practice, coaching, mock interviews, resume review, salary negotiation, job referrals, resources, and related programs.

[Browse all questions](https://www.aced.io/questions) · [Explore courses](https://www.aced.io/courses?src=nav) · [Pricing](https://www.aced.io/upgrade?src=nav) · [Log in](https://www.aced.io/login?src=nav) · [Sign up](https://www.aced.io/signup?src=nav)

---

[Read this page’s summary](https://www.aced.io/agents/api/public/v1/page-tldr?url=https%3A%2F%2Fwww.aced.io%2Fquestions%2F4056%2Fvalidate-palindrome-check&trace=t_679ff9ab98f3)

## Ask a follow-up about this page

Need a more specific answer? Ask the exact question you have. It returns a fresh, cited answer from Aced (formerly Exponent)’s knowledge base. No account or API key required.

Open this URL with your own question, URL-encoded. Include your question in q. All research inputs are optional; no account or setup.

`GET https://www.aced.io/agents/agent/faq?q={question}&trace=t_679ff9ab98f3`

[Tool guide and examples](https://www.aced.io/agents/agent-access) · [OpenAPI](https://www.aced.io/agents/api/public/v1/openapi.json) · [Page TLDR form](https://www.aced.io/agents/agent-tools/page-tldr?url=https%3A%2F%2Fwww.aced.io%2Fquestions%2F4056%2Fvalidate-palindrome-check). Opening a form does not execute a tool.