PMLE Scaling Prototypes into ML Models Practice Question
You have a TensorFlow model that you want to deploy on Vertex AI for online prediction. The model requires a custom preprocessing step that transforms raw input features into the format expected by the model. You need to ensure that the same preprocessing is applied both during training and serving, and that it is maintained as part of the model artifact. What should you do?
⚠ Common exam trap
The trap here is thinking that any shared code or external service can guarantee consistency, when the most reliable method is to embed preprocessing directly into the model artifact.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Implement the preprocessing as a TensorFlow Transform (tf.Transform) preprocessing function and attach it to the model using a SavedModel signature.
Using tf.Transform to define preprocessing and attaching it to the SavedModel ensures that the same transformation is applied during both training and serving. The preprocessing becomes part of the model artifact, simplifying deployment and maintenance. Other options either risk inconsistency or add unnecessary complexity.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Write a separate Python script for preprocessing and include it in the custom container for both training and serving.
Why it's wrong here
Maintaining separate scripts for training and serving risks divergence over time. Even if initially identical, updates may not be synchronized. This approach does not embed preprocessing into the model artifact, making it harder to manage and version. It is not the best practice for ensuring consistency.
- ✗
Use Vertex AI Feature Store to store preprocessed features and serve them during prediction.
Why it's wrong here
Feature Store is designed for feature management and online serving of precomputed features, but it does not automatically apply the same transformation logic to raw input at prediction time. It would require a separate pipeline to update features, and the model would need to fetch them, which is not the same as embedding preprocessing.
- ✗
Perform preprocessing in a Cloud Function that triggers before sending data to the Vertex AI endpoint.
Why it's wrong here
Adding an external preprocessing step increases latency and complexity. It also creates a separate component that must be maintained and scaled independently. This does not guarantee that the same preprocessing is applied during training, as the training pipeline would need to replicate it. It is not integrated with the model artifact.
- ✓
Implement the preprocessing as a TensorFlow Transform (tf.Transform) preprocessing function and attach it to the model using a SavedModel signature.
Why this is correct
tf.Transform allows you to define preprocessing as part of the TensorFlow graph, ensuring consistency between training and serving. By exporting the transform function with the SavedModel, the preprocessing is encapsulated in the model artifact and automatically applied during online prediction. This is the recommended approach for maintaining preprocessing consistency.
Go deeper
Related to this question
About these practice questions
Courseiva writes every PMLE question from scratch — 775 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Google Cloud exam blueprint
This PMLE practice question is part of Courseiva's free Google Cloud certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the PMLE exam.