Cheapest Way to Buy an Outfit From Overlapping Bundles

Last updated: November 29, 2026

Quick Overview

A player wants a specific set of up to 15 avatar items, and the catalog offers bundles, each with a Robux price and a set of items. Return the minimum total price of bundles that together cover every wanted item, or -1 if impossible (extra items in a bundle are allowed).

Roblox
Coding & Algorithms
Software Engineer
Roblox
November 29, 2026
Software Engineer
Onsite
Coding & Algorithms
Hard

0

0

0 solved


A player wants a specific set of up to 15 avatar items, and the catalog offers bundles, each with a Robux price and a set of items. Return the minimum total price of bundles that together cover every wanted item, or -1 if impossible (extra items in a bundle are allowed).

Marketplace and economy teams at Roblox deal with bundles, limiteds and item packs, so a set-cover style optimization fits an onsite hard round. The interviewer looks for recognizing exponential structure, bitmask DP, and a pruning trick that keeps it fast.

What the Interviewer Expects
  • Map wanted items to bit positions and bundles to masks
  • Define dp over covered-item masks
  • Explain why branching on the lowest uncovered item is enough
  • Ignore items in bundles that the player does not need
  • Analyze $O(2^n \cdot m)$ and when it is acceptable
Key Topics to Cover
bitmask DP
set cover
dynamic programming
optimization
How to Approach This
  1. Clarify input constraints and edge cases before writing code.
  2. Walk through your approach verbally and confirm with the interviewer before coding.
  3. Start with a brute force solution, then optimize. Mention time and space complexity.
  4. Test your solution with examples, including edge cases like empty input or duplicates.
  5. Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
  • What if each bundle can only be bought once and items have per-item prices too?
  • How would you handle 60 wanted items where bitmask DP explodes?
  • How would you return which bundles to buy?
  • What if a player already owns some items?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice DSA Problems
Sample Answer
Requirements

Inputs: needed (distinct item IDs, at most about 15) and bundles as (price, items). Buying a bundle any number of times is allowed but never useful twice. Output the minimum cost to own every ne...

High-Level Design

General set cover is NP-hard, but with n≤15n \le 15 we can enumerate covered subsets. Let dp[mask] be the cheapest cost to cover exactly the items in mask (or a superset reached from it). Transition...


Submit Your Answer
Markdown supported

Related Questions