FastPrepRecipes You Can Prepare
Problems/Recipes You Can Prepare

Recipes You Can Prepare

Indeed logoIndeed● MediumFULLTIMEPHONE SCREEN

Updated Oct 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: The report gives the recipe-and-raw-material preparation task at about 80% of this contract; reusable ingredients, recipe dependencies, and cycle handling are specified here.

You are given recipe names recipes, their required ingredient lists ingredients, and initially available raw materials supplies. Return every recipe that can be prepared, in lexicographic order.

  • For this exercise, assume ingredients[i] lists every item needed for recipes[i], and each required item must be available.
  • An ingredient may name another recipe. A recipe becomes available as an ingredient only after it can be prepared.
  • For this exercise, assume available items have unlimited reusable quantities; preparing one recipe does not consume an item needed by another.
  • Recipes with no required ingredients can be prepared immediately. A cycle alone does not make any item available.
  • Unknown raw materials that are absent from supplies cannot be obtained.

Recipe names are unique and do not occur in supplies. Repeated supply names have the same meaning as a single occurrence.

Function

preparableRecipes(recipes: String[], ingredients: String[][], supplies: String[]) → String[]

Examples

Example 1

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

Bread is prepared from flour and yeast, then bread and ham prepare sandwich.

Example 2

recipes = ["soup","salad"]ingredients = [["water","salt"],["lettuce"]]supplies = ["water"]return = []

Salt and lettuce are unavailable, so neither recipe can be prepared.

Example 3

recipes = ["a","b","c"]ingredients = [["b"],["a"],[]]supplies = []return = ["c"]

The a/b cycle has no starting item; c has no ingredients and is immediately available.

Constraints

  • For this exercise, assume 0 <= recipes.length <= 500 and ingredients.length == recipes.length.
  • The total number of ingredient entries is at most 5000.
  • 0 <= supplies.length <= 5000.
  • Every name contains 1 through 30 lowercase ASCII letters or digits.
  • Recipe names are unique, recipe names do not occur in supplies, and each ingredient list has distinct names.

More Indeed Phone Screen questions

  • Insert into an Unrolled Linked ListPHONE SCREEN · ONSITE INTERVIEW · Seen Sep 2026
  • Course Completion OrderPHONE SCREEN · Seen May 2025
  • Rotting Orange PropagationPHONE SCREEN · Seen May 2025
  • Courses Shared by Every Student PairPHONE SCREEN · Seen Aug 2022
  • First and Last Access Time per UserPHONE SCREEN · Seen Jul 2022
  • Most Accessed Resource in Five MinutesPHONE SCREEN · Seen Jul 2022
  • Resource Transition GraphPHONE SCREEN · Seen Jul 2022
  • Count Disappearing Connected TilesPHONE SCREEN · Seen Jul 2022
  • First Dictionary Word from Note LettersPHONE SCREEN · Seen Jul 2022
  • Word Path Moving Only Right or DownPHONE SCREEN · Seen Jul 2022

Similar questions at other companies

  • Merge Event PreferencesAirbnb · PHONE SCREEN · ONSITE INTERVIEWAirbnb interview questions
  • Task Build Order and File-Change RerunsVanta · PHONE SCREEN
  • Topological Sort with Secondary OrderingRoblox · PHONE SCREEN · ONSITE INTERVIEWRoblox interview questions
  • Evaluate Formulas with Cycle DetectionInstacart · PHONE SCREEN · ONSITE INTERVIEWInstacart interview questions
  • Available Recipes from Initial SuppliesAmazon · PHONE SCREEN
  • Task Dependency OrderingCitadel · PHONE SCREENCitadel interview questions
  • Validate CSV References and Field DependenciesStripe · PHONE SCREENStripe interview questions
  • Data Pipeline Steps with Search and Run OrderRippling · PHONE SCREENRippling interview questions
  • Propagate Spreadsheet Cell UpdatesOpenAI · PHONE SCREENOpenAI interview questions
  • Lexicographically Smallest Topological OrderCoinbase · PHONE SCREENCoinbase interview questions

Indeed interview experiences

  • Indeed Experienced SWE Karat Screens and OAs: 6 Experiences
  • Indeed SWE Intern Karat Screens and OA: 3 Experiences
  • Indeed New Grad SWE Online Assessments: 3 Experiences
All Indeed interview questionsSee Indeed hiring insights
Saved
class Solution {
    public String[] preparableRecipes(String[] recipes, String[][] ingredients, String[] supplies) {
        // Write your code here.
        return new String[0];
    }
}
Checking account…