FastPrepSubsets
Problems/Subsets

Subsets

Bloomberg LP logoBloomberg LP● MediumNEW GRADPHONE SCREENONSITE INTERVIEW

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in firsthand Bloomberg new-grad onsite interviews. In our version, you return the subsets in order of their binary mask, from small to large, and keep the input order inside each subset.

Given an integer array nums whose elements are unique, return all of its subsets, including the empty subset.

Within each subset, preserve the elements' original input order. Return the subsets in increasing binary-mask order: bit i indicates whether nums[i] belongs to that subset.

Function

subsets(nums: int[]) → List<List<Integer>>

Examples

Example 1

nums = [1,2,3]return = [[],[1],[2],[1,2],[3],[1,3],[2,3],[1,2,3]]

The eight outputs correspond to masks 000 through 111.

Example 2

nums = [0]return = [[],[0]]

A one-element array has the empty subset and the subset containing that element.

Constraints

  • 1 <= nums.length <= 10.
  • -10 <= nums[i] <= 10.
  • All values in nums are unique.

More Bloomberg LP Onsite Interview questions

  • N-ary Index-Path Encoder and DecoderPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Top K Frequent WordsONSITE INTERVIEW · Seen Nov 2026
  • Trapping Rain WaterPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Word SearchOA · PHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Design Browser HistoryPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • Mutable Stock Price Top KPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • Add Two Numbers IIPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • Decode StringPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • Minimum Replacements to Make Two Strings AnagramsPHONE SCREEN · ONSITE INTERVIEW · Seen Sep 2026
  • Currency Conversion RatePHONE SCREEN · ONSITE INTERVIEW · Seen Sep 2026

Similar questions at other companies

  • SubsetsTemu · PHONE SCREENTemu interview questions
  • Maximum Unique-Character Word SubsetMeta · ONSITE INTERVIEWMeta interview questions
  • SubsetsGoogle · ONSITE INTERVIEWGoogle interview questions
  • Optimal Account BalancingAmazon · ONSITE INTERVIEW
  • Count Legal Outfit CombinationsDuolingo · OADuolingo interview questions
  • Largest Number Below N from Reusable DigitsByteDance · PHONE SCREENByteDance interview questions
  • Find the Two Unique NumbersZomato / Eternal · ONSITE INTERVIEWZomato / Eternal interview questions
  • Unique Single-Use Sum CombinationsLinkedIn · ONSITE INTERVIEWLinkedIn interview questions
  • Minimum Cost for a Target WeightPace Stock Broking Services · PHONE SCREEN
  • Bounded Combination Sum with Signed CandidatesConfluent · ONSITE INTERVIEWConfluent interview questions

Interview reports that mention this question

  • Bloomberg SWE Intern Interview Questions: 68 Questions
  • Bloomberg New Grad Question Bank: 161 Questions (Part 1 of 2)
  • Bloomberg New Grad Interviews: 2025 vs 2026 Guide
  • Bloomberg New Grad VOs: 32 Experiences (Part 5 of 5)
  • Bloomberg New Grad OOD Follow-ups: 14 Experiences (Part 3 of 5)

Bloomberg LP interview experiences

  • Bloomberg AI-Assisted Coding Round, All Levels: 14 Experiences
All Bloomberg LP interview questionsSee Bloomberg LP hiring insights
Saved
class Solution {
    public List<List<Integer>> subsets(int[] nums) {
        // Write your code here.
    }
}
Checking account…