FastPrepInventory Outfit Combinations
Problems/Inventory Outfit Combinations

Inventory Outfit Combinations

Roblox logoRoblox● MediumNEW GRADONSITE INTERVIEW

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in a Roblox new grad onsite interview. The candidate reports combining outfits from a user's inventory, without detailed rules. This version picks one item from every category that is present, treats all choices as compatible, and lists the outfits in a fixed order. Our version is about 70% the same as the reported question.

A user’s inventory is described by two arrays, categories and itemIds. At each index, itemIds gives an item’s ID and categories gives its clothing category.

For this exercise, assume an outfit contains exactly one item from every category present in the inventory. Every combination of those choices is compatible, and no additional optional category or compatibility rule applies. Different item IDs are different choices.

Return all outfits. Within each outfit, list item IDs in increasing category order. Sort the outfit rows lexicographically by their item IDs: compare the first differing position numerically. The input arrays may be unsorted. An empty inventory returns an empty array of outfits.

Function

combineOutfits(categories: int[], itemIds: int[]) → int[][]

Examples

Example 1

categories = [1,0,1,0]itemIds = [20,3,10,1]return = [[1,10],[1,20],[3,10],[3,20]]

Category 0 offers 1 or 3, and category 1 offers 10 or 20. List all four ordered combinations.

Example 2

categories = [3,3]itemIds = [9,2]return = [[2],[9]]

Only category 3 is present, so each of its items forms one outfit.

Example 3

categories = []itemIds = []return = []

An empty inventory produces no outfit.

Constraints

  • 0 <= itemIds.length <= 16 and categories.length = itemIds.length.
  • 0 <= categories[i] <= 3, and each category contains at most 4 items.
  • Item IDs are distinct integers in 0..10^9.
  • At most 256 outfits can be returned.

More Roblox Onsite Interview questions

  • Most Frequent Call Path From Function Trace LogsPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Design Search Autocomplete SystemPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Candy Crush Grid Matching and GravityPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • Topological Sort with Secondary OrderingPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • Most Frequent Call Stack Per ThreadPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • Count and Score Distinct Hat AssignmentsONSITE INTERVIEW · Seen Sep 2026
  • Rate Limiter Sliding Window With Per-Entity LimitsPHONE SCREEN · ONSITE INTERVIEW · Seen Sep 2026
  • Most Frequent Call Path in Interleaved LogsONSITE INTERVIEW · Seen Aug 2026
  • Grid Pathfinding with Obstacles (DFS)PHONE SCREEN · ONSITE INTERVIEW · Seen Jun 2026
  • Maximize Distance to Closest Person — Return the SeatONSITE INTERVIEW · Seen Jun 2026

Similar questions at other companies

  • Generate Circular Student ArrangementsAmazon · ONSITE INTERVIEW
  • Partition into Equal-Sum GroupsPalo Alto Networks · ONSITE INTERVIEWPalo Alto Networks interview questions
  • Expand Attribute CombinationsPinterest · PHONE SCREENPinterest interview questions
  • Alternating Parity PermutationsGoldman Sachs · OAGoldman Sachs interview questions
  • Winning Draws for a Mahjong HandZip · PHONE SCREENZip interview questions
  • Count Legal Outfit CombinationsDuolingo · OADuolingo interview questions
  • Generate All Permutations of a NumberFleetx · ONSITE INTERVIEW
  • Unique Single-Use Sum CombinationsLinkedIn · ONSITE INTERVIEWLinkedIn interview questions
  • Generate Fixed-Size CombinationsMicrosoft · ONSITE INTERVIEWMicrosoft interview questions
  • Bounded Combination Sum with Signed CandidatesConfluent · ONSITE INTERVIEWConfluent interview questions

Interview reports that mention this question

  • Roblox New Grad CodeSignal Finals: 23 Experiences (Part 4 of 7)

Roblox interview experiences

  • Roblox OA: What It Tests (2026)
  • Roblox New Grad Early OA Tasks: 10 Experiences (Part 7 of 7)
  • Roblox New Grad Engineer Rounds: 13 Experiences (Part 6 of 7)
  • Roblox New Grad HackerRank OA: 18 Experiences (Part 5 of 7)
  • Roblox New Grad Games and BQ: 25 Experiences (Part 3 of 7)
All Roblox interview questionsSee Roblox hiring insights
Saved
class Solution {
    public int[][] combineOutfits(int[] categories, int[] itemIds) {
        // write your code here
    }

}
Checking account…