Prerequisites and scoped previews
Feature engineering and transformations
Create numeric/categorical/text features, defaults and fitted transformations without leaking validation data.
Scoped prerequisite preview. The complete chapter is planned; this preview does not count as authored coverage.
Point-in-time joins and feature availability
Use both event-time and actual availability when reconstructing historical decisions.
What, when, why and how
Feature definition as a contract
- what
- A feature definition names entity keys, source/window, value type/unit, transform, freshness/default rules, purpose and owner under an immutable version.
- when
- Use it whenever multiple training/serving consumers share a feature or a semantic change may affect predictions.
- why
- The same field name can hide different units, windows or missingness. A registry label alone does not make two computations equivalent.
- how
- Record the full contract and examples, pin model requests to an approved version/bundle and treat semantic changes as migrations. A count-to-rate change is breaking even if both use floating-point storage.
Offline, online and on-demand responsibilities
- what
- Offline stores support snapshots/joins; online stores serve bounded low-latency values; materializers project validated data; request-time transforms compute permitted bounded context.
- when
- Use separate paths when their access patterns and latency/freshness needs differ.
- why
- An online key/value cache is not a historical ledger, while a giant warehouse query is rarely suitable for every synchronous prediction.
- how
- Start with SQL/batch features and a simple serving cache. Add streaming or request-time computation only for measured needs, sharing transform/default definitions and validating actual availability/coverage.
Freshness, eviction and fallback
- what
- Freshness describes acceptable value age/coverage; eviction TTL describes storage lifetime; fallback describes what a consumer does when a value is missing/stale/unavailable.
- when
- Use these in API responses, SLOs, alerts and rollout decisions.
- why
- A cache hit can still be stale; a default may change model behavior even when the endpoint returns 200. Undefined fallback is a hidden policy decision.
- how
- Return value plus source/version, age, status and missing/default metadata. Budget request fan-out, make required versus optional features explicit and validate degraded behavior with the consuming model/policy owner.
Write one feature definition
Synthetic feature account_activity_count_v1 uses tenant-qualified user identity, permitted activity events, an explicit counting window and float storage for a nonnegative count. The example uses source count values 10/40, transform scale-10-v1, maximum age 3,600 seconds and raw default 0 with a missing/stale flag. For the worked problem, the counting window is [coverage_end - 1 hour, coverage_end), and the scalar source event time equals that coverage end. The fixture consumes precomputed counts; source aggregation/dedup is a separate contract.
Version v2 changes count interpretation to a rate or scale-100 transform. It cannot replace v1 under the same model input name without compatibility validation. Dual-compute/serve explicit versions, compare eligible snapshots and golden outputs, then move a compatible model-feature bundle.
| Field | Exercise contract |
|---|---|
| Key | (tenant_id, entity_type, entity_id), feature_definition_version, lifecycle epoch |
| Semantics | Declared source/window and count unit; no current-user input from future events |
| Transform/type | scale-10-v1; finite number; model receives value/10 |
| Freshness/default | Age <= 3,600s at decision; raw default 0 plus explicit status |
| Access/owner | Authorized purpose and tenant; domain feature owner + platform on-call |
Choose the simplest useful platform
Baseline: a reviewed SQL query builds a versioned feature snapshot, a materialization job publishes current values with conditional version checks, and a batch API retrieves required features for one entity. This is a useful starting point when hourly/batch freshness suffices.
A platform becomes worthwhile when teams repeatedly duplicate definitions, need reliable as-of datasets, or require low-latency shared access/governance. More components add operational cost, failure modes, schema compatibility and access obligations. Do not build streaming infrastructure just to display an architecture diagram.
Estimate work before adding fan-out
At a synthetic 5,000 prediction requests/s and 20 required features, a per-feature remote-call design creates up to 100,000 calls/s before retries. A batched feature-set read can reduce network round trips, but bytes, keys, partitions, skew and tail latency still matter.
If 10M entities have 20 raw numeric values at eight bytes each, raw scalar storage is 1.6GB decimal, excluding keys, timestamps, metadata, indexes, replicas and history. Retaining daily snapshots or old/new versions multiplies storage and rebuild load. These are arithmetic assumptions, not observed capacity.
Respond to staleness and noisy tenants
A producer slows, but the serving cache continues returning old values quickly. Alert on coverage/event/availability age and default rates, not only endpoint latency. Decide whether each consuming model may default, use a bounded stale value or reject/degrade; name the owner and evidence.
A tenant floods backfills and evicts hot serving keys. Apply per-tenant admission/quotas, separate resource pools and protect online latency. Benchmark shared versus isolated stores and partition strategies under representative skew; a tenant prefix alone does not guarantee authorization or resource isolation.
Diagrams and relationships
The registry describes contracts; a materializer and serving system must actually enforce and observe them.
Scroll horizontally on smaller screens, or enlarge the diagram.
Engineer, Senior and Staff follow-ups
These are teaching lenses. Each answer changes the scope of reasoning; they are not official employer leveling criteria.
Engineer: Why return a status beside default zero?
Zero can be a genuine measurement or a substitute for missing/stale data. Preserve that difference so the model/policy and monitoring can react consistently.
Engineer: Is a numeric type change the only breaking change?
No. Unit, aggregation window, entity key, transform, default, freshness and permitted purpose can alter meaning while the physical type stays identical.
Senior: When would you avoid streaming?
When batch freshness meets the product need and streaming complexity/resource cost lacks measured benefit. Keep the contract and migration path clear so a later incremental stream can be justified without changing semantics silently.
Senior: How do you protect online reads during backfill?
Bound and isolate backfill work, use conditional current-value projection, rate-limit tenants and predeclare restore/cutover limits. Observe actual read tails, hot-key skew and default/age rates; more workers can worsen shared saturation.
Staff: How do you assign feature ownership?
The domain owner defines meaning/quality/purpose, platform owns retrieval/materialization guarantees and consumers own action suitability. Agree on support versions, incident handoffs, migration and deprecation with measurable evidence.
Staff: How do you justify a platform migration?
Quantify duplicated work, correctness incidents, latency/freshness needs and governance gaps against operating/build costs. Stage a small contract-compatible pilot with rollback and adoption evidence, rather than counting registered features as success.
Practice and self-review
Your practice draft
Define the feature contract and compare batch SQL/cache with a streaming platform. Compute raw scalar bytes and request fan-out, then specify stale behavior.
Saved locally on this device. The worked answer does not score your draft. Existing lesson notes and completion are separate.
Progressive hints
Hint 1
Include units/windows, keys, transform/default and owner.
Hint 2
A batch read reduces round trips but not all storage or CPU work.
Hint 3
Default success and product quality are different measurements.
Reveal worked answer guidance
A valid answer pins the full v1 semantics, tenant/purpose identity and explicit stale/default status. The synthetic estimates are 1.6GB raw scalar values and 100,000 per-feature calls/s at the stated request fan-out. Prefer the batch baseline unless freshness/scale/coordination evidence justifies additional infrastructure.
Evidence to check in your answer
- Full definition and version semantics.
- Separated stores/materializer/registry roles.
- Honest capacity units/overhead.
- Owned fallback, quotas and migration.
For each item, record Missing, Prompted, Independent or Adaptive evidence. Adaptive means you can revise the reasoning under a changed constraint. Reading completion and readiness are separate.
Sources and verification scope
Original synthetic examples and reference calculations. Sources support narrowly scoped background; they do not establish production performance or independent chapter review.
Rules of Machine Learning ↗ · Baseline/infrastructure and training-serving consistency principles; dated examples are not current architecture claims.
Feast feature retrieval ↗ · Offline/online retrieval and contract vocabulary only. Original activation-interval fixture is platform-neutral; no Feast integration or provider/default guarantee.
Primary background links checked during authoring on 2026-10-19. Arithmetic, temporal eligibility, maturity and split reference functions are checked by the bounded local fixture suite. SQL is explanatory, not a migrated production query. No GPU, external dataset, model API or training job is required.