FastPrepFind the Odd-Occurrence Value
Problems/Find the Odd-Occurrence Value

Find the Odd-Occurrence Value

Expedia logoExpedia● EasyNEW GRADINTERNONSITE INTERVIEW

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: The goal of finding the value with an odd number of occurrences and the first example match the report at about 98%. We added number limits.

You are given a nonempty integer array values. Exactly one distinct value occurs an odd number of times, and every other value occurs an even number of times.

Return the value whose occurrence count is odd. Array order does not affect the result.

Function

findOdd(values: int[]) → int

Examples

Example 1

values = [5,5,6,4,6]return = 4

The values 5 and 6 each occur twice. The value 4 occurs once, so return 4.

Example 2

values = [9,1,9,9,1]return = 9

The value 9 occurs three times, and 1 occurs twice. Three is odd, so the answer is 9.

Constraints

  • 1 <= values.length <= 100000.
  • -1000000000 <= values[i] <= 1000000000.
  • Exactly one distinct value occurs an odd number of times; every other distinct value occurs an even number of times.

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

  • Find the Missing Number from 1 to nHyperVerge · ONSITE INTERVIEW
  • Missing and Repeated NumberCommvault · ONSITE INTERVIEWCommvault interview questions
  • Check Endianness Of A Byte ArrayNVIDIA · ONSITE INTERVIEWNVIDIA interview questions
  • Count Set Bits in an Integer ArrayAkuna Capital · ONSITE INTERVIEWAkuna Capital interview questions
  • Packed Bit Array: Set and Reset BitsNutanix · ONSITE INTERVIEWNutanix interview questions
  • Find the Two Unique NumbersZomato / Eternal · ONSITE INTERVIEWZomato / Eternal interview questions
  • Bayesian Scenario ClassifierAmazon · ONSITE INTERVIEW
  • Maximum Unique-Character Word SubsetMeta · ONSITE INTERVIEWMeta interview questions
  • Hybrid Run-Length and Bit-Packing EncoderDatabricks · ONSITE INTERVIEWDatabricks interview questions
  • Largest Combination With Bitwise AND Greater Than ZeroMicrosoft · ONSITE INTERVIEWMicrosoft interview questions

Interview reports that mention this question

  • Expedia Intern Finals Before 2020: 14 Experiences (Part 6 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 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 findOdd(int[] values) {
        // Write your code here.
    }

}
Checking account…