Skip to content
elevatedevco

Data & MLOps

Feature stores

Learn Feature stores: 34 practice questions and answers with an interactive quiz — from the offline AI Learning app.

Professional34 questions34 quiz questions

Questions & Answers

Tap a question to reveal its answer. Written for self-study and interview preparation.

What is a feature store and what two primary problems does it solve for ML teams?

A feature store is a centralized repository for defining, storing, and serving ML features. It solves (1) training-serving skew by ensuring both training and inference use the same feature computation logic, and (2) feature duplication by providing a shared catalog where teams can discover and reuse existing features rather than re-engineering them independently.

What is the key architectural difference between an online store and an offline store in a feature store system?

The offline store (e.g., S3 + Parquet, BigQuery) holds the full historical record of feature values for generating point-in-time correct training datasets, supporting scans across large date ranges. The online store (e.g., Redis, DynamoDB, Bigtable) holds only the most recent feature value per entity to satisfy sub-10ms latency requirements at inference time.

What is training-serving skew and how does a feature store structurally prevent it?

Training-serving skew occurs when the feature values computed during model training differ from those served at inference time — typically because two separate code paths implement the same transformation with subtle inconsistencies. A feature store prevents this by centralizing the canonical feature definition so the same registered transformation logic is executed when generating the training dataset and when serving features online.

What is point-in-time correctness (also called 'as-of' correctness) in a feature store context?

Point-in-time correctness means that when building a training dataset, each row's feature values reflect only what was known at or before the associated label timestamp — preventing future data from leaking into training. This is implemented via an 'as-of join' between an entity-timestamp DataFrame and the feature history table, selecting the latest feature value whose timestamp is ≤ the label timestamp.

In Feast, what does `store.get_historical_features()` return and when is it used?

`get_historical_features` returns a `RetrievalJob` that lazily executes a point-in-time correct join between an entity DataFrame (containing entity keys and event timestamps) and the registered offline store. It is invoked during training dataset generation to retrieve the correct historical feature snapshot for each labeled event, preventing label leakage.

entity_df = pd.DataFrame({
    "user_id": [1, 2, 3],
    "event_timestamp": pd.to_datetime(["2025-01-01", "2025-03-15", "2025-06-01"])
})
job = store.get_historical_features(
    entity_df=entity_df,
    features=["user_stats:purchase_count", "user_stats:avg_order_value"]
)
df = job.to_df()
What is materialization in a feature store and what triggers it?

Materialization is the process of computing or reading the latest feature values from the offline store (or upstream pipelines) and writing them into the online store so they can be served at low latency during inference. It can be triggered on a schedule (batch materialization every N hours), event-driven (on pipeline completion), or continuously via stream ingestion for features requiring sub-minute freshness.

Which storage backend is most commonly used for the online store in production feature stores, and why?

Redis (including Redis Cluster) is the dominant online store backend because it provides sub-millisecond key-value lookups from memory and scales horizontally via consistent hashing. Its in-memory architecture reliably meets the P99 < 10ms latency budgets required for real-time ML inference on high-QPS services, and it natively supports hash and string data types that map cleanly to feature vectors.

How does a feature store treat streaming features differently from batch features in terms of ingestion and storage?

Streaming features are ingested via a message broker (Kafka) through a stream processor (Flink, Spark Structured Streaming) that computes rolling aggregations in near-real-time and writes directly to the online store within seconds. Batch features are periodically recomputed from the offline store on a schedule (hourly/daily) and materialized; streaming features bypass the batch cycle entirely and require separate freshness SLAs, often measured in seconds to minutes rather than hours.

What is feature drift and how should a production feature pipeline detect and respond to it?

Feature drift is a shift in the statistical distribution of a feature over time (mean, variance, null rate, category proportions) that can silently degrade model performance. A production pipeline should compute distribution statistics on each ingestion batch, compare them against a reference (training-time) distribution using PSI or KS-test, and trigger alerts or halt materialization when drift exceeds defined thresholds — acting as a leading indicator before model performance metrics degrade.

What does a `FeatureView` in Feast define and what are its key components?

A Feast `FeatureView` is a logical metadata definition that groups related features derived from a single data source. Its key components are: (1) one or more entities (defining the join key), (2) a data source (offline table or stream), (3) a feature schema (names and dtypes), and (4) an optional TTL specifying how long online store values remain valid before expiry. It is the unit of registration, versioning, and materialization in Feast.

user_fv = FeatureView(
    name="user_stats",
    entities=[user],
    ttl=timedelta(days=7),
    schema=[Field(name="purchase_count", dtype=Int64),
            Field(name="avg_order_value", dtype=Float32)],
    source=bigquery_source,
)
What is the primary challenge with point-in-time joins when different feature tables are updated at different cadences?

When features update at different cadences (e.g., a user profile refreshed daily, click-stream features updated per event), the as-of join must independently find the latest value before the label timestamp for each feature source. This requires sorted merge joins on the entity+timestamp dimension per table and becomes expensive at scale without range partitioning, sparse indexing on the time dimension, or pre-sorting by entity key and timestamp.

What is the primary value of a feature registry in a large ML organization?

A feature registry is a centralized metadata catalog storing definitions, owners, entity keys, lineage, and statistics for all registered features. Its primary value is discoverability and reuse: data scientists can search the registry for existing features instead of re-engineering them, reducing engineering duplication, ensuring consistent semantics across teams, and enabling governance workflows like impact analysis when upstream data sources change.

How would you backfill two years of historical values for a newly registered feature in Feast?

Define the `FeatureView` with the data source pointing to the historical offline table containing two years of data. Run `feast materialize` with the desired date range; the command reads from the offline data source and writes the latest entity feature values to the online store. Training datasets spanning the full 2-year history are generated directly via `get_historical_features`, which queries the offline source without requiring prior materialization.

feast materialize 2024-01-01T00:00:00 2026-06-26T00:00:00
What is the dual-write consistency problem in feature stores and how is it typically mitigated?

When a feature pipeline must write to both the offline store (for training reproducibility) and the online store (for serving), a crash between the two writes leaves them inconsistent. Common mitigations include: (1) treating the offline store as the source of truth and deriving the online store via a reliable materialization job, (2) write-ahead logging before dual writes, or (3) using an event-sourcing approach where a single Kafka topic fans out to both stores independently.

What is the Population Stability Index (PSI) and how is it applied in feature monitoring pipelines?

PSI quantifies distribution shift between a reference (training-time) window and a production window by comparing binned frequency distributions: PSI = Σ (Ai − Ei) × ln(Ai / Ei), where Ai is the actual proportion in bin i and Ei is the expected (reference) proportion. A PSI < 0.1 signals negligible shift; 0.1–0.2 warrants monitoring; > 0.2 signals significant drift requiring investigation. Feature store monitoring pipelines compute PSI on each ingestion batch and trigger alerts or pipeline circuit-breakers when thresholds are breached.

How does Amazon SageMaker Feature Store differ architecturally from Feast?

SageMaker Feature Store is a fully managed service deeply integrated with the AWS ecosystem — it uses S3 for the offline store, a managed in-memory online store (backed by DynamoDB internally), and integrates with Glue and Athena for discovery — requiring no infrastructure management but tying you to AWS. Feast is an open-source, storage-agnostic orchestration framework supporting multiple cloud backends; users are responsible for provisioning and operating the underlying offline and online stores themselves.

What are the trade-offs of setting the online store TTL too low versus too high in a feature store?

Too low a TTL causes cache misses when the materialization cadence is slower than the TTL window, forcing the serving layer to fall back to default values or error — degrading prediction quality for legitimate but infrequent entities. Too high a TTL allows stale feature values (e.g., 'days since last purchase' computed weeks ago) to be served to inactive entities long after the data is no longer representative, producing incorrect predictions without any observable failure signal.

How can a feature store serve embedding features for a retrieval-augmented generation (RAG) system?

Pre-computed embeddings (e.g., document or user BERT embeddings) are stored as vector-typed features in the online store, materialized from an offline batch pipeline that runs the encoder model. At inference time, the feature store retrieves the stored embedding for the given entity key; this embedding is then passed to an ANN index (FAISS, ScaNN, Pinecone) for candidate retrieval before augmenting the LLM prompt. The feature store handles versioning, freshness monitoring, and serving — the ANN index handles similarity search — keeping concerns cleanly separated.

What is feature lineage and why is it critical for ML governance and regulatory compliance?

Feature lineage is the traceable chain from raw data sources through all transformation steps to the final feature values consumed by a model. It enables impact analysis (which models break if an upstream table changes schema), reproducibility of training datasets for audits, and regulatory explainability (e.g., knowing exactly what data influenced a credit scoring decision under GDPR or FCRA requirements).

How does Hopsworks differ from Feast in its approach to feature transformation consistency?

Hopsworks provides built-in transformation functions registered via a Python `@udf` decorator alongside the feature group; these are applied server-side at both training-dataset export and online serving time, enforcing consistency without user intervention. Feast historically delegated transformations to external pipelines (Spark, dbt) and stored pre-computed results, though it later introduced on-demand feature views for lightweight Python transformations applied at serving time — still requiring the user to manage transformation consistency.

What is an on-demand feature view in Feast and when is it the appropriate abstraction?

An on-demand feature view computes features at request time using a registered Python function that receives both pre-fetched stored features and real-time request context as inputs. It is appropriate when a feature depends on context unavailable until inference (e.g., distance between a user's stored home coordinates and the current GPS location in the request) — values that cannot be precomputed and stored without knowing the real-time input.

@on_demand_feature_view(
    sources=[user_location_fv],
    schema=[Field(name="distance_km", dtype=Float64)],
)
def compute_distance(inputs: pd.DataFrame) -> pd.DataFrame:
    return pd.DataFrame({
        "distance_km": haversine(
            inputs["home_lat"], inputs["home_lon"],
            inputs["req_lat"],  inputs["req_lon"]
        )
    })
What is the Kappa architecture and what specific advantage does it offer over Lambda for feature pipelines?

Kappa architecture processes all data — both real-time and historical — through a single streaming pipeline (e.g., Kafka + Flink) by replaying historical events through the same job used for live data. For feature pipelines, this eliminates the dual-maintenance burden of Lambda (separate batch and streaming codebases implementing the same logic), ensuring the features produced for training dataset backfill are computed by exactly the same code as live serving features.

How should a streaming feature pipeline handle late-arriving data when computing sliding-window aggregations?

Use event-time watermarks in the stream processor (e.g., Flink's `WatermarkStrategy`) to define the maximum tolerated lateness; windows re-trigger and emit corrected results when late events arrive within that threshold. Updated feature values must be re-materialized to the online store; for the offline store you must decide whether to retroactively correct historical records (using Hudi or Delta Lake upserts) or accept a 'best-effort at write-time' semantic for training data.

What entity key design strategies prevent hot-partition problems in a distributed online feature store?

Hot partitioning occurs when high-cardinality but skewed keys (e.g., a viral entity dominating traffic) overload a small subset of shards. Mitigation strategies include: consistent hashing with virtual nodes to spread load evenly, key salting for pathologically hot entities (appending a random suffix and reading N replicas), pre-splitting shards for known high-traffic keys, and using composite entity keys (user_id + session_id) to distribute requests across more buckets.

How does a Hopsworks FeatureGroup differ from a Feast FeatureView in terms of data ownership?

A Hopsworks `FeatureGroup` is a managed storage unit that directly owns its data — it maps to a physical table in Hopsworks' online store (RonDB) and offline store (Apache Hudi on S3), with the platform managing ingestion, upserts, and schema evolution. A Feast `FeatureView` is a logical metadata definition that points to an external data source (e.g., a BigQuery table owned and operated externally) — Feast orchestrates reads and materializations but does not own the underlying data.

What is the correct strategy for deploying a breaking schema change (e.g., changing a feature's dtype) in a production feature store?

Breaking changes should be deployed as a new feature version (e.g., `user_features_v2`) rather than modifying the existing definition in place. This allows models already consuming `v1` to continue operating without disruption while new models are developed against `v2`. After a monitored deprecation period with confirmed zero consumers, the old version can be decommissioned. Modifying in-place risks breaking running inference pipelines that have not been migrated.

What storage format is used for the offline store in production and why are Delta Lake or Apache Hudi preferred over plain Parquet?

Parquet is the base format for the offline store due to its columnar layout, strong compression, and predicate pushdown for efficient historical scans. Delta Lake and Apache Hudi are preferred on top of Parquet because they add ACID transactions, upsert support (critical for correcting late-arriving or revised feature values), schema evolution, and time-travel queries — capabilities that plain Parquet lacks and that are essential for maintaining a reliable training dataset history.

What is the cold start problem in feature serving and what mitigation strategies does a feature store support?

The cold start problem occurs when a new entity (e.g., a first-time user) has no materialized feature values in the online store, causing the model to receive nulls or hard-coded defaults it was not trained to handle robustly. Feature store-level mitigations include: (1) training the model with artificially null-filled examples using data augmentation, (2) registering cohort-level aggregate features (global or segment means) as fallback values served when per-entity values are missing, and (3) pre-populating the online store with prior values derived from similar entities.

How does Tecton's approach to the feature lifecycle differ from an open-source feature store like Feast?

Tecton is a fully managed feature platform that compiles Python feature definitions into production-grade Spark/Flink pipelines, manages materialization scheduling, monitors freshness and drift, and operates the online serving infrastructure with SLA guarantees. Feast is a lightweight open-source orchestration layer where users must independently manage compute (Spark clusters), schedule materialization jobs, monitor freshness, and operate the Redis/DynamoDB online store; Tecton abstracts all of this away at the cost of vendor lock-in.

What is Apache Hudi's Merge-On-Read (MOR) table type and what trade-off does it introduce for a feature store offline store?

In MOR mode, Hudi writes incremental updates as delta log files appended alongside base Parquet files, deferring the merge to read time via a compaction step. For a feature store offline store this enables high-throughput, low-latency upserts (important for correcting late-arriving feature values) without rewriting entire Parquet partitions. The trade-off is slightly higher read latency versus Copy-On-Write (COW) mode, which merges at write time producing clean Parquet files but with higher write amplification.

How would you architect a sub-10ms feature retrieval system for a real-time fraud detection model serving 100K RPS?

Deploy Redis Cluster with consistent hashing for the online store, pre-materializing features for card_id, user_id, and merchant_id entities. Co-locate the feature server in the same availability zone as the model to minimize network RTT. Use batch `MGET` to fetch all entity keys in a single round-trip per inference request. Scale read throughput with read replicas and connection pooling, and serve default feature vectors for cache misses to avoid latency spikes from cold starts.

# Batch multi-get: all entity features in one Redis round-trip
keys = [f"user:{uid}", f"card:{cid}", f"merchant:{mid}"]
values = redis_client.mget(keys)  # single network call
What signals constitute comprehensive observability for a production feature store system?

Production feature store observability requires monitoring across three layers: (1) pipeline health — materialization job success/failure rate, end-to-end ingestion lag; (2) data quality — null rate per feature, distribution drift (PSI/KS-test), schema violations, out-of-range values; (3) serving health — online store P99 read latency, cache hit rate, and entity miss rate. Anomalies in these signals are leading indicators of model degradation, often surfacing days before downstream business metrics show impact.

How does Vertex AI Feature Store's online serving via Bigtable differ from its offline store in BigQuery, and what consistency model applies?

Vertex AI Feature Store's online store is backed by Bigtable, providing single-digit millisecond point lookups per entity row for inference. The offline store is BigQuery, used for large-scale training dataset exports. The two stores are eventually consistent: features are ingested to BigQuery first; the Bigtable online store is populated asynchronously via scheduled or streaming sync. Google does not provide transactional consistency across both stores — callers must tolerate a propagation delay of seconds to minutes between a write and its availability in Bigtable.

How should high-dimensional embedding vectors (e.g., 768-dim BERT embeddings) be stored and efficiently retrieved in a production feature store for a recommendation system?

Store embeddings as fixed-length float arrays or serialized byte blobs in the online store (Redis HSET or a vector database like pgvector/Pinecone). The feature store materializes them from a batch encoder pipeline, versioning the embedding model alongside the feature definition. At serving time, the feature store retrieves the entity's stored embedding in one call; a separate ANN index (FAISS, ScaNN) then performs nearest-neighbor search. Keeping the feature store and ANN index responsibilities separate maintains clean operability and independent scalability.

import numpy as np
# Store 768-dim embedding as byte blob
emb = np.array([...], dtype=np.float32)
redis_client.hset(f"user:{user_id}", "bert_emb", emb.tobytes())

# Retrieve and deserialize for ANN search
raw = redis_client.hget(f"user:{user_id}", "bert_emb")
vec = np.frombuffer(raw, dtype=np.float32)  # shape: (768,)

Put it into practice with AI Learning

This topic — and hundreds more — comes from our free, offline AI Learning app. Practice Q&A, quizzes and cheat sheets anywhere, no account needed.

  • Free
  • No account
  • Works offline
Coming soon toGoogle Play