MLCrack

    ML SYSTEM DESIGN (DEEP DIVES) · INTERVIEW QUESTION

    Design a feature platform that serves all ML teams in the company with no training/serving skew.

    🔴 advanced · Feature Platform

    Hint: Registry + dual compute (batch + streaming) + online/offline stores + point-in-time correctness.

    Answer

    1. Problem Formulation

    "Build the feature platform that powers all of ML at the company" — the org-level question.

    Clarifying questions:

    • Who are the users? Hundreds of ML engineers across product teams. Each team owns model(s); the feature platform is shared infrastructure.
    • What's the contract? Define a feature once, use it in batch training and online serving with no skew. Discover and reuse features across teams.
    • Scale? ~10k feature definitions, ~100B feature values written per day, ~1M online reads per second peak.
    • Latency for online reads? p99 ≤ 10 ms.
    • Governance? Lineage, access control, PII tagging, retention policies.

    Why this is a hard problem (and not "just a database"): the same feature must produce identical values whether computed in a Spark batch job over historical data or in a streaming pipeline at request time. Achieving that without forcing every team to write the same logic twice is the entire point.

    Framing: a registry (what features exist), a compute layer (how they're produced), a storage layer (online + offline), and a serving layer (how they're read). All four must agree on the feature contract.

    2. Metrics

    The platform's "users" are ML teams, so platform metrics are about their experience and the correctness of features.

    Platform health:

    • Feature freshness lag (p50, p99 per feature) — time from event to availability online.
    • Training/serving skew rate — sampled per feature, measured by replaying online reads through the batch pipeline and comparing.
    • Online read latency p99 per feature group.
    • Feature pipeline uptime and backfill success rate.

    Adoption:

    • Number of features defined and used in production models.
    • Reuse rate: features consumed by ≥2 teams.
    • Time from feature definition to production model (developer velocity).

    This is the opening of a longer walkthrough. Read the full answer in the topic explorer, free.

    Likely follow-up: How do you guarantee point-in-time correctness during training data generation?