Which Ad Creatives Can Be Assembled From Available Assets
Last updated: November 29, 2026
Quick Overview
Each ad creative is built from a list of components, where a component is either a raw asset or another creative. Given the creatives with their component lists and the set of raw assets in stock, return every creative that can be fully assembled.
Meta
November 29, 20260
0
0 solved
Each ad creative is built from a list of components, where a component is either a raw asset or another creative. Given the creatives with their component lists and the set of raw assets in stock, return every creative that can be fully assembled.
A Meta onsite question in the style of Ads Manager tooling, where carousel and collection ads are composed from images, videos, and other composed units. The interviewer checks that you model it as Kahn's algorithm seeded with the stocked assets, and that creatives in a dependency cycle are correctly excluded.
What the Interviewer Expects
- Model components as edges from ingredient to creative
- Seed the queue with available raw assets, not with creatives
- Count missing components per creative and unlock at zero
- Exclude creatives that depend on a cycle or on missing assets
- Run in time linear in total component references
Key Topics to Cover
How to Approach This
- Clarify input constraints and edge cases before writing code.
- Walk through your approach verbally and confirm with the interviewer before coding.
- Start with a brute force solution, then optimize. Mention time and space complexity.
- Test your solution with examples, including edge cases like empty input or duplicates.
- Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
- How would you return the build order for each creative?
- If each asset has limited quantity, how does the problem change?
- How would you report the minimal set of missing assets blocking a creative?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice DSA ProblemsSample Answer
Requirements
- Input:
creatives(names),components[i](list of names needed forcreatives[i]), andstock(raw assets available in unlimited supply). - Output: all creatives that can be assembled, any orde...
High-Level Design
Think of every name as a node and add an edge from each component to the creative that needs it. A creative becomes buildable when all its components are available, which is exactly the in-degree-hits...