FastPrepFind All Possible Recipes from Given Supplies
Problems/Find All Possible Recipes from Given Supplies

Find All Possible Recipes from Given Supplies

Bloomberg LP logoBloomberg LP● MediumNEW GRADONSITE INTERVIEW

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in a Bloomberg new grad onsite interview. It names a well-known problem. We fixed the order of the input recipes so the output is always the same. Our version is about 98% the same as the reported question.

You are given recipe names, the ingredients required by each recipe, and initially available supplies. A completed recipe becomes an available supply and may unlock other recipes.

Return every recipe that can eventually be produced, in the same order that recipes appear in the input.

Function

findAllRecipes(recipes: String[], ingredients: List<List<String>>, supplies: String[]) → List<String>

Examples

Example 1

recipes = ["bread"]ingredients = [["yeast","flour"]]supplies = ["yeast","flour","corn"]return = ["bread"]

Both ingredients are initially available.

Example 2

recipes = ["bread","sandwich"]ingredients = [["yeast","flour"],["bread","meat"]]supplies = ["yeast","flour","meat"]return = ["bread","sandwich"]

Bread is produced first and then serves as an ingredient for sandwich.

Constraints

  • 1 <= recipes.length == ingredients.length <= 10^5.
  • Each recipe has at least one distinct ingredient.
  • Recipe names are unique, supply names are unique, and total ingredient entries are at most 2 * 10^5.

More Bloomberg LP Onsite Interview questions

  • Pascal's TrianglePHONE SCREEN · ONSITE INTERVIEW · Seen Dec 2026
  • Valid Triangle NumberPHONE SCREEN · ONSITE INTERVIEW · Seen Dec 2026
  • Collatz Conjecture with Shared MemoizationPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Word SearchOA · PHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • 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
  • 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

Similar questions at other companies

  • Add Course Batches All or NothingAmazon · ONSITE INTERVIEW
  • Course ScheduleByteDance · PHONE SCREEN · ONSITE INTERVIEWByteDance interview questions
  • Merge Event PreferencesAirbnb · PHONE SCREEN · ONSITE INTERVIEWAirbnb interview questions
  • Course ScheduleOracle · ONSITE INTERVIEWOracle interview questions
  • Package Install OrderVerily · ONSITE INTERVIEW
  • Course SchedulePlaud · ONSITE INTERVIEW
  • Course Schedule Cycle DetectionGoogle · PHONE SCREEN · ONSITE INTERVIEWGoogle interview questions
  • Topological Sort with Secondary OrderingRoblox · PHONE SCREEN · ONSITE INTERVIEWRoblox interview questions
  • Evaluate Formulas with Cycle DetectionInstacart · PHONE SCREEN · ONSITE INTERVIEWInstacart interview questions
  • Lexicographically Smallest Course OrderLinkedIn · ONSITE INTERVIEWLinkedIn interview questions

Bloomberg LP interview experiences

  • Bloomberg AI-Assisted Coding Round, All Levels: 14 Experiences
  • Bloomberg SWE Intern Interview Questions: 68 Questions
  • Bloomberg Interview Questions, Level Not Reported: 65 Questions
  • Bloomberg Experienced Design & More: 126 Questions (Part 2 of 2)
  • Bloomberg Experienced SWE Interviews: 167 Questions (Part 1 of 2)
  • Bloomberg New Grad Coding Questions: 121 Questions (Part 2 of 2)
All Bloomberg LP interview questionsSee Bloomberg LP hiring insights
Saved
class Solution {
    public List<String> findAllRecipes(String[] recipes, List<List<String>> ingredients, String[] supplies) {
        // Write your code here.
    }

}
Checking account…