FastPrepFind the Two Unique Numbers
Problems/Find the Two Unique Numbers

Find the Two Unique Numbers

Zomato / Eternal logoZomato / Eternal● MediumFULLTIMEONSITE INTERVIEW
QuestionFunctionExamplesConstraints

Problem statement

Source note: The interview report identifies the two-singletons array task. This practice supplies deterministic output ordering and portable bounds. The judged core task matches the reported exercise at about 96%.

You are given an integer array nums. Exactly two values appear once, while every other value appears exactly twice.

Return the two unique values in ascending order.

Function

findTwoUniqueNumbers(nums: int[]) → int[]

Examples

Example 1

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

The paired values cancel, leaving 3 and 5.

Example 2

nums = [-4,7,-4,9,7,-2]return = [-2,9]

Only -2 and 9 occur once; the result is sorted.

Constraints

  • 2 <= nums.length <= 100000
  • -1000000000 <= nums[i] <= 1000000000
  • Exactly two values appear once, and every other value appears exactly twice.

More Zomato / Eternal problems

  • Flipping MatrixONSITE INTERVIEW · Seen Oct 2026
  • Jump Game IVONSITE INTERVIEW · Seen Oct 2026
  • Friend Circles and Redundant ConnectionsPHONE SCREEN · Seen Sep 2026
All Zomato / Eternal interview questionsSee Zomato / Eternal hiring insights
Saved
class Solution {
    public int[] findTwoUniqueNumbers(int[] nums) {
        // Write your code here.
    }
}
Checking account…