ML Platform / MLOps interview preparation

ML Platform and MLOps Engineer Interview Questions

15 selected ML platform and MLOps interview questions grouped by seniority level. Use them to review fundamentals, practical trade-offs, and senior-level production reasoning.

Start a ML Platform / MLOps AI InterviewNo credit card required. 1 free session available.
Technical interview practice in EnglishA mode where non-native speakers can practice passing technical interviews.

Junior questions

1Explain what a data contract is in a production ML platform and why it matters for model reliability.

In a production ML platform, a data contract is a formal, versioned agreement between data producers (such as upstream application services, event loggers, or data engineering pipelines) and data consumers (such as ML engineers, feature pipelines, and models). Beyond standard database schemas (column names and primitive types), a data contract explicitly specifies semantic expectations, including allowed value ranges, categorical vocabularies, nullability constraints, freshness SLAs, volume baselines, and clear team ownership. Data contracts are critical for ML reliability because machine learning models fail silently. While traditional software systems often throw explicit exceptions when schemas break or payloads change unexpectedly, ML pipelines and downstream models will happily accept shifted or malformed inputs, producing degraded predictions, scoring hallucinations, or severe business anomalies without alerting standard operational monitors. Establishing enforceable contracts prevents unexpected breaking changes at the ingestion boundary, minimizes training-serving skew, and enforces producer-side accountability for upstream data quality.

contract_version: "2.1.0"
dataset_name: "user_engagement_events"
owner: "growth_platform_team"
consumers:
  - "recommendation_feature_store"
  - "churn_model_training_pipeline"
sla:
  freshness_minutes: 30
  min_daily_volume: 500000
schema:
  - name: user_id
    type: string
    nullable: false
  - name: interaction_type
    type: string
    nullable: false
    allowed_values: ["click", "impression", "save", "share"]
  - name: duration_seconds
    type: integer
    nullable: true
    constraints:
      min: 0
      max: 86400
breaking_change_policy:
  major_bump: ["field_removed", "type_changed", "allowed_values_narrowed"]
  minor_bump: ["field_added_nullable", "allowed_values_expanded"]
Try answering this question with an AI coach

2Explain data quality checks that go beyond schema validation and how you would decide which checks should block a training or serving pipeline.

Data quality checks beyond schema validation verify statistical distributions, business semantics, and dataset integrity. Key categories include: 1. Null and Missingness Rates: Monitoring percentage of missing values against historical baselines. 2. Range and Domain Constraints: Ensuring numerical features fall within valid boundaries (e.g., age between 0 and 120, probability in [0, 1]) and categorical fields belong to expected vocabularies. 3. Volume and Freshness Checks: Verifying record counts, partition arrival timestamps, and partition completeness. 4. Referential Integrity and Uniqueness: Checking primary key uniqueness and foreign key join match rates. 5. Statistical and Distributional Drift: Measuring population stability index (PSI), Jensen-Shannon divergence, or mean/variance shifts across partitions. Deciding whether a check should block a pipeline depends on failure criticality, blast radius, and whether the system can degrade gracefully: - Blocking Checks (Hard Gates): Halt training or feature ingestion when errors are unrecoverable or invalidate model math. Examples: 0-record partitions, missing entity primary keys, severe volume drops (>30%), or corrupted target labels. - Non-Blocking Checks (Soft Warnings / Alerts): Log telemetry and fire on-call alerts without interrupting pipeline execution when the data remains usable. Examples: slight feature drift, expected seasonal volume dips, or non-critical feature null rate increases where fallback default values or imputation preserve tolerable model predictions.

quality_check_policy = {
    # Hard Blocking: Pipeline fails immediately; model retraining or feature push is aborted
    "blocking_rules": [
        {"check": "row_count > 10000", "severity": "FATAL", "action": "ABORT_JOB"},
        {"check": "user_id_null_rate == 0.0", "severity": "FATAL", "action": "ABORT_JOB"},
        {"check": "target_label_null_rate == 0.0", "severity": "FATAL", "action": "ABORT_JOB"}
    ],
    # Soft Non-Blocking: Metric logged, PagerDuty/Slack alert triggered, pipeline continues
    "warning_rules": [
        {"check": "device_type_null_rate < 0.05", "severity": "WARN", "action": "LOG_AND_NOTIFY"},
        {"check": "psi(income_distribution, baseline_income) < 0.2", "severity": "WARN", "action": "LOG_AND_NOTIFY"}
    ]
}
Try answering this question with an AI coach

3Explain the purpose of a feature store and distinguish online feature serving from offline feature generation.

A feature store is a centralized data platform designed to manage, store, discover, and serve machine learning features across training and inference workflows. Its primary goals are to encourage feature reuse across teams, eliminate duplicated engineering pipelines, and reduce train-serve skew by standardizing feature definitions. A core architectural concept of a feature store is the dual-storage pattern: 1. Offline Store (Feature Generation & Training): Built on analytical engines and distributed storage (e.g., Snowflake, BigQuery, S3/Parquet, Delta Lake). It is optimized for high-throughput batch processing, historical retention, and point-in-time correct (as-of) joins. Historical retrieval supports time-aware joins, but leak-free reconstruction also requires correct entity keys, event and availability history, transformation versions, and label cutoffs. An offline store does not automatically generate features; external pipelines may compute and populate them. 2. Online Store (Real-Time Inference Serving): Built on low-latency, high-availability key-value databases (e.g., Redis, DynamoDB, Cassandra). It is optimized for low-latency point lookups, with the actual latency dependent on the deployment and workload of the latest feature values keyed by entity IDs (e.g., user_id) to enrich real-time model scoring requests. A registry and compatible definitions can connect these environments, while ingestion and synchronization may be implemented by the feature platform or external pipelines. Capabilities vary by product.

Feature Definition: `user_30d_transaction_count`
                      |
      +---------------+---------------+
      |                               |
      v                               v
[Offline Store]                 [Online Store]
- Tech: BigQuery, Iceberg, S3   - Tech: Redis, DynamoDB
- Workload: High-throughput batch - Workload: Low-latency point lookups
- Retention: Multi-year history - Retention: Latest entity state
- Usage: Point-in-time training - Usage: Real-time inference scoring
Try answering this question with an AI coach

4Explain the difference between a feature definition, a feature value, a feature view, and an entity key in a production feature platform.

In a modern feature store or feature platform, these four concepts represent distinct layers of data modeling and system design: 1. Entity Key: The primary identifier (or set of composite keys) representing a domain concept or business object (e.g., `user_id`, `merchant_id`). It serves as the join key across data sources and the primary lookup key during inference. 2. Feature Definition: The logical metadata, schema specification, and computation logic declaring what a feature is, including its name, data type, and transformation logic (e.g., `user_30d_txn_sum` declared as `FLOAT32`). 3. Feature View: A logical abstraction grouping related feature definitions associated with specific entity keys and backed by data sources (batch, streaming, or on-demand). It defines ingestion settings, time semantics (event timestamp), and materialization behavior for both offline and online stores. 4. Feature Value: The concrete, materialized data instance for a specific entity key evaluated at a specific point in time (e.g., for `user_id = 1042` at `2023-10-01 12:00:00 UTC`, the feature value is `452.10`).

from feast import Entity, FeatureView, Field, FileSource
from feast.types import Float32, Int64

# 1. Entity Key definition
user = Entity(name="user", join_keys=["user_id"])

# 2 & 3. Feature View & Feature Definitions
user_stats_fv = FeatureView(
    name="user_stats_fv",
    entities=[user],
    schema=[
        Field(name="user_30d_txn_sum", dtype=Float32),  # Feature Definition
        Field(name="user_failed_logins_1h", dtype=Int64) # Feature Definition
    ],
    source=FileSource(path="s3://data/user_stats.parquet", timestamp_field="event_timestamp")
)

# 4. Feature Value: The row in storage (e.g., user_id=42, user_30d_txn_sum=150.0)
Try answering this question with an AI coach

5Explain data lineage in an ML platform and why lineage matters for debugging model quality regressions.

Data lineage in an ML platform is the structured record of the lifecycle and provenance of data, documenting how raw datasets are transformed, filtered, engineered into features, compiled into training sets, and consumed by specific model versions. Lineage is essential for debugging model quality regressions because ML degradation is frequently driven by upstream data defects rather than code bugs. When a model's performance drops, lineage enables backward root-cause analysis: engineers can trace backwards from the degraded model to inspect the exact dataset version, feature transformation logic, upstream ingestion batch, or schema change that introduced the issue. Conversely, lineage enables forward impact analysis: when a corrupted raw data partition or upstream logic error is discovered, engineers can trace forward to identify all downstream training sets, intermediate feature tables, and deployed models that were tainted and require retraining or rollback.

[Degraded Model v3.1] 
  └── Trained on: [Dataset: training_set_2025_04_01]
        └── Built from: [Feature View: user_features_v2 @ git_sha: abc1234]
              └── Source Table: [raw_user_events @ batch_2025_03_31]
                    └── Issue Found: Logging bug produced 40% zero-filled values
Try answering this question with an AI coach

6Explain what a model registry provides beyond storing serialized model artifacts.

A model registry is a centralized governance, versioning, and lifecycle management system for machine learning models. Unlike a standard artifact store (such as an S3 bucket, GCS bucket, or generic blob store) that merely holds serialized binary files (e.g., `.onnx`, `.pt`, or `.pkl`), a model registry acts as the operational control plane for models across the organization. A model registry provides several key capabilities beyond raw file storage: 1. Model Versioning & Logical Grouping: Organizes iterations under named model entities with semantic versioning, decoupling the logical model definition from individual run files. 2. Provenance and Lineage Metadata: Automatically links the model artifact to its training run, code commit (Git SHA), training dataset snapshot/data version, hyperparameters, training environment (container image, library versions), and author. 3. Evaluation Metrics & Governance Records: Stores validation metrics, fairness/bias audits, schema contracts (input/output signatures), and model cards alongside the artifact to verify release readiness. 4. Lifecycle Stage Transitions: Manages promotion stages (e.g., Experimental -> Staging -> Production -> Archived) with access control, validation gates, and mandatory human or automated approvals. 5. Deployment Traceability & Rollback: Serves as the single source of truth for CI/CD and serving infrastructure, enabling automated deployments and rapid rollback to the previous stable model version during production incidents.

{
  "model_name": "credit_risk_classifier",
  "version": "3.1.0",
  "artifact_uri": "s3://ml-artifacts/credit_risk/v3.1.0/model.onnx",
  "stage": "Production",
  "lineage": {
    "git_commit": "7f3c1a2",
    "dataset_snapshot_id": "features_2024_03_01_v2",
    "training_pipeline_run_id": "run_99412"
  },
  "evaluation_metrics": {
    "auc_roc": 0.923,
    "p99_latency_ms": 8.5
  },
  "schema": {
    "inputs": [{"name": "annual_income", "type": "float"}, {"name": "debt_ratio", "type": "float"}],
    "outputs": [{"name": "default_prob", "type": "float"}]
  },
  "governance": {
    "approved_by": "compliance_officer_1",
    "promoted_at": "2024-03-05T14:30:00Z"
  }
}
Try answering this question with an AI coach

7Explain the purpose of a rollback plan for model deployments and the state needed to roll back safely.

The purpose of a rollback plan for model deployments is to ensure service reliability, system availability, and business continuity. When a newly deployed model exhibits degraded predictive quality, latency regressions, runtime errors, or unexpected prediction shifts, a rollback plan provides a fast, deterministic procedure to revert traffic to a known good state with minimal disruption. To execute a safe rollback, the platform must preserve and coordinate several key states: 1. Model Artifact State: The previous model weights, binary files, and serialized pipeline objects stored immutably in a model registry or object store. 2. Runtime & Code Environment: The container image, inference serving code, and third-party runtime dependencies pinned to the previous release. 3. Feature & Preprocessing State: The exact feature definitions, transformation schemas, and feature store versions compatible with the previous model version. 4. Traffic Routing & Configuration State: Dynamic routing rules (e.g., API gateway, load balancer, or service mesh configurations) that enable instant traffic redirection without rebuilding infrastructure. 5. Fallback Mechanism: A deterministic default fallback (e.g., rule-based heuristic or static cached predictions) if both new and previous model instances experience failures.

apiVersion: networking.k8s.io/v1alpha3
kind: VirtualService
metadata:
  name: recommendation-model-router
spec:
  hosts:
    - recommendation-service
  http:
  - route:
    - destination:
        host: recommendation-service
        subset: v1-previous-stable
      weight: 100
    - destination:
        host: recommendation-service
        subset: v2-canary
      weight: 0
Try answering this question with an AI coach

Middle questions

8What does setting a random seed control in an ML experiment, and why can seeded runs still differ?

A seed initializes a particular pseudorandom generator; it can make initialization, shuffling, dropout and augmentation repeatable if those operations use that generator in the same order. I would seed Python, NumPy, framework generators and data-loader workers as applicable, and account for independently created generators. A seed does not make all execution deterministic: parallel floating-point reductions, nondeterministic kernels, asynchronous ordering, changed libraries and different hardware may change results. I would record software versions and hardware, enable supported deterministic algorithms, control data ordering and preserve the exact input data. Resuming an experiment also requires model and optimizer state, random-generator states and sampler/progress state, not merely the original seed. Deterministic execution can cost performance and still does not guarantee cross-platform bitwise equality. For scientific conclusions, I would additionally report variation across several seeds.

Try answering this question with an AI coach

9Train a model, register it in MLflow and expose predictions through FastAPI to a Streamlit interface.

Fit preprocessing and the estimator together, evaluate on held-out data, and log artifacts, metrics and reproducible configuration in MLflow. Register the accepted model and pin the deployment to an identifiable version. Let FastAPI validate inputs and call that artifact, and have Streamlit call the API. Add operational checks and a path to roll back model versions.

Try answering this question with an AI coach

10Compare batch feature pipelines and streaming feature pipelines for production ML use cases with different freshness, cost, and reliability requirements.

Batch pipelines process bounded datasets on a schedule or trigger, while streaming pipelines incrementally process arriving events. Choose from the required end-to-end freshness, data volume, state size, and recovery behavior. Batch jobs can run every few minutes or on demand; they do not inherently require hours of lag. Streaming can provide low latency but freshness still depends on ingestion, processing, and sink delays. Batch is often operationally simpler for large historical recomputations, but is not universally cheaper: incremental streaming can avoid repeated full scans, and managed or serverless systems change capacity costs. Compare measured cost for the actual workload. Both need schema validation, duplicate handling, and reliable publication. Streaming additionally makes event-time handling, late data, state recovery, and backpressure central concerns. A hybrid design often combines streaming recent activity with batch historical aggregates, using consistent definitions and explicit availability-time semantics across training and serving.

# Batch Pipeline: High throughput, periodic schedule, cost-efficient
def run_daily_batch_features(spark, date_str):
    df = spark.read.parquet(f"s3://lakehouse/events/date={date_str}")
    features = df.groupBy("user_id").agg({
        "purchase_amount": "sum",
        "login_count": "count"
    })
    features.write.parquet(f"s3://lakehouse/features/user_30d/date={date_str}")

# Streaming Pipeline: Low latency, 24/7 stateful execution, high operational cost
def run_streaming_features(kafka_stream):
    return (
        kafka_stream
        .withWatermark("event_time", "2 minutes")
        .groupBy(
            window("event_time", "10 minutes", "1 minute"),
            "user_id"
        )
        .count() # Real-time failed login velocity for fraud detection
    )
Try answering this question with an AI coach

11Reason about late-arriving and out-of-order events in feature pipelines and how they affect training data, labels, and online features.

In distributed stream processing and feature engineering, events often arrive out of sequence due to network latency, system outages, or client retries. Event time refers to the actual timestamp when an event occurred on the client or source device, whereas processing time is the timestamp when the ingestion or streaming engine processes that event. Watermarks represent estimated event-time progress; windowing and allowed-lateness policies determine how late events are updated, redirected, or discarded. They do not guarantee that no earlier event will ever arrive. Late-arriving and out-of-order events have significant operational and statistical impacts across feature systems: 1. Training Data and Temporal Leakage: When generating historical training datasets, feature assembly must respect both event-time cutoffs and what was actually available to serving at the historical decision time. A late event can have an old event timestamp but have arrived after the prediction, so an event-time-only as-of join can leak information. Preserve availability or observation history and transformation versions; processing timestamps can help establish availability but are not interchangeable with event time. 2. Label Generation: Many machine learning labels arrive with variable delays (e.g., conversion attribution, ad fraud chargebacks). If label joins do not account for late arrivals using appropriate observation/attribution windows, incomplete negative labels will introduce false-negative bias. 3. Online Features: In online feature stores, unordered stream writes can cause state corruption or overwrites if the storage backend naively overwrites state with older data. Online pipelines must use event-time-aware upserts, version checks, or commutative aggregation functions to prevent stale state overwrites.

import pandas as pd

# Prediction events (e.g., ad impressions at inference time)
observations = pd.DataFrame({
    'user_id': [101, 102],
    'pred_time': pd.to_datetime(['2023-10-01 10:00:00', '2023-10-01 10:30:00'])
})

# Feature updates with event-time timestamps
user_features = pd.DataFrame({
    'user_id': [101, 101, 102],
    'feature_time': pd.to_datetime([
        '2023-10-01 09:30:00',
        '2023-10-01 10:15:00',  # Occurs after observation 1 pred_time
        '2023-10-01 10:00:00'
    ]),
    'click_count_1h': [3, 5, 1]
})

# Backward as-of join guarantees only feature state known at pred_time is joined
training_set = pd.merge_asof(
    observations.sort_values('pred_time'),
    user_features.sort_values('feature_time'),
    left_on='pred_time',
    right_on='feature_time',
    by='user_id',
    direction='backward'
)
print(training_set[['user_id', 'pred_time', 'feature_time', 'click_count_1h']])
Try answering this question with an AI coach

12Explain the role of dead letter queues, idempotency, and checkpointing in real-time feature processing pipelines.

Checkpointing saves a consistent recovery position and operator state so a streaming job can replay input after failure. The actual guarantee depends on replayable sources, checkpoint configuration, and sink coordination: a consistent internal state does not automatically make external effects exactly once. Idempotent sinks make repeated application of the same logical event preserve the intended result. Deterministic replacement with a stable key can be idempotent, but an atomic upsert that increments a counter still double-counts retries. Use deduplication identifiers and atomic state changes, or a supported transactional sink. Timestamp comparisons need deterministic tie-breaking and do not solve arbitrary out-of-order aggregation. Dead-letter handling isolates invalid records with payload identifiers and failure reasons for investigation and controlled replay. Monitor its volume and affected entities, coordinate routing with source progress, and gate or degrade serving if dropped inputs make features unacceptably incomplete. A running main pipeline is not sufficient evidence of correct feature data.

def update_user_feature(redis_client, user_id: str, new_feature_val: float, event_timestamp: int):
    lua_script = """
    local current_ts = redis.call('HGET', KEYS[1], 'last_updated')
    if not current_ts or tonumber(ARGV[1]) > tonumber(current_ts) then
        redis.call('HSET', KEYS[1], 'feature_val', ARGV[2], 'last_updated', ARGV[1])
        return 1
    end
    return 0
    """
    # Atomic check-and-set: older replayed events are ignored
    return bool(redis_client.eval(lua_script, 1, f"user:{user_id}", event_timestamp, new_feature_val))
Try answering this question with an AI coach

Senior questions

13When should an inference service dispatch a partially filled batch?

I would dispatch a partial batch when waiting longer risks missing the earliest request's latency deadline, even if the batch is not full. The decision should reserve estimated inference and response time: remaining queue allowance is deadline minus current time minus predicted service and delivery time. Also dispatch when a maximum batching delay expires or the configured size/token/resource budget is reached. For variable-length inputs, bucket compatible requests and use token or memory budgets rather than only request count, since padding and one long item can hurt everyone. Under light load, short waits preserve responsiveness; under heavy load, fuller batches improve throughput but need admission control and bounded queues. I would tune using measured service-time curves and p95/p99 latency, not just accelerator utilization. Deadline-aware fairness prevents urgent large jobs or one tenant from starving others.

Try answering this question with an AI coach

14How would you diagnose distribution shift in a live prediction model before deciding whether to retrain?

First rule out schema changes, missing/default values, stale features, unit errors and logging changes. Compare current data with a seasonally appropriate reference using feature summaries, multivariate tests or a train-versus-live classifier, and inspect cohorts rather than only global averages. Examine prediction distributions, coverage and calibration. With mature representative labels, measure task loss and business outcomes over time; account for label delay and selection bias. A change in P(X), class prevalence P(Y), or P(Y|X) has different implications, and unlabeled drift alone does not prove performance degradation or identify concept drift. Localize the change to a source, segment or product event and quantify uncertainty. Fix broken pipelines first; consider recalibration, threshold changes, reweighting, routing or retraining according to the cause. Validate any replacement on recent leakage-free holdouts and stable cohorts, then canary with rollback and continued monitoring.

Try answering this question with an AI coach

15How would an inference dispatcher decide which GPU gets the next request batch when machines have different available capacity?

Filter candidates by model/version availability, accelerator compatibility and sufficient memory for weights, activations and any request-state cache. Estimate service cost from batch size and input/output characteristics, calibrated per GPU type; equal queue lengths do not imply equal waiting time. Choose the worker with the best predicted completion time subject to request deadlines, locality and tenant fairness, then reserve capacity atomically so concurrent dispatchers cannot all select the same apparently idle GPU. Form only compatible batches, with a maximum batching delay and memory budget. Update estimates from observed runtime and queue telemetry, accounting for model loading and interference. Bound queues and reject/defer overload rather than causing OOM or unbounded latency. Detect unhealthy workers, retry only when safe and cancel obsolete work. Evaluate throughput, tail latency, deadline misses and utilization across mixed workloads, not just aggregate GPU occupancy.

Try answering this question with an AI coach

Practice ML Platform / MLOps interviews on your phone

Answer out loud and get AI feedback in the iOS or Android app.

Scan to download