Find All Possible Recipes from Given Supplies
A medium-tier problem at 56% community acceptance, tagged with Array, Hash Table, String. Reported in interviews at Verily and 4 others.
You've got supplies, you've got recipes with ingredients and results, and you need to figure out which recipes you can actually make. Sounds simple until you realize some recipes depend on outputs of other recipes, and you need to topologically order them to find what's actually achievable. Amazon, Google, and TikTok have all asked this. The trap: treating it as a simple lookup problem when it's really a dependency graph. If this one hits your OA and the recursion or ordering confuses you, StealthCoder runs invisibly during screen share and surfaces a working solution in seconds.
Companies that ask "Find All Possible Recipes from Given Supplies"
Find All Possible Recipes from Given Supplies is the kind of problem that decides whether you pass. StealthCoder reads the problem on screen and surfaces a working solution in under 2 seconds. Invisible to screen share. The proctor sees nothing. Built by an engineer who got tired of watching his cohort grind for six months and still get filtered at the OA stage.
Get StealthCoderThe core trick is recognizing this as a topological sort on a directed graph where recipes are nodes and ingredient-to-product relationships are edges. You can't just check if you have the ingredients now; you need to simulate making recipes in the right order, updating your supply as you go. Naive approach fails because you might see a recipe you can make later, miss it on the first pass, and give up. The solution: build an in-degree map for each recipe (how many missing ingredients it needs), process recipes you can make immediately, update supplies, reduce in-degrees of dependent recipes, and repeat until no new recipes unlock. Hash tables track what you have and what each recipe needs. The topological aspect separates this from basic matching problems. If you blank on dependency resolution during the live assessment, StealthCoder bridges that gap.
Pattern tags
You know the problem.
Make sure you actually pass it.
Find All Possible Recipes from Given Supplies recycles across companies for a reason. It's medium-tier, and most candidates blank under the timer. StealthCoder is the hedge: an AI overlay invisible during screen share. It reads the problem and surfaces a working solution in under 2 seconds. Built by an engineer who got tired of watching his cohort grind for six months and still get filtered at the OA stage. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Find All Possible Recipes from Given Supplies interview FAQ
Is this really asked at FAANG level, or is it a medium-tier warm-up?+
Amazon, Google, and TikTok all have it in reports. It's not the hardest medium, but interviewers like it because it blends graph thinking, simulation, and hash table efficiency. Your acceptance has to handle ingredient tracking correctly, which trips people up.
What's the trick I'm missing if my first attempt times out?+
You're probably re-checking the same recipes repeatedly instead of tracking in-degrees. Build a map of how many ingredients each recipe is missing, process only recipes with zero missing ingredients, then decrement the counts for recipes that depend on your newly unlocked outputs. One pass per successful recipe, not repeated scans.
Do I really need topological sort, or is there a greedy way?+
Greedy works here because you're not trying to order recipes by priority; you just need to find all reachable ones. But the data structure resembles topological sort (in-degrees, dependency tracking), so that's the mental model. Think of it as topological sort without needing an explicit sorted output.
How do I avoid double-counting recipes or supplies?+
Track which recipes you've already made in a set, and maintain a running copy of your supplies as a set or dict. When you successfully make a recipe, mark it done and add its result to supplies. Hash tables make membership checks instant, which is why this problem lists them as a topic.
What if the acceptance rate is under 57%. Is this problem harder than it looks?+
Yeah. Half the people miss the dependency resolution piece or implement inefficient re-checking loops. The problem is a graph problem disguised as a supply chain puzzle. Acceptance sits lower because the topological insight isn't obvious from the statement alone.
Want the actual problem statement? View "Find All Possible Recipes from Given Supplies" on LeetCode →