Check a Voice Query Transcript Is a Palindrome Ignoring Punctuation

Last updated: November 29, 2026

Quick Overview

Given a transcript string from Google Assistant, decide whether it reads the same forwards and backwards when you ignore case and every character that is not a letter or digit.

Google
Coding & Algorithms
Frontend Engineer
Google
November 29, 2026
Frontend Engineer
Phone Screen
Coding & Algorithms
Easy

0

0

0 solved


Given a transcript string from Google Assistant, decide whether it reads the same forwards and backwards when you ignore case and every character that is not a letter or digit.

A short warm-up in the style of a Google phone screen, often used to see how cleanly a candidate writes index logic before a harder second question. The interviewer checks for an O(1) space two-pointer scan rather than building a filtered copy, and careful skipping of punctuation.

What the Interviewer Expects
  • Uses inward-moving pointers from both ends
  • Skips non-alphanumeric characters without building a new string
  • Compares case-insensitively
  • Avoids off-by-one errors when pointers cross
  • Mentions Unicode considerations
Key Topics to Cover
Two Pointers
Strings
Character Classes
In-Place Scan
How to Approach This
  1. Clarify input constraints and edge cases before writing code.
  2. Walk through your approach verbally and confirm with the interviewer before coding.
  3. Start with a brute force solution, then optimize. Mention time and space complexity.
  4. Test your solution with examples, including edge cases like empty input or duplicates.
  5. Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
  • Can you return true if the string becomes a palindrome after deleting at most one character?
  • How would you handle accented characters or non-Latin scripts?
  • What changes if the input is a stream you can only read once?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice DSA Problems
Sample Answer
Requirements
  • Input: a string s, possibly with spaces, punctuation and mixed case.
  • Ignore every character for which isalnum() is false.
  • Compare letters case-insensitively.
  • An empty string, or one with n...
High-Level Design

Place lo at the start and hi at the end. Move lo right past any ignored character and hi left past any ignored character. When both point to real characters, compare their lowercase forms; a m...


Submit Your Answer
Markdown supported