FastPrepPalindrome Word
Problems/Palindrome Word

Palindrome Word

Epic logoEpic● MediumOA

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

A palindrome reads the same forwards and backwards. For example, "azbza" is a palindrome, and it has the palindrome "zbz" nested inside it.

You are given a string s. Return every palindromic substring of s that has at least 3 characters.

  • Comparisons are case-sensitive: "a" and "A" are different.
  • Order the results by increasing start index. When several palindromes start at the same index, list the longer one first.
  • Keep duplicates: the same text found at different positions appears once for each position.
  • If there are none, return an empty list.

For example, for "aCacfzFccFzq" the answer is ["aCa", "zFccFz", "FccF"]. "Cac", "fzF" and "cfzFc" are not included because of case sensitivity.

Function

printAllPalindromes(s: String) → String[]

Examples

Example 1

s = "aCacfzFccFzq"return = ["aCa", "zFccFz", "FccF"]

The function returns all palindromes of 3 or more characters in length contained in "aCacfzFccFzq". The matching case-sensitive substrings are "aCa", "zFccFz", and the nested palindrome "FccF".

Constraints

  • 1 ≤ s.length ≤ 100
  • s contains only English letters (a to z and A to Z).

More Epic interview questions

  • Character Frequencies in First-Appearance OrderOA · Seen Sep 2026
  • First Completed Mingo LineOA · Seen Sep 2026
  • Minimum Adjacent TranspositionsOA · Seen Sep 2026
  • Telephone Keypad String EncodingOA · Seen Sep 2026

Similar questions at other companies

  • String CompressionAbridge · OAAbridge interview questions
  • K Smallest SubstringAkuna Capital · OAAkuna Capital interview questions
  • Format TextTikTok · OATikTok interview questions
  • Next Greater Element IIIThe Walt Disney Company · OAThe Walt Disney Company interview questions
  • Counting Binary Substrings (Backend)Canva · OACanva interview questions
  • Shortest SubstringRippling · OARippling interview questions
  • Minimum Swaps to Make PalindromeAmazon · OA
  • Longest Subsequence That Is a SubstringExpedia · OAExpedia interview questions
  • String Search (Also for Core/Database Engineering)Snowflake · OASnowflake interview questions
  • Count SubstringsSalesforce · OASalesforce interview questions
All Epic interview questionsSee Epic hiring insights
Saved
class Solution {
    public String[] printAllPalindromes(String s) {
      // write your code here
    }

}
Checking account…