Prepare and test your skills

Prepare and test your skills

Free sample question with answers and detailed explanation below. The Professional Machine Learning Engineer practice bank has an additional 974 practice questions.Try 10 free realistic questions: instant score, no credit card, and no account required.
An ML engineering team is building a multi-terabyte fraud detection system that requires identical feature transformations across historical training data in Cloud Storage and real-time transaction events in Pub/Sub.
Requirements:
tf.Transform (MLTransform) to prevent training-serving skew.Which preprocessing architecture should the team implement on Google Cloud?
bigframes.ml.preprocessing (StandardScaler and OneHotEncoder) in BigQuery DataFrames for both batch training and real-time serving.bigframes.ml.preprocessing) DoesBigQuery DataFrames (bigframes.ml) provides a Python DataFrame and scikit-learn-style API that pushes data preparation, scaling (StandardScaler), encoding (OneHotEncoder), and model training directly into BigQuery compute slots without extracting datasets from the data warehouse.
tf.Transform Integration: bigframes.ml.preprocessing uses BigQuery ML and scikit-learn-style transformers rather than tf.Transform (MLTransform), failing the requirement to standardize features using tf.Transform artifacts.KBinsDiscretizer, StandardScaler, OneHotEncoder) on stored tables.PCollection directly into MLTransform configured in write mode for both the batch and streaming pipelines so tf.Transform dynamically updates normalization statistics per window.MLTransform in write Mode DoesMLTransform wraps tf.Transform preprocessing operations—such as ScaleToZScore and vocabulary generation—into a single Apache Beam transform. In write mode, it performs an analysis pass over the input collection to compute dataset-level statistics and emit reusable preprocessing artifacts.
MLTransform strictly requires pipelines and input PCollection objects to use default (GlobalWindows) windowing. Passing a PCollection configured with custom 15-minute sliding windows directly into MLTransform violates this requirement and causes pipeline execution failures.MLTransform in write mode inside a production streaming pipeline defeats the purpose of artifact persistence. Instead of applying the fixed mean, variance, and vocabulary learned during training, write mode recalculates new statistics on incoming data, causing feature distributions at serving time to diverge from what the model learned.write Mode Purpose: Intended for offline training preparation to generate minimum, maximum, mean, variance, and vocabulary artifacts.read Mode Purpose: Intended for evaluation, testing, and production inference by consuming previously generated artifacts.GlobalWindows() before invoking MLTransform.tensorflow_transform.MLTransform were executed in write mode exclusively during batch training on default global windows, and switched to read mode after re-windowing for evaluation and real-time serving.PTransform modules for both bounded and unbounded inputs, re-windowing aggregated features back to GlobalWindows before invoking MLTransform in write mode during batch training to export artifacts and in read mode during streaming inference.MLTransform Architecture IsUsing Apache Beam on Cloud Dataflow with shared PTransform modules and MLTransform provides a unified, distributed execution engine for both bounded batch and unbounded streaming feature engineering. MLTransform integrates TensorFlow Transform (tf.Transform) directly into Beam pipelines to compute full-pass dataset statistics and apply deterministic preprocessing.
MLTransform requires inputs to reside in the default single global window. Re-windowing the aggregated PCollection into GlobalWindows() prior to MLTransform satisfies this constraint cleanly.MLTransform in write mode during batch training computes dataset-wide z-score parameters (mean and variance) and token vocabularies, persisting them as immutable artifacts in Cloud Storage. Executing MLTransform in read mode within the streaming pipeline loads those exact frozen artifacts, guaranteeing identical numerical scaling and index mappings in production.PTransform libraries allows the same transformation graph to process bounded Cloud Storage files and unbounded Pub/Sub streams.tf.Transform artifacts version preprocessing parameters alongside trained model checkpoints.RunInference or downstream model training.Unlike DataFrame wrappers or warehouse-only SQL pipelines, this architecture combines low-latency streaming event-time windowing with frozen tf.Transform artifacts, eliminating training-serving skew while minimizing code duplication.
allow_non_parallel_operations() to compute (df - df.mean()) / df.std() and categorical encodings identically across both the batch and streaming pipelines without persisting tf.Transform artifacts.The Apache Beam DataFrames API (beam.dataframe) provides a Pandas-compatible interface for declaring distributed Beam pipelines. It translates familiar DataFrame operations into deferred Beam transformations that scale beyond the single-machine memory limits of standard Pandas.
(df - df.mean()) / df.std() directly in both batch and streaming pipelines calculates statistics independently rather than persisting and reusing frozen tf.Transform training artifacts, introducing severe training-serving skew.allow_non_parallel_operations(), which forces sequential execution bottlenecks and does not scale cleanly to unbounded streaming Pub/Sub inputs..mean() and .std() are designed for bounded tabular collections rather than unbounded sliding-window event streams.tf.Transform Artifacts: Does not automatically export SavedModel preprocessing graphs or write/read artifact directories.tf.Transform artifacts.Answer them yourself and get your score the moment you finish. No account needed.
Full access includes
Keep the momentum going with these hand-picked practice scenarios
Last updated Validated