Study
Which Palindrome and Anagram Questions Does Each Company Ask?
TrueInterview
October 26, 2026 · 17 min read

As of 2026-10-26, TrueInterview's bank holds 29 candidate-reported palindrome and anagram questions from 12 big-tech companies, and all 29 were last reported in the 12 months before that date. The companies differ mainly in which variant their candidates report: Meta's dated example is Valid Palindrome II, Microsoft's is Find the Closest Palindrome, Databricks' is Anagrammed indexOf and ByteDance's is Longest Palindromic Substring, all from phone screens. Prepare the family by its twist rather than by the base problem, and pick the twist from your target company's reported set.
Disclosure: TrueInterview is an interview-preparation product and publishes this article. Facts about other products come from their public pages on the dates listed under Sources.
Are palindrome and anagram questions still asked at big tech?
Yes, and mostly early in the loop. Of these questions, 16 have a phone-screen report, 10 an onsite report and 7 an online-assessment report, since one question can be reported in more than one round. Among the 16 phone-screen questions, the most frequent tags are strings (8), hashing (6), sliding window (5) and dynamic programming (3).

That mix tells you what the first screen rewards: a frequency count and a fixed-size window, written quickly and without bugs. Dynamic programming is the least common of those tags, so a week spent on palindromic DP tables before you can write a sliding-window count is a week spent in the wrong order.
Across all 29 questions, the tags are strings (16), hashing (12), two pointers (6), sliding window (6) and dynamic programming (4), with math, trees, graphs, bit manipulation, greedy, sorting and linked lists on one or two questions each. A question can carry several tags, so the tag counts do not add up to the question count. These are candidate-reported questions reconstructed for practice, and they are not any company's official question list.
Our take: the generic advice files palindromes under string basics and moves on. The bank points the other way for experienced candidates. The reported questions are short to state and easy to get subtly wrong, and the phone screen is where they are reported most, so they deserve deliberate practice on edge cases rather than a skim.
How do Amazon, Microsoft, Uber, Apple and others differ?
Amazon and Microsoft each have 6 palindrome and anagram questions in the bank, Uber has 5, Apple and ByteDance have 4, and Google, Meta, Databricks, Salesforce and Oracle have 3 each. With samples this small, read the differences as which variant each company's candidates report and which tags dominate, not as a ranking of difficulty.
| Company | Tags on its palindrome and anagram questions | A reported example (round, last reported) |
|---|---|---|
| Amazon | hashing 4, strings 2, two pointers 2, sliding window 1 | Group Anagrams (LC 49), onsite, 2026-10 |
| Microsoft | strings 5, two pointers 2, hashing 1, sliding window 1, DP 1 | Find the Closest Palindrome, phone screen, 2026-03 |
| Uber | strings 3, hashing 2, DP 1 | Group Anagrams, phone screen, 2026-08 |
| Apple | two pointers 2, hashing 1, DP 1, no strings tag | Valid Palindrome, phone screen, 2026-09 |
| ByteDance | strings 4, hashing 2, sliding window 1 | Longest Palindromic Substring, phone screen, 2026-08 |
| strings 1, hashing 1, two pointers 1, sliding window 1 | Count Paths That Can Form a Palindrome in a Tree, filed under Uber and Google in the OA and onsite rounds | |
| Meta | not split in the data | Valid Palindrome II, phone screen, 2026-08 |
| Databricks | not split in the data | Anagrammed indexOf, phone screen, 2026-08 |
| Salesforce | not split in the data | String Anagram Windows, phone screen, 2026-09 |
| Snowflake | not split in the data | Find All Anagrams in a String, phone screen, 2026-09 |
| DoorDash | not split in the data | Code Craft: Similar Restaurant Names (K-Swap Anagram), phone screen, 2026-03 |
Tags are labels on individual questions, not a summary of their content. Apple's set has no strings tag, yet Valid Palindrome, a string problem, is its dated example, so do not conclude that Apple skips string work. Oracle has 3 questions in the bank but no dated example in this data, so prepare it from the shared core below.
A verdict per company, as our view:
- Meta: own Valid Palindrome II before anything else. It leads the write-up links, every one of them from Meta, and it is a one-deletion twist on a base problem.
- Microsoft: strings dominate the tags, and its dated example is the edge-case problem of the family. Spend your extra hours on Find the Closest Palindrome.
- Amazon: hashing leads the tags. Group Anagrams for the onsite is the first drill, then the base palindrome check.
- Uber: expect breadth. Group Anagrams is the dated phone-screen example, Uber write-ups also link Find the Closest Palindrome, and the tree-path palindrome question is filed under Uber.
- Apple and Google: start with Valid Palindrome, and at Google add the tree-path question.
- ByteDance: Longest Palindromic Substring is the dated example, so prepare center expansion until it is automatic.
- Databricks, Snowflake and Salesforce: their dated examples are anagram searches over a string. By their titles, Anagrammed indexOf, Find All Anagrams in a String and String Anagram Windows all look like fixed-window anagram searches, so the sliding count is the likely starting point; check each statement.
Which questions are linked from the most write-ups?
Valid Palindrome II at Meta and Group Anagrams across Databricks, Uber and Meta lead the write-up links, and four titles follow with three links each. A link count is the number of candidate write-ups that point to a question, not a count of interviews or of how often a company asks it. The table ranks the titles and adds the level split where the data has one.
| Question | Companies in the linked write-ups | Write-up links | Senior-or-above vs junior-or-below links | Practise |
|---|---|---|---|---|
| Valid Palindrome II | Meta | 6 | 5 vs 1 | Valid Palindrome II |
| Group Anagrams | Databricks, Uber, Meta | 5 | 4 vs 1 | Group Anagrams |
| Find the Closest Palindrome | Microsoft, Uber | 3 | 3 senior-or-above | Find the Closest Palindrome |
| Longest Palindromic Substring | ByteDance | 3 | 2 vs 1 | Longest Palindromic Substring |
| Count Paths That Can Form a Palindrome in a Tree | Uber | 3 | 0 senior-or-above | Count Paths in a Tree |
| Anagrammed indexOf | Databricks | 3 | not split in the data | Anagrammed indexOf |
| Find All Anagrams in a String | Salesforce, Microsoft | 2 | 2 senior-or-above | Find All Anagrams in a String |
| Code Craft: Similar Restaurant Names (K-Swap Anagram) | DoorDash | 2 | not split in the data | Similar Restaurant Names |
Where a question is filed is a different measure from who links it. The bank files Group Anagrams under 5 big-tech companies (Uber, Amazon, Apple, Databricks and Meta) and Valid Palindrome under 4 (Apple, Amazon, Google and Meta). Those two are the classics you are most likely to meet at a company you have not researched, so solve each once before you specialise.
What each leading title asks, and the move that cracks it:
- Valid Palindrome II lets you delete at most one character. Walk two pointers inward, and at the first mismatch test the two substrings that skip the left or the right character, then stop. The common bug is recursing past the single allowed deletion.
- Group Anagrams groups words that share the same letters. Key each word by a letter-count signature, store the groups in a dictionary of lists, and say why you chose that key over sorting.
- Count Paths That Can Form a Palindrome in a Tree is tagged bit manipulation, bitmask, DFS, hashmap, palindromes and tree in TrueInterview's catalog. Carry a parity mask from the root, and count pairs of nodes whose masks are equal or differ by one bit.
- Anagrammed indexOf reads, by its title, as an indexOf-style search for an anagram of a pattern, which is the same fixed window as Find All Anagrams in a String. Confirm the exact contract on its practice page before you plan.
Find the Closest Palindrome and Longest Palindromic Substring each get their own section below, because they are the two problems where the first idea is not the finished answer.
What changes at senior and staff level?
This is not a junior-only family. Write-ups from candidates who reported a senior, staff-plus or manager level link these questions 26 times, and write-ups from junior, new-grad or intern candidates link them 23 times. Among the palindrome titles, the senior links sit on the variant: base Valid Palindrome is linked from 1 write-up with no senior-or-above links, while Valid Palindrome II has 5 of its 6.
Group Anagrams is the exception among base problems, with most of its links from senior-or-above candidates, so expect it at any level. Below the top of the ranked table, the variants again carry the senior links. Find All Anagrams in a String is linked from 2 write-ups, both senior-or-above, and Palindrome Number + Next-Greater Palindrome and String Anagram Windows each have 2 senior-or-above links. Group Anagrams (LC 49), a separate entry from Group Anagrams, has 2 senior-or-above links of its own. The exception is the Uber tree-path question, which has no senior-or-above links, so do not treat it as a senior filter.
By tag, senior-or-above write-ups lead on strings (19 vs 14), two pointers (6 vs 4) and sliding window (5 vs 4), while hashing tilts junior (10 vs 13). The margins are small and sit close to the overall split above, so read the tags as a weak signal, not a finding. Our view is that a count map alone is the starting point at senior level, and that you should be ready to add a pointer walk, a window or a constraint on top of it. Levels are what candidates reported on their own write-ups, and the data has no staff-specific breakdown.
Our take: at senior and staff level, expect the interviewer to move to the follow-up within minutes and to judge how cleanly you handle ties, empty input, case rules and boundaries. Knowing the base trick earns little. State your edge cases before you code, name the trade-off you are making (sorted key or count key, center expansion or Manacher), and test the boundary cases without being asked.
Down-leveling note (our view): in our view, the bigger risk in a palindrome or anagram round is stalling on the follow-up, not missing the opener. Solving the base problem fast and then stalling on the one-deletion or closest-value follow-up is the weaker showing for a senior candidate, and the other rounds of the loop then have more to make up, so rehearse the follow-up first.
Why are anagram questions really counting questions?
Two strings are anagrams when their character counts match, so every anagram question is a counting question with a twist on what you count and where. Skilled.dev's guide notes that "interviews often use the terms anagram and permutation interchangeably" and that an anagram question may not require the words to have meaning. Treat any reordering of the same letters as valid unless told otherwise.
Python's documentation describes Counter as "a dict subclass for counting hashable objects" that stores elements as keys and counts as values. The same documentation says Counter returns a zero for missing items instead of raising a KeyError, which removes a class of bugs from window updates. In other languages, a fixed array indexed by letter does the same job with less overhead.
For the signature in Group Anagrams, pick the count key. A sorted-letters key is shorter to write and fine for short words, but it sorts every word, while a count tuple is built in one pass over a fixed alphabet. In our view, that choice is a likely follow-up at senior level, so say the trade aloud before anyone asks.
For Find All Anagrams in a String, and for String Anagram Windows if its statement is the same fixed-window search, keep a window the length of the pattern. Add the incoming character, remove the outgoing one, and track how many letters currently match instead of comparing two full count arrays at every step. That update is the core of every window question in the table, so write it until you can do it without a reference.
The company twists build on the same count. Databricks' Anagrammed indexOf, DoorDash's Similar Restaurant Names (K-Swap Anagram) and Minimum Replacements to Make Two Strings Anagrams, which the bank files under 2 big-tech companies with 1 linked write-up. By their titles, each starts from a count or a count difference, though a K-swap problem may turn on swap distance rather than counts, so read each statement for the twist before you plan.
How do you check a palindrome, or whether a string can become one?
A palindrome reads the same forward and backward, and Skilled.dev's example "Never odd or even" shows the common rule of ignoring whitespace and case. For Valid Palindrome, the dated Apple example, walk two pointers inward, skip characters that are not letters or digits, and compare lowercased characters. Clarify the character rule before you write a line.
The rearrangement version asks whether a string's characters can be reordered into a palindrome. GeeksforGeeks gives the test: "A set of characters can form a palindrome if at most one character occurs an odd number of times". Its guide labels the frequency-count approach O(n) time and O(1) space, and a bitmask approach the same.
The bitmask version is worth learning even though the count is enough for the string problem. GeeksforGeeks explains that with 26 lowercase letters the bits of one integer can track odd frequencies, toggling each character's bit with XOR. The string can form a palindrome if the final mask has at most one bit set, according to the same guide.
Our take: learn the bitmask because it transfers. The tree-path question filed under Uber and Google is that exact parity mask carried down a tree, with a hash map counting the masks seen so far, so one idea covers both a phone-screen check and an OA or onsite tree problem.
How much of Longest Palindromic Substring do you need?
Our view: center expansion with separate odd and even centers is enough for most interviews of this title, and Manacher's algorithm is a follow-up you should be able to describe rather than code. The dated example is a ByteDance phone screen, a round where a clean quadratic solution plus a spoken outline of the linear one fits the time.
Wikipedia's article defines the problem as finding a maximum-length contiguous palindromic substring, so for "bananas" the answer is "anana". Wikipedia's article also notes the answer is not guaranteed to be unique, and that the problem is different from longest palindromic subsequence. Ask which answer to return on a tie, and confirm substring rather than subsequence before you start.
The cp-algorithms guide says the trivial approach "can calculate the answer only in" quadratic time, and that odd and even palindromes are tracked separately. Treat each index, and each gap between two indices, as a center and expand while the ends match. Keep the start and length of the best window rather than building substrings in the loop.
If the interviewer asks for better, explain Manacher's idea without coding it from memory. Wikipedia's article says it is faster because it exploits palindromes that occur inside other palindromes, and the cp-algorithms guide shows it is linear because the right boundary only moves forward. Two of the three write-up links for this title come from senior-or-above candidates, so that explanation is the senior part of the answer, not the code.
Worked example: Find the Closest Palindrome for a Microsoft phone screen
Take a senior engineer with a Microsoft phone screen. Microsoft has 6 palindrome and anagram questions in the bank, 5 of them tagged strings and 2 tagged two pointers. Its dated phone-screen example is Find the Closest Palindrome, and all of that title's write-up links come from senior-or-above candidates. This is the problem in the family where edge handling decides the result.
In the standard statement as PracHub's guide describes it, you exclude the input and return the smaller palindrome on a tie, for positive inputs of up to eighteen digits; confirm the reported version on the practice page before you rely on those limits. PracHub's guide warns that a method that always increments and mirrors "would incorrectly return 1001 for the closest objective even though it correctly solves the next-greater variant". PracHub's guide treats closest and strictly next-greater output as separate contracts. Name that trap before you code, because the bank also holds Palindrome Number + Next-Greater Palindrome, and the two are easy to blur.
The method from PracHub's guide, as steps:
- Mirror the left prefix and its immediate predecessor and successor, then add the shorter all-nines boundary and the longer one-zeroes-one boundary, as PracHub's guide describes.
- For an odd-length input, PracHub's guide says the middle digit must not be duplicated when you mirror.
- The guide also notes the input may already be a palindrome, so remove its value after collecting candidates.
- Compare by absolute distance and then by numeric value, as PracHub's guide describes. Its guide adds that relying on set or insertion order makes the tie behaviour accidental.
Test two inputs before you call it done: one that is already a palindrome and one with an odd length. If your language has fixed-width integers, compute the boundary candidates in a wider type so the longer boundary cannot overflow.
For a second drill, take Find All Anagrams in a String. The bank files it under Snowflake, ByteDance, Microsoft and Salesforce, and its write-up links come only from senior-or-above candidates. It tests the window count from the anagram section, which is the other half of a Microsoft string set.
Which question should you practise first for your company?
Start from your next round and your target company. If the next round is a phone screen, practise strings, hashing and sliding windows first, since that is where these questions are reported most. Then open your company's reported variant from the table below and make it this week's first problem, before any generic palindrome drill.
| If your target is | Practise first | Then |
|---|---|---|
| Meta | Valid Palindrome II | the base Valid Palindrome, once |
| Microsoft | Find the Closest Palindrome | Find All Anagrams in a String |
| Uber | Group Anagrams | Find the Closest Palindrome, then Count Paths in a Tree |
| Amazon | Amazon's Group Anagrams entry for the onsite | Valid Palindrome |
| Databricks | Anagrammed indexOf | Group Anagrams |
| ByteDance | Longest Palindromic Substring | Find All Anagrams in a String |
| Snowflake or Salesforce | Find All Anagrams in a String | String Anagram Windows |
| DoorDash | Similar Restaurant Names (K-Swap Anagram) | Group Anagrams |
| Apple or Google | Valid Palindrome | the tree-path question at Google |
| Oracle, or no dated example | the counting core: Group Anagrams and Find All Anagrams in a String | Minimum Replacements to Make Two Strings Anagrams |
If you are senior or above, solve each base problem once and move straight to its variant. One allowed deletion, closest rather than next-greater, and every window position rather than one pair are the follow-ups the senior-linked titles carry.
How we counted
TrueInterview says each report is checked against other reports of the same round and stamped with the month it was asked wherever the report gave one. Counts here cover palindrome and anagram coding questions filed under big-tech companies; a question can be filed under several companies and reported in several rounds, so company and round tallies overlap. Write-up links count candidate write-ups that point to a question, split by the level each candidate reported, and they measure what candidates wrote about, not how often a company asks.
FAQ
What is the difference between an anagram, a permutation and a palindrome?
Skilled.dev's guide defines a permutation as a different ordering of a string's characters, and says "All anagrams are permutations of each other, but not all permutations are anagrams". Skilled.dev's example pair is silent and listen. A palindrome is a different property: the string reads the same in both directions. In interviews the first two collapse into one test, matching character counts, while the palindrome check compares the string against its own reverse, or checks how many characters have odd counts if reordering is allowed.
What string coding questions come up most in interviews?
Skilled.dev's guide says string interview questions very commonly test "palindromes, permutations, and anagrams". Within that family, the ranked table above shows which titles candidates at big tech link most, led by Valid Palindrome II and Group Anagrams. For a working engineer, that narrows the target: master the count, the two-pointer walk and the fixed window, then add the one variant your company's candidates reported, rather than working through a long generic list.
Can you give examples of palindromic numbers?
Wikipedia's article on palindromic numbers gives 16361 as an example and says zero is palindromic by definition in any base. The same article says every palindromic number with an even number of digits is divisible by 11, and that there are 90 palindromic numbers with three digits. These facts matter in the number variants, Palindrome Number + Next-Greater Palindrome and Find the Closest Palindrome, where you build candidates digit by digit and must handle single digits and digit-length changes.
Do companies publish their palindrome and anagram questions?
No. The questions in this article are candidate-reported and reconstructed for practice, as noted at the top, and no company has published them as its question list. TrueInterview says reports are "Written up right after the interview, then sorted by company and round". Treat every list, including this one, as evidence of what candidates saw, and check the month of the latest report before you build a plan around a single title.
Your practice plan
A three-week plan for someone working full time, about an hour on weekdays:
- Week one, the counting core. Solve Group Anagrams with a count key, then Find All Anagrams in a String with a sliding count that tracks matched letters.
- Week one, the palindrome checks. Solve Valid Palindrome once, then Valid Palindrome II under a phone-screen timer, and write the rearrangement check twice: with a count and with a bitmask.
- Week two, your company's variant. Open the decision table, write down your target's first problem, and solve it twice: once cold, once explaining edge cases aloud before coding.
- Week two, the closest-palindrome drill. Write Find the Closest Palindrome from scratch with the five-candidate set, input exclusion and the smaller-value tie-break, and test an input that is already a palindrome and an odd-length input.
- Week three, center expansion. Solve Longest Palindromic Substring with odd and even centers, then explain Manacher's idea in two minutes without code.
- Week three, one twist. Pick Anagrammed indexOf, String Anagram Windows or Count Paths That Can Form a Palindrome in a Tree, whichever matches your company. TrueInterview says coding is judged on hidden tests that show you the case you failed, so read the failed case before you retry.
Sources
- TrueInterview question bank — palindrome and anagram at big-tech companies — counted 2026-10-26
- Coding Interview Questions by Company · TrueInterview — checked 2026-10-26
- Palindromes, permutations, and anagrams explained | Skilled.dev — checked 2026-10-26
- collections — Container datatypes — Python 3.15.2 documentation — checked 2026-10-26
- Palindrome Permutation or Anagram - GeeksforGeeks — checked 2026-10-26
- Longest palindromic substring - Wikipedia — checked 2026-10-26
- Manacher's Algorithm - Finding all sub-palindromes in O(N) - Algorithms for Competitive Programming — checked 2026-10-26
- Find the Closest Palindrome: Mirror Prefixes and Handle Digit-Length Boundaries | PracHub Knowledge Hub — checked 2026-10-26
- Interview prep compared: your application, end to end · TrueInterview — checked 2026-10-26
- Palindromic number - Wikipedia — checked 2026-10-26
- Real FAANG Interview Questions by Company · TrueInterview — checked 2026-10-26
Last reviewed: 2026-10-26.