FastPrepFind the Element With Odd Frequency
Problems/Find the Element With Odd Frequency

Find the Element With Odd Frequency

Zscaler logoZscaler● EasyINTERNPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: The report names the odd-frequency task but leaves out the uniqueness rule, the function interface, and the limits. Our version is about 75% the same as the reported question.

Given a nonempty integer array values, exactly one distinct value occurs an odd number of times. Every other distinct value occurs an even number of times.

Return the value whose frequency is odd.

Function

findOddFrequencyElement(values: int[]) → int

Examples

Example 1

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

Value 2 appears twice, while 3 appears three times.

Example 2

values = [7]return = 7

The only value appears once, which is odd.

Example 3

values = [10,20,10,20,10,20,10]return = 20

Value 10 appears four times and 20 appears three times.

Constraints

  • 1 <= values.length <= 200000
  • -10^9 <= values[i] <= 10^9
  • Exactly one distinct value has odd frequency; every other distinct value has even frequency.

More Zscaler interview questions

  • Rate Limiter with Hourly and Daily Effort QuotasPHONE SCREEN · Seen Jul 2026
  • Merging PalindromesPHONE SCREEN · Seen Sep 2024
  • Merge IntervalsPHONE SCREEN · Seen Jun 2024
  • Sum of Divisors of the Array GCDPHONE SCREEN · Seen Jun 2024
  • Asteroid CollisionONSITE INTERVIEW · Seen Sep 2024
  • Check Whether a Byte Is NonzeroONSITE INTERVIEW · Seen Sep 2024
  • Count Vowel PermutationsONSITE INTERVIEW · Seen Sep 2024
  • Longest Common Subsequence LengthONSITE INTERVIEW · Seen Jun 2024
  • Run-Length EncodingONSITE INTERVIEW · Seen Jun 2024
  • How Many Sentences? 🌿OA · Seen Mar 2024

Similar questions at other companies

  • Find the Unique Element Among PairsChubb · PHONE SCREENChubb interview questions
  • The One Repeated NumberAdobe · PHONE SCREENAdobe interview questions
  • SubsetsTemu · PHONE SCREENTemu interview questions
  • Minimum Cost for a Target WeightPace Stock Broking Services · PHONE SCREEN
  • Minimum Racks for Server ResourcesGoogle · PHONE SCREENGoogle interview questions
  • Out-of-Order TLV File ReassemblyApplied Intuition · PHONE SCREENApplied Intuition interview questions
  • Ordered IP FirewallDatabricks · PHONE SCREENDatabricks interview questions
  • Count String Pairs With Disjoint CharactersNetflix · PHONE SCREENNetflix interview questions
  • SubsetsBloomberg LP · PHONE SCREEN · ONSITE INTERVIEWBloomberg LP interview questions
  • Reconstruct an Array from Prefix XORNVIDIA · OANVIDIA interview questions

Interview reports that mention this question

  • Zscaler SDE C++ and OS Rounds: 7 Experiences (Part 2 of 6)
  • Zscaler Campus SDE Interviews: 37 Experiences (Part 1 of 6)

Zscaler interview experiences

  • Zscaler Campus Drive Interviews: 4 Experiences (Part 6 of 6)
  • Zscaler Java, QA and Cloud Rounds: 8 Experiences (Part 5 of 6)
  • Zscaler UI and DevTest Rounds: 8 Experiences (Part 4 of 6)
  • Zscaler Intern, QA and SRE Rounds: 7 Experiences (Part 3 of 6)
All Zscaler interview questionsSee Zscaler hiring insights
Saved
class Solution {
    public int findOddFrequencyElement(int[] values) {
      // write your code here
    }
}
Checking account…