PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/Coding & Algorithms/NVIDIA

Solve unique triplets summing to target

Last updated: Mar 29, 2026

Quick Overview

This question evaluates algorithm design and implementation skills for array processing, duplicate elimination, correctness across edge cases, complexity analysis, and test-case construction.

  • Medium
  • NVIDIA
  • Coding & Algorithms
  • Software Engineer

Solve unique triplets summing to target

Company: NVIDIA

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: Medium

Interview Round: Technical Screen

Implement a function that, given an integer array nums and an integer target T, returns all unique triplets [x, y, z] from nums such that x + y + z = T. Requirements: avoid duplicate triplets (enforce x <= y <= z within each triplet), return results in lexicographic order, and aim for O(n^ 2) time using sorting and a two-pointer strategy with O( 1) extra space beyond the output. Discuss edge cases (duplicates, all zeros, no solution, mixed signs, large n) and provide a concise set of test cases. Analyze time and space complexity.

Quick Answer: This question evaluates algorithm design and implementation skills for array processing, duplicate elimination, correctness across edge cases, complexity analysis, and test-case construction.

Related Interview Questions

  • Compute the Final Robot Score - NVIDIA (easy)
  • Return all file paths via DFS - NVIDIA (easy)
  • Implement a disk space manager with eviction - NVIDIA (medium)
  • Implement encode/decode for list of strings - NVIDIA (easy)
  • Implement short algorithms on logs, grids, and strings - NVIDIA (hard)
NVIDIA logo
NVIDIA
Jul 15, 2025, 12:00 AM
Software Engineer
Technical Screen
Coding & Algorithms
2
0

Implement a function that, given an integer array nums and an integer target T, returns all unique triplets [x, y, z] from nums such that x + y + z = T. Requirements: avoid duplicate triplets (enforce x <= y <= z within each triplet), return results in lexicographic order, and aim for O(n^ 2) time using sorting and a two-pointer strategy with O(

  1. extra space beyond the output. Discuss edge cases (duplicates, all zeros, no solution, mixed signs, large n) and provide a concise set of test cases. Analyze time and space complexity.

Submit Your Answer

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More NVIDIA•More Software Engineer•NVIDIA Software Engineer•NVIDIA Coding & Algorithms•Software Engineer Coding & Algorithms
PracHub

Master your tech interviews with 8,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.