PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/Coding & Algorithms/Imc

Return all combinations that sum to target

Last updated: Mar 29, 2026

Quick Overview

This question evaluates combinatorial search and algorithmic problem-solving skills, focusing on recursion/backtracking, unbounded item usage, and enforcing uniqueness of combinations.

  • easy
  • Imc
  • Coding & Algorithms
  • Data Scientist

Return all combinations that sum to target

Company: Imc

Role: Data Scientist

Category: Coding & Algorithms

Difficulty: easy

Interview Round: Technical Screen

Given an array of **distinct positive integers** `candidates` and an integer `target`, return **all unique combinations** of `candidates` where the chosen numbers sum to `target`. Rules: - You may use each candidate **an unlimited number of times**. - Two combinations are considered the same if they contain the same multiset of numbers (order does **not** matter). - Return the combinations in any order. Example: - `candidates = [2,3,6,7]`, `target = 7` - Valid output: `[[2,2,3],[7]]` Constraints (typical): - `1 <= candidates.length <= 30` - `1 <= candidates[i] <= 200` - `1 <= target <= 500`

Quick Answer: This question evaluates combinatorial search and algorithmic problem-solving skills, focusing on recursion/backtracking, unbounded item usage, and enforcing uniqueness of combinations.

Related Interview Questions

  • Find k-th recipient in command propagation order - Imc (medium)
  • Choose container set to minimize waste - Imc (hard)
Imc logo
Imc
Jan 6, 2026, 12:00 AM
Data Scientist
Technical Screen
Coding & Algorithms
2
0
Loading...

Given an array of distinct positive integers candidates and an integer target, return all unique combinations of candidates where the chosen numbers sum to target.

Rules:

  • You may use each candidate an unlimited number of times .
  • Two combinations are considered the same if they contain the same multiset of numbers (order does not matter).
  • Return the combinations in any order.

Example:

  • candidates = [2,3,6,7] , target = 7
  • Valid output: [[2,2,3],[7]]

Constraints (typical):

  • 1 <= candidates.length <= 30
  • 1 <= candidates[i] <= 200
  • 1 <= target <= 500

Submit Your Answer

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Imc•More Data Scientist•Imc Data Scientist•Imc Coding & Algorithms•Data Scientist 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.