FastPrepEquation Tuple Combination
Problems/Equation Tuple Combination

Equation Tuple Combination

Zoox logoZoox● MediumFULLTIMEONSITE INTERVIEW

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: The report keeps the number list, the equation, and the yes-or-no goal. It leaves out how often numbers may occur, numeric limits, and details about how to run it. Our version is about 90% the same as the reported question.

You are given an integer array numbers. Determine whether four distinct indices can fill the roles x, y, k, and b so that y = k * x + b.

  • Each role must use a different array index.
  • Equal numeric values may fill different roles only when they come from different occurrences.
  • Evaluate the equation exactly with signed 64-bit intermediate arithmetic.

Return true when at least one qualifying tuple exists. Otherwise, return false.

Function

hasEquationTuple(numbers: int[]) → boolean

Examples

Example 1

numbers = [1,2,3,5]return = true

Use four distinct occurrences: x = 1, k = 2, b = 3, and y = 5. They satisfy 5 = 2 * 1 + 3.

Example 2

numbers = [1,2,4,10]return = false

No assignment of the four distinct occurrences to x, y, k, and b satisfies the equation.

Example 3

numbers = [2,2,3,7]return = true

The two separate occurrences of 2 may fill x and k. With b = 3 and y = 7, the equation is 7 = 2 * 2 + 3.

Constraints

  • 0 <= numbers.length <= 250
  • -1000000000 <= numbers[i] <= 1000000000
  • All multiplication and subtraction must use signed 64-bit intermediate arithmetic.

More Zoox Onsite Interview questions

  • Best Time to Buy and Sell StockONSITE INTERVIEW · Seen Jul 2026
  • Nickname-Constrained GroupingONSITE INTERVIEW · Seen Jul 2026

Similar questions at other companies

  • Group-Relative Policy AdvantagesAmazon · ONSITE INTERVIEW
  • Product Total With the Cheapest PromotionInstacart · ONSITE INTERVIEWInstacart interview questions
  • Unique Near-Equal Target-Sum PairsFivetran · ONSITE INTERVIEWFivetran interview questions
  • Minimum Unique Card Suffix LengthBloomberg LP · ONSITE INTERVIEWBloomberg LP interview questions
  • Count Pairs Divisible by KApple · ONSITE INTERVIEWApple interview questions
  • Digit-Reversed Pairs in an ArrayExpedia · ONSITE INTERVIEWExpedia interview questions
  • Max Points on a LineLinkedIn · ONSITE INTERVIEWLinkedIn interview questions
  • Majority ElementMicrosoft · ONSITE INTERVIEWMicrosoft interview questions
  • Count Index Pairs with Equal Value OffsetGoogle · ONSITE INTERVIEWGoogle interview questions
  • Net Position Calculation from API SnapshotsHeadlands Technologies · ONSITE INTERVIEWHeadlands Technologies interview questions
See Zoox hiring insights
Saved
class Solution {
    public boolean hasEquationTuple(int[] numbers) {
        // Write your code here.
    }
}
Checking account…