FastPrepPartition into Equal-Sum Subsets
Problems/Partition into Equal-Sum Subsets

Partition into Equal-Sum Subsets

Expedia logoExpedia● MediumNEW GRADINTERNONSITE INTERVIEW

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: One report says the first round asked for the partition equal subset sum task. Another says its first round asked to split into two subarrays of equal value, as a 01 knapsack. A third report recalls a task called Partition Sub Sums and also mentions a linked list.

The reports do not give the input format or limits. Here, you get an array of nonnegative values and return whether it can split into two subsets with equal sums. We read subarrays as subsets, because 01 knapsack picks any elements. Either subset may be empty, so empty input and [0] return true.

Our version is about 90% the same as the reported question.

Decide whether all entries of values can be split into two disjoint subsets with equal sums. Each input position belongs to exactly one subset. Either subset may be empty.

Return a boolean. Values are nonnegative; repeated values at different positions remain separate choices. Empty input can be split into two empty subsets and returns true.

Function

equalPartition(values: int[]) → boolean

Examples

Example 1

values = [1,5,11,5]return = true

One subset is [11], and the other is [1,5,5]; both sum to 11.

Example 2

values = [1,2,3,5]return = false

The total 11 is odd, so two equal integer sums are impossible.

Constraints

  • 0 <= values.length <= 200.
  • 0 <= values[i] <= 100.

More Expedia Onsite Interview questions

  • Scramble StringONSITE INTERVIEW · Seen Sep 2026
  • Smallest Sufficient TeamONSITE INTERVIEW · Seen Sep 2026
  • Check Anagram Pairs Index by IndexONSITE INTERVIEW · Seen Oct 2025
  • Fresh Oranges Left After Rotting StopsONSITE INTERVIEW · Seen Oct 2025
  • Longest Increasing SubsequenceONSITE INTERVIEW · Seen Oct 2025
  • Lowest Common Ancestor with Repeated and Missing ValuesONSITE INTERVIEW · Seen Oct 2025
  • Shortest Substring with Exactly K OnesONSITE INTERVIEW · Seen Oct 2025
  • Middle Element of a Linked ListONSITE INTERVIEW · Seen Nov 2024
  • Minimum in a Rotated Sorted ArrayONSITE INTERVIEW · Seen Sep 2024
  • Mirror Image Binary TreesONSITE INTERVIEW · Seen Sep 2024

Similar questions at other companies

  • Count Subsets With a Target SumSafe Security · ONSITE INTERVIEW
  • 0/1 Knapsack with Weight and Volume LimitsGoogle · ONSITE INTERVIEWGoogle interview questions
  • Maximum Subarray Sum with One DeletionOracle · ONSITE INTERVIEWOracle interview questions
  • Best Time to Buy and Sell Stock IIKotak Mahindra Bank · ONSITE INTERVIEWKotak Mahindra Bank interview questions
  • Coin ChangeMicrosoft · ONSITE INTERVIEWMicrosoft interview questions
  • Word BreakAmazon · PHONE SCREEN · ONSITE INTERVIEW
  • Maximum SubarrayUpstart · ONSITE INTERVIEWUpstart interview questions
  • Maximum Product SubarrayHartford Financial Services · ONSITE INTERVIEWHartford Financial Services interview questions
  • Word BreakMoveworks · ONSITE INTERVIEWMoveworks interview questions
  • Maximum Value from Circular HousesDigitalOcean · ONSITE INTERVIEWDigitalOcean interview questions

Interview reports that mention this question

  • Expedia Intern Final Round in 2023: 17 Experiences (Part 2 of 6)
  • Expedia New Grad SDE Interviews: 20 Experiences (Part 1 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 boolean equalPartition(int[] values) {
        // Write your code here.
    }

}
Checking account…