MODULE 21 · Middle+ · 2.5 hours

The best project is the one you decided not to build

A month before the first line of code. We write the design doc: where it hurts, what that costs, what we will not do and on what condition the project is closed.

Open this module in the simulator All 23 lessons

The first two modules are free, no card. The rest are $20/month.

🏢 The situation

You are now a Middle ML Engineer. Victor brings you to a meeting with a major client: the "SuperMegaRetail" chain (2000 stores, 47 distribution centers) wants a demand forecasting system.

"Datacore is taking this contract, and you're the lead engineer. But we won't write code for another month. First — a design document. Juniors start with the model; middles start with the question 'is there even a problem, and is it worth solving?'. Read Babushkin & Kravchenko — and bring me the first version of the design doc."

🎯 Your task

  1. Distinguish the problem space from the solution space and find the real problem.
  2. Assess the risks and the cost of a mistake before the project starts.
  3. Draft the design document structure and run its review.

📚 Theory

Problem space vs solution space

The engineer's classic mistake is to jump into the solution space ("let's do gradient boosting with lags!") without studying the problem space ("what actually hurts the business and why?").

PROBLEM SPACE What hurts? Whom? How much does it cost? • stores lose $800M/yr on the gap • overstock → perishables written off • out-of-stock → customer goes to a competitor This is where the questions live SOLUTION SPACE How can it be solved? With what? At what cost? • rules / a moving average • an ML forecast (boosting, lags) • buy an off-the-shelf solution Enter here only after the questions on the left
Study the problem first, enumerate solutions second. Jumping straight to the right is the top source of failed ML projects.

Problem-space questions for SuperMegaRetail:

The cost of a mistake — before the model, not after

Before building the system, write down what happens if the model errs, in both directions:

Error Consequence Estimate
Forecast too high (overstock) surplus, perishables written off easy to compute from data
Forecast too low (out-of-stock) empty shelf, a lost customer hard: A/B tests or expert judgment

The asymmetry of error costs will later determine the metric, the loss (quantile!), and the system's SLA.

Preliminary research: build vs buy and the degree of innovation

The design document: why and what

A design doc is a document where the solution is designed and criticized before it becomes code. The myths that stop people from writing one:

  1. "It's for big companies" — a startup finds it even cheaper to catch a mistake in a document than in production.
  2. "Only for complex projects" — a simple project = a short doc.
  3. "You need a template" — what matters is not the template but covering the key questions.
  4. "Every doc must end in a deployed system" — a "don't do it" conclusion is also a success of the doc (and a very cheap one).

The skeleton of an ML system design doc:

  1. The problem and the goal — in business language, with numbers.
  2. Goals and antigoals — what we are NOT doing matters as much as what we are.
  3. Relevance and reasons — an analysis of the current flow, how much we lose, who else could use it.
  4. Previous work — what was already tried and why it didn't fly.
  5. Metrics and losses (module 22) · Data · Validation · Baselines.
  6. Integration, monitoring, ownership (module 23).
  7. Risks and the cost of a mistake.

What to remember

  • Problem space first (what hurts and at what cost), solution space second (what cures it).
  • The cost of a mistake in both directions is written down before choosing the model — it will define the metrics and losses.
  • A design doc is cheaper than code; "don't do the project" is also a result.
  • Antigoals guard the scope; the doc lives and updates with the project.

Next in this module: Practice

A step-by-step walkthrough of the solution, the code and a five-question quiz.

Open the module →

Nearby lessons

20 Finale: defending your project before the CTO 22 Advanced · Metrics, data, validation, baselines

The whole program — 23 lessons