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.
You are building a linear_reg model in BigQuery ML to predict delivery_minutes from a table containing order_timestamp, distance_km, package_weight_kg, and warehouse_region. Your feature engineering pipeline must satisfy all of the following requirements:
order_timestamp into hour of day and day of week.distance_km and package_weight_kg.distance_km into 10 equal-frequency quantile bins, persisting training-set bin boundaries for ML.PREDICT.warehouse_region with the decomposed day of week.ML.TRANSFORM.Which BigQuery ML implementation should you use?
EXTRACT temporal features, ML.POLYNOMIAL_EXPAND, ML.QUANTILE_BUCKETIZE(distance_km, 10) OVER (), and ML.FEATURE_CROSS inside a SQL CTE within the CREATE MODEL ... AS SELECT query without a TRANSFORM clause, and reuse that same CTE as the input query to ML.PREDICT and ML.TRANSFORM.This approach places all temporal decomposition and BigQuery ML preprocessing calls inside a WITH Common Table Expression (CTE) in the CREATE MODEL ... AS SELECT query, omitting the TRANSFORM clause altogether.
ML.QUANTILE_BUCKETIZE(distance_km, 10) OVER () executes outside a TRANSFORM clause, BigQuery ML does not capture or persist the training-set quantile boundaries. Re-running the CTE during ML.PREDICT recomputes brand-new quantile boundaries from whatever batch of serving rows happens to be queried, causing severe training-serving skew and collapsing single-row predictions into a single bucket.ML.TRANSFORM: The ML.TRANSFORM table-valued function applies transformations saved inside a model's TRANSFORM clause. Calling ML.TRANSFORM on a model trained without a TRANSFORM clause returns an error.TRANSFORM, ML.PREDICT expects the already-transformed schema rather than raw table columns, forcing teams to maintain and synchronize duplicate SQL feature pipelines between training and serving.ML.TRANSFORM.EXTRACT or ML.BUCKETIZE with static thresholds), no training statistics needed to be persisted, and teams did not require ML.TRANSFORM to inspect or serve raw-schema data.TRANSFORM clause in the CREATE MODEL statement that applies EXTRACT on order_timestamp, ML.POLYNOMIAL_EXPAND on distance_km and package_weight_kg, ML.QUANTILE_BUCKETIZE(distance_km, 10) OVER (), and ML.FEATURE_CROSS on warehouse_region and the extracted day of week, while selecting the raw columns in the AS SELECT query.The TRANSFORM clause inside a CREATE MODEL statement embeds manual SQL and BigQuery ML preprocessing transformations directly into the model artifact. Because the preprocessing graph is stored alongside the learned weights, BigQuery ML automatically preserves fitted training statistics and replays identical transformations during evaluation, inspection, and inference.
EXTRACT expressions (such as EXTRACT(HOUR FROM order_timestamp) and EXTRACT(DAYOFWEEK FROM order_timestamp)) convert raw timestamps into discrete numerical or string temporal signals directly inside TRANSFORM.ML.POLYNOMIAL_EXPAND computes polynomial terms and interaction products from distance_km and package_weight_kg, enabling a linear model (linear_reg) to capture non-linear feature relationships.ML.QUANTILE_BUCKETIZE(distance_km, 10) OVER () operates as an ML analytic function using the required empty OVER () clause. Inside TRANSFORM, BigQuery ML computes the exact quantile boundaries across the training dataset, persists them in model metadata, and applies those identical cutoffs automatically during ML.PREDICT.ML.FEATURE_CROSS accepts a STRUCT containing warehouse_region and the extracted day-of-week string, generating explicit interaction features that capture region-specific weekly patterns.AS SELECT query and transformations live inside TRANSFORM, downstream teams can run ML.TRANSFORM against the model to inspect the exact preprocessed training and serving feature matrices.ML.PREDICT accepts raw input columns matching the TRANSFORM inputs.ML.TRANSFORM without duplicating feature SQL.Unlike precomputing features in a standalone SQL CTE, encapsulating transformations inside TRANSFORM guarantees consistent quantile cutoffs during inference and enables native ML.TRANSFORM inspection.
TRANSFORM clause in the CREATE MODEL statement that applies EXTRACT on order_timestamp, ML.POLYNOMIAL_EXPAND on distance_km and package_weight_kg, ML.QUANTILE_BUCKETIZE(distance_km, 10) OVER (PARTITION BY warehouse_region) for region-specific bins, and ML.FEATURE_CROSS on warehouse_region and the extracted day of week.Adding PARTITION BY warehouse_region inside OVER (...) for ML.QUANTILE_BUCKETIZE attempts to calculate separate equal-frequency distance quantile boundaries independently for each warehouse region rather than globally across the training dataset.
ML.QUANTILE_BUCKETIZE, ML.STANDARD_SCALER, and ML.MIN_MAX_SCALER—strictly require an empty OVER () clause. Including PARTITION BY, ORDER BY, or window framing specifications causes the CREATE MODEL statement to fail.TRANSFORM engine stores a single global set of fitted statistics (such as one array of quantile split points) per preprocessed column in model metadata rather than maintaining dynamic per-partition lookup tables keyed by categorical values.OVER () clause is mandatory both inside TRANSFORM and when invoking ML analytic functions in standalone queries.ML.QUANTILE_BUCKETIZE(...) OVER () bins with ML.FEATURE_CROSS rather than partitioning the analytic window.NTILE(10) OVER (PARTITION BY warehouse_region)) for ad-hoc exploratory analysis outside a TRANSFORM clause where persisted training boundaries and ML.TRANSFORM serving compatibility are not needed.TRANSFORM clause in the CREATE MODEL statement that applies EXTRACT on order_timestamp, ML.BUCKETIZE on distance_km with 10 fixed numeric split points, ML.POLYNOMIAL_EXPAND on distance_km and package_weight_kg, and ML.HASH_BUCKETIZE to combine warehouse_region and the extracted day of week.ML.BUCKETIZE is a scalar numerical preprocessing function that assigns continuous values into intervals defined by a hardcoded array of numeric split points. ML.HASH_BUCKETIZE is a categorical preprocessing function that maps a string expression into a fixed number of deterministic hash buckets.
ML.BUCKETIZE divides distance_km at manually chosen static thresholds rather than computing 10 equal-frequency quantile bins from the training distribution. For skewed distance data, fixed intervals can produce sparse or empty buckets, whereas ML.QUANTILE_BUCKETIZE adapts bin boundaries automatically to empirical quantiles.ML.HASH_BUCKETIZE accepts a single STRING expression and a bucket size to compress high-cardinality categories via hashing; it does not accept multiple columns to generate explicit pairwise feature crosses like ML.FEATURE_CROSS. Moreover, hashing introduces collisions that degrade interpretability in a linear_reg model.ML.BUCKETIZE is a stateless scalar function that operates row by row without collecting dataset-level statistics.ML.HASH_BUCKETIZE hashes a single string input into integer bucket IDs and cannot replace ML.FEATURE_CROSS(STRUCT(...)) for multi-feature interactions.ML.FEATURE_CROSS explicitly preserves distinct combinations of categorical inputs to learn interaction weights.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