FastPrepLeftmost Equilibrium Index
Problems/Leftmost Equilibrium Index

Leftmost Equilibrium Index

Expedia logoExpedia● EasyNEW GRADINTERNONSITE INTERVIEW

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: We kept the report's rules: positions start at 0, the leftmost index wins, and there is a no-match answer. We chose the limits and what happens with an empty array. Our version is about 98% the same as the reported question.

Return the leftmost zero-based index whose sum of values strictly to its left equals the sum strictly to its right. The value at that index is excluded from both sums.

Return -1 if no index works, including for an empty array. Empty sides have sum zero. Use wide arithmetic for sums.

Function

equilibriumIndex(values: int[]) → int

Examples

Example 1

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

The left sum is 1 + 3 = 4, and the right sum is 2 + 2 = 4.

Example 2

values = [1,2,3]return = -1

No index has equal excluded-side sums.

Constraints

  • 0 <= values.length <= 100000.
  • -1000000000 <= values[i] <= 1000000000.

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

  • Roll a Weighted DieLinkedIn · ONSITE INTERVIEWLinkedIn interview questions
  • Advertisement Click Range SumsGoogle · ONSITE INTERVIEWGoogle interview questions
  • Calculate Server Shutdown PenaltyStripe · PHONE SCREEN · ONSITE INTERVIEWStripe interview questions
  • Find Pivot IndexMicrosoft · ONSITE INTERVIEWMicrosoft interview questions
  • Product of Array Except SelfWalmart Labs · ONSITE INTERVIEW
  • Subarrays Whose Sum Is a Power of TwoKotak Mahindra Bank · ONSITE INTERVIEWKotak Mahindra Bank interview questions
  • Maximize Compatible Car RidersUber Freight · PHONE SCREEN · ONSITE INTERVIEWUber Freight interview questions
  • Count Subarrays with Sum KMakeMyTrip.com · ONSITE INTERVIEWMakeMyTrip.com interview questions
  • Product Of Array Except SelfInfosys · ONSITE INTERVIEWInfosys interview questions
  • Maximum Subarray Sum with Length at Most KOracle · ONSITE INTERVIEWOracle interview questions

Interview reports that mention this question

  • Expedia Intern Final Round in 2021: 28 Experiences (Part 4 of 6)
  • Expedia New Grad SDE Earlier Loops: 5 Experiences (Part 2 of 3)

Expedia interview experiences

  • 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)
  • Expedia Intern Final Round in 2023: 17 Experiences (Part 2 of 6)
All Expedia interview questionsSee Expedia hiring insights
Saved
class Solution {
    public int equilibriumIndex(int[] values) {
        // Write your code here.
    }

}
Checking account…