FastPrepFind All Pythagorean Triplets
Problems/Find All Pythagorean Triplets

Find All Pythagorean Triplets

Dell Technologies logoDell Technologies● MediumFULLTIMEPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in a Dell Technologies phone screen. The report asks for all Pythagorean triplets in an array of integers. We chose positive inputs, distinct positions, removing repeated values, the ordering, the examples, the limits, and the function interface. Our version is about 85% the same as the reported question.

Given an integer array nums, return every unique value triplet [a, b, c] that can be formed from three different array positions and satisfies a * a + b * b = c * c.

Output rules

  • For this exercise, every input value is positive, so write each triplet with a <= b < c.
  • Return each value triplet only once, even if several index selections produce it.
  • Return the triplets in lexicographic order.

Function

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

Examples

Example 1

nums = [3,4,5,6,8,10]return = [[3,4,5],[6,8,10]]

Both rows satisfy the square-sum equality and are already in lexicographic order.

Example 2

nums = [5,12,13,3,4,5,5]return = [[3,4,5],[5,12,13]]

Repeated values may create the same value triplet through several positions, but that row is returned once.

Constraints

  • 0 <= nums.length <= 2000.
  • 1 <= nums[i] <= 10^7.

More Dell Technologies interview questions

  • Departments Without EmployeesPHONE SCREEN · Seen Oct 2026
  • First Non-Repeated CharacterPHONE SCREEN · Seen Oct 2026
  • Count Binary SubstringsOA · Seen May 2025
  • Optimizing Resource AllocationOA · Seen May 2025

Similar questions at other companies

  • Sort a Quadratic-Transformed ArrayLinkedIn · PHONE SCREENLinkedIn interview questions
  • Count Centaur Friend RequestsMeta · PHONE SCREENMeta interview questions
  • Valid Triangle NumberBloomberg LP · PHONE SCREEN · ONSITE INTERVIEWBloomberg LP interview questions
  • Count Winning Dice Face PairsGoogle · PHONE SCREEN · ONSITE INTERVIEWGoogle interview questions
  • Merge Sorted Squares of Two ArraysWhatNot · PHONE SCREEN · ONSITE INTERVIEWWhatNot interview questions
  • 3SumAmazon · PHONE SCREEN
  • Sort Ones, Twos, and Threes In PlaceAgoda · PHONE SCREEN · ONSITE INTERVIEWAgoda interview questions
  • Adaptive Calibration ErrorOpenAI · PHONE SCREENOpenAI interview questions
  • Meeting Rooms IIUber · PHONE SCREENUber interview questions
  • Sort ColorsVisa · PHONE SCREENVisa interview questions
All Dell Technologies interview questionsSee Dell Technologies hiring insights
Saved
class Solution {
    public int[][] findPythagoreanTriplets(int[] nums) {
        // Write your solution here.
    }
}
Checking account…