FastPrepValid Palindrome
Problems/Valid Palindrome

Valid Palindrome

Meta logoMeta● EasyFULLTIMEONSITE INTERVIEW

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in a Meta onsite interview. The report names the well-known palindrome check that ignores case and non-alphanumeric characters. Our version is about 100% the same as the linked reference.

Given a string s, ignore every character other than ASCII letters and digits, and compare letters without regard to case.

Return true if the remaining characters read identically from left to right and right to left. Otherwise, return false. A string with no remaining characters is a palindrome.

Function

isPalindrome(s: String) → boolean

Examples

Example 1

s = "A man, a plan, a canal: Panama"return = true

Ignoring spaces, punctuation and case leaves amanaplanacanalpanama, which reads the same in both directions.

Example 2

s = "race a car"return = false

The retained string is raceacar; its fourth character from the left is e, while its fourth character from the right is a.

Example 3

s = " "return = true

Removing the space leaves no characters, so the result is true.

Example 4

s = "0P"return = false

Digits are retained. After lowercasing, 0p is not a palindrome.

Constraints

  • 1 <= s.length <= 2 * 10^5.
  • s contains only printable ASCII characters.

More Meta Onsite Interview questions

  • Multi-Head Attention Forward PassPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Run-Length Encoded Vector Dot ProductPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Mutual-Friend RecommendationsPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Deterministic K-Means AssignmentsPHONE SCREEN · ONSITE INTERVIEW · Seen Sep 2026
  • Linear Layer Forward and Backward PassesONSITE INTERVIEW · Seen Sep 2026
  • Reservoir Sampling with Recorded DrawsONSITE INTERVIEW · Seen Sep 2026
  • Stochastic Gradient Descent with MomentumONSITE INTERVIEW · Seen Sep 2026
  • Top K Largest Values with a HeapONSITE INTERVIEW · Seen Sep 2026
  • Partition a Card Deck into FifteensONSITE INTERVIEW · Seen Sep 2026
  • Insert into a Sorted Circular ListONSITE INTERVIEW · Seen Aug 2026

Similar questions at other companies

  • String CompressionShnoor International · ONSITE INTERVIEW
  • Longest Spoken PrefixElevenLabs · ONSITE INTERVIEWElevenLabs interview questions
  • Palindrome Check Ignoring SymbolsWalmart · ONSITE INTERVIEWWalmart interview questions
  • Reverse a String Keeping Dashes in PlaceNykaa · ONSITE INTERVIEWNykaa interview questions
  • Reverse Vowels of a StringGoogle · ONSITE INTERVIEWGoogle interview questions
  • Valid Palindrome After NormalizationKotak Mahindra Bank · ONSITE INTERVIEWKotak Mahindra Bank interview questions
  • Count Binary SubstringsDocuSign · ONSITE INTERVIEWDocuSign interview questions
  • Minimum Changes for Palindromic BlocksCitadel · OA · PHONE SCREEN · ONSITE INTERVIEWCitadel interview questions
  • Palindrome Match PercentageApple · ONSITE INTERVIEWApple interview questions
  • Reverse A StringNVIDIA · ONSITE INTERVIEWNVIDIA interview questions

Meta interview experiences

  • Meta PhD SWE Intern AI Coding Phone Screen: 1 Experience
  • Meta Business Support Engineer Phone Screen: 1 Experience
  • Meta Software Engineer Onsite Questions: 3 Experiences
  • Meta AI Native Engineer OA and Onsite: 1 Experience
  • Meta AI-Native Coding Interview: 3 Experiences
  • Meta Production Engineer Intern Questions: 6 Experiences
All Meta interview questionsSee Meta hiring insights
Saved
class Solution {
    public boolean isPalindrome(String s) {
        // Write your code here.
    }
}
Checking account…