Preparing your design workspace

Loading the problem and your latest saved attempt…

Design an Ingredient Recipe and Cook Booking App

Create recipes, generate ingredient-compatible catalog suggestions, and book a cook without double-booking an hour.

Problem statement

Design an app in which people create recipes, enter available ingredients to generate recipe suggestions, and book a cook to prepare a selected recipe.

For this exercise, assume generation means selecting compatible published recipe versions from a stored catalog. A creator can add and edit ingredients and instructions; an edit creates an immutable new version.

Ingredient names use exact normalized identifiers, quantities are not modeled, and booking does not consume ingredients. Suggestions may use an index that lags catalog changes by up to sixty seconds.

For this exercise, assume cooks choose the exact published recipe versions they offer and publish hour-aligned, sixty-minute slots in UTC. A customer selects a cook, an offered recipe version, and one open slot. Confirmation must atomically check the current offer and publication state and claim that slot.

At most one confirmed booking may occupy a cook's slot. Customers and cooks can read their bookings; the customer can cancel a confirmed booking and release its slot.

For this exercise, assume a booking has a stable customer-supplied identity. Repeating the same create action must not create another booking; reusing that identity for a different customer, cook, recipe version or slot is a conflict. A cancelled booking stays cancelled, including after a delayed create retry.

A new booking after cancellation needs a new identity. Recipe edits or later offer withdrawal do not rewrite a confirmed booking's recipe snapshot. Design the user flow, schema, APIs, architecture and failure handling. Payments and delivery are outside this exercise.

What to build

  1. Creators can publish recipes and make immutable new versions with ingredient identifiers and instructions.
  2. People can enter ingredient identifiers and receive compatible published catalog recipe versions.
  3. Cooks can offer exact recipe versions and publish hour-aligned UTC slots.
  4. A customer can confirm one offered recipe version in one cook slot without duplicate or overlapping confirmed bookings.
  5. Customers and cooks can read durable bookings with the exact confirmed recipe version.
  6. A customer can cancel their confirmed booking, freeing the slot without allowing old retries to recreate it.

At scale

  • For this exercise, assume one hundred thousand recipes and ten thousand cooks.
  • For this exercise, assume peak traffic of one hundred suggestion reads and twenty booking commands per second.
  • For this exercise, target one-second p95 suggestion reads; catalog indexes may lag by up to sixty seconds.
  • For this exercise, confirmed booking state must survive service restarts; a stale suggestion never authorizes an unavailable offer or occupied slot.