FastPrepAll Palindrome Partitions
Problems/All Palindrome Partitions

All Palindrome Partitions

Expedia logoExpedia● MediumNEW GRADINTERNOA

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: The source BaaB example and all three partitions are preserved. Case-sensitive comparison, lexicographic serialization and finite bounds complete the practice interface. Estimated match97%.

Split text into nonempty contiguous pieces so that every piece is a palindrome. Return every possible partition, preserving character order within each partition.

Comparison is case-sensitive. Return partitions in lexicographic order: compare corresponding piece strings using character order, with a proper prefix string first. If all compared pieces agree, the shorter list comes first.

Function

palindromePartitions(text: String) → String[][]

Examples

Example 1

text = "BaaB"return = [["B","a","a","B"],["B","aa","B"],["BaaB"]]

These are the three case-sensitive palindrome partitions.

Example 2

text = "aab"return = [["a","a","b"],["aa","b"]]

The two a characters can be separate pieces or the palindrome aa.

Constraints

  • 1 <= text.length <= 10.
  • text contains only uppercase or lowercase English letters.

More Expedia Online Assessment questions

  • Balanced NumbersOA · Seen Aug 2026
  • REST API: Discounted PriceOA · Seen Aug 2026
  • Maximum Team SizeOA · Seen Mar 2026
  • Per-Domain Request LimiterOA · Seen Oct 2025
  • Count Equal-Frequency SubsequencesOA · Seen Mar 2025
  • Count Increasing Stock PeriodsOA · Seen Mar 2025
  • Get Minimum StepsOA · Seen Oct 2024
  • Rank Songs by PopularityOA · Seen Oct 2024
  • Calculate the SumOA · Seen Oct 2024
  • Get Maximum EfficiencyOA · Seen Oct 2024

Similar questions at other companies

  • First Valid Word SegmentationAmazon · ONSITE INTERVIEW
  • Generate One-Two Strings with Sum NGoogle · PHONE SCREEN · ONSITE INTERVIEWGoogle interview questions
  • Palindrome PartitioningLondon Stock Exchange · PHONE SCREENLondon Stock Exchange interview questions
  • Word Break IIWex · PHONE SCREEN
  • Word Break IIInMobi · PHONE SCREENInMobi interview questions
  • Word Break IIBloomberg LP · PHONE SCREEN · ONSITE INTERVIEWBloomberg LP interview questions
  • Word Break II: All SentencesMicrosoft · PHONE SCREEN · ONSITE INTERVIEWMicrosoft interview questions
  • Longest Subsequence That Is a SubstringBooking.com · OA
  • Palindrome CounterGoldman Sachs · OAGoldman Sachs interview questions
  • Next Number with Disjoint DigitsElevenLabs · OAElevenLabs interview questions

Interview reports that mention this question

  • Expedia SWE Intern Final Round: 126 Experiences (Part 1 of 6)
  • Expedia New Grad SDE Earlier Loops: 5 Experiences (Part 2 of 3)

Expedia interview experiences

  • Expedia Intern Final Round in 2021: 28 Experiences (Part 4 of 6)
  • Expedia Intern Finals Before 2020: 14 Experiences (Part 6 of 6)
  • Expedia Intern Final Round in 2020: 24 Experiences (Part 5 of 6)
  • Expedia Intern Final Round in 2022: 15 Experiences (Part 3 of 6)
All Expedia interview questionsSee Expedia hiring insights
Saved
class Solution {
    public String[][] palindromePartitions(String text) {
        // Write your code here.
    }

}
Checking account…