Schedule Multi-Step Dish Recipes Across Three Chefs to Finish an Order Fastest
Company: Meta
Role: Software Engineer
Category: Software Engineering Fundamentals
Difficulty: medium
Interview Round: Technical Screen
In an AI-assisted coding round, you build a scheduler for a kitchen. The kitchen has to cook one order made up of several dishes. Each dish follows a recipe, which is a fixed sequence of steps, each carried out at a station, and you assign every step to one of three chefs. The goal is to finish the whole order as fast as possible: minimize the time at which the last step of any dish finishes.
Giving each step to the chef who does it fastest is a good start, but the order in which the steps are scheduled matters too. On the interviewer's three-dish example, changing that order alone finished the order 30 seconds sooner.
The report does not give the input format or the example's data. Unless the interviewer says otherwise, assume that:
- each step has a known duration, in whole seconds, for each of the three chefs;
- a chef works on one step at a time and does not stop a step once it has started;
- a step can start only after the previous step of the same dish has finished;
- steps of different dishes are independent, so different chefs can work on different dishes at the same time.
### Clarifying Questions
- Is each station a shared resource that only one chef can use at a time, or can several chefs use the same station at once?
- Does a chef's speed depend on the station, on the individual step, or on both?
- Is there any hand-off time when consecutive steps of a dish are done by different chefs?
- Is an optimal schedule required, or a fast schedule that clearly beats the fastest-chef baseline, and how large can an order get?
### Part 1 — Baseline schedule
Model dishes, steps and chefs, and implement a scheduler that gives every step to its fastest chef. It should produce the chef, start time and finish time of every step, and the time at which the whole order is done.
```hint Two things to wait for
Ask what must be true before a given step can begin, and keep a running clock for each of those conditions.
```
#### What This Part Should Cover
- A data model for dishes, their ordered steps and the per-chef durations
- A timing computation that keeps recipe order and never gives a chef two steps at once
- Output of the full schedule, not only the total time, so that it can be checked
### Part 2 — Choose a better order
Explain, with a small example of your own, why scheduling the same fastest-chef assignments in a different order can finish the order sooner. Then improve the scheduler so that it chooses a good order, and a chef other than the fastest one when that helps. Say whether your method is guaranteed to find the best schedule.
```hint Where the idle time is
Look at when a chef sits idle waiting for a dish's previous step, and which dish's remaining work decides when the whole order can finish.
```
#### What This Part Should Cover
- Why the scheduling order changes idle time and the finish time
- A concrete improvement method, such as a priority rule, local search, or exact search for small orders, with its running time
- When the fastest chef is not the best choice for a step
- A lower bound that shows how far a schedule can be from the best possible
### What a Strong Answer Covers
- Settles the open rules (shared stations, how chef speed is defined, hand-off time) before coding
- A correct timing model in which a step waits for both its chef and the previous step of its dish
- A concrete example of why order matters even when every step keeps its fastest chef
- An improvement method with its cost, and honesty about heuristic versus optimal results
- A check that every produced schedule is valid, and tests, in place before and during optimization
### Follow-up Questions
- If each station can be used by only one chef at a time, what changes in your model and your scheduler?
- An order has fifty dishes. Which part of your approach stops scaling, and what would you use instead?
- How would you test the scheduler, including cases where the improved schedule and the baseline must agree?
- New orders arrive during service while earlier ones are still cooking. How does the scheduler adapt?
Overview: A kitchen must cook an order of several dishes, each a fixed sequence of station steps, and every step is assigned to one of three chefs with different speeds. The task is to build a scheduler that minimizes the order's completion time, starting from a fastest-chef baseline and showing why the order in which steps are scheduled also matters.
Read the full Meta Software Engineer interview experience this question came from