FastPrepFixed-Length Combination Sum
Problems/Fixed-Length Combination Sum

Fixed-Length Combination Sum

Pinterest logoPinterest● MediumFULLTIMEPHONE SCREEN

Updated Aug 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: The interview report names the standard fixed-cardinality combination-sum task but does not restate its value domain, ordering, or bounds. This practice version uses the conventional distinct values from 1 through 9.

Given integers k and target, return every combination of exactly k distinct integers from 1 through 9 whose sum is target.

  • Each value may be selected at most once.
  • Values within a combination must be increasing.
  • Return the combinations in lexicographic order.

Function

fixedLengthCombinationSum(k: int, target: int) → int[][]

Examples

Example 1

k = 3target = 7return = [[1,2,4]]

The only three distinct values from 1 through 9 that sum to 7 are 1, 2, and 4.

Example 2

k = 3target = 9return = [[1,2,6],[1,3,5],[2,3,4]]

These are all increasing three-value combinations with sum 9.

Example 3

k = 4target = 1return = []

The smallest sum of four distinct positive values is greater than 1.

Constraints

  • 1 <= k <= 9.
  • 1 <= target <= 60.

More Pinterest Phone Screen questions

  • Shortest Pin Path Through TopicsPHONE SCREEN · Seen Nov 2026
  • Top K Pins with Insert and QueryPHONE SCREEN · Seen Nov 2026
  • Pins Violation Log QueriesPHONE SCREEN · Seen Nov 2026
  • Sparse Matrix Addition and MultiplicationPHONE SCREEN · Seen Nov 2026
  • Minimum Bus Routes to a DestinationPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • Delete and Compact a Forest SubtreePHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • Optimal Account BalancingPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • Aggregate Matching IPv4 Addresses Across ResponsesPHONE SCREEN · Seen Oct 2026
  • Escape Room LeaderboardPHONE SCREEN · ONSITE INTERVIEW · Seen Sep 2026
  • Shortest Way to Form a Target StringPHONE SCREEN · Seen Sep 2026

Similar questions at other companies

  • All Subsets with a Given SumApple · PHONE SCREENApple interview questions
  • Validate a Mahjong Hand PartitionDuolingo · PHONE SCREENDuolingo interview questions
  • Combination Sum With Unlimited ReuseMicrosoft · ONSITE INTERVIEWMicrosoft interview questions
  • All Subsequences with Sum KExpedia · ONSITE INTERVIEWExpedia interview questions
  • Combination SumAnduril · PHONE SCREENAnduril interview questions
  • Implement QuicksortByteDance · PHONE SCREENByteDance interview questions
  • Count Complete Tic-Tac-Toe GamesDecagon · PHONE SCREEN · ONSITE INTERVIEWDecagon interview questions
  • SubsetsTemu · PHONE SCREENTemu interview questions
  • Filter Data with Composable PredicatesCoreWeave · PHONE SCREEN
  • PermutationsEPAM · PHONE SCREENEPAM interview questions

Pinterest interview experiences

  • Pinterest Experienced MLE Phone Screen: 1 Experience
All Pinterest interview questionsSee Pinterest hiring insights
Saved
class Solution {
    public int[][] fixedLengthCombinationSum(int k, int target) {
        // Write your code here.
    }
}
Checking account…