MLOps interview question

MLOps & ProductionMLOpsExperiment Trackingmedium

Re-running the training job below from the same git commit one month later gives a validation AUC of 0.861 instead of the logged 0.874. The library versions, Docker image and seeds are all pinned. What is the most likely cause, and the fix?

python
# requirements.txt: scikit-learn==1.4.2, pandas==2.2.1
# image: trainer@sha256:9f1c0a...
SEED = 42
np.random.seed(SEED)

df = bq.query("""
    SELECT * FROM prod.transactions
    WHERE txn_date < CURRENT_DATE()
""").to_dataframe()
X, y = df[FEATURES], df["is_fraud"]

X_train, X_val, y_train, y_val = train_test_split(X, y, random_state=SEED)
model = GradientBoostingClassifier(random_state=SEED).fit(X_train, y_train)
auc = roc_auc_score(y_val, model.predict_proba(X_val)[:, 1])
mlflow.log_params(model.get_params())
mlflow.log_metric("val_auc", auc)
  1. AGradient boosting builds trees with multithreaded, non-deterministic split searches, so trees differ between runs; pin the thread count to one so repeated runs match.
  2. BSeeding NumPy does not seed scikit-learn's own generator, so the trees differ between runs; set a global seed through sklearn.set_config so repeated runs give identical models.
  3. CMLflow stores metrics as 32-bit floats and rounds them when logging, so the logged 0.874 is imprecise; log the metric as an artifact file so the exact original value is kept.
  4. DThe data is not versioned: CURRENT_DATE() now covers a month of extra rows plus late or backfilled records, so train on a fixed snapshot (date range, table snapshot, DVC).
Show the answer and explanation

Correct answer: D, The data is not versioned: CURRENT_DATE() now covers a month of extra rows plus late or backfilled records, so train on a fixed snapshot (date range, table snapshot, DVC).

Explanation MLOps

Reproducibility needs four things pinned: code (git commit), environment (locked dependencies, image digest), randomness (seeds) and data. This job pins the first three, but its query is relative to today. A month later txn_date < CURRENT_DATE() returns a month of extra rows, and the source table may also contain late-arriving or corrected records. The model was trained and validated on a different dataset, so a different AUC is expected.

Fixes:

  • Use an explicit, logged date range instead of CURRENT_DATE().
  • Snapshot the training data: a BigQuery table snapshot (time travel only reaches back up to 7 days), a versioned Parquet export, or DVC (git-like versioning of data files backed by cloud storage).
  • Add an ORDER BY on a unique key: BigQuery returns rows in no guaranteed order, and a seeded train_test_split only reproduces the split if the rows arrive in the same order.
  • Log the dataset version or hash, row count and query text with the run, e.g. as MLflow params or artifacts, so lineage is complete.

Why the other explanations fail: scikit-learn's GradientBoostingClassifier has no multithreaded split search; with its random_state set, as here, it builds the same trees from the same data, and train_test_split is seeded too. sklearn.set_config has no global seed option. MLflow logs metrics as double-precision numbers, and float rounding could never explain a 0.013 gap.

Interview tip: define reproducibility as "same code + same environment + same data + same seeds gives the same model", then name a concrete tool for each: git, lock files and image digests, DVC or warehouse snapshots, and seeds logged in the experiment tracker.

Practice it as a quiz

Answer this and the other free questions with instant grading, streaks and weak-topic tracking, or unlock all 4,000 questions.

More MLOps & Production questions

  1. Estimate the monthly LLM bill for this RAG chatbot workload. Every user turn is a separate API call that re-sends the full prompt.
  2. What does this symmetric INT8 quantization snippet print, and which statement about using an asymmetric (zero-point) scheme for ReLU outputs is correct?
  3. A telecom team adds a new feature, dropped_calls_7d, produced by a streaming job from network events starting today. To train on 18 months of history, past…
  4. A retailer's progressive-delivery pipeline shifts traffic to a new recommendation-API version in steps of 5% → 25% → 50% → 100%. At each step, automated…
  5. A telecom support bot on a self-hosted vLLM server sends a 3,000-token system prompt plus the growing chat history on every turn. After you enable automatic…