Google

Professional Machine Learning Engineer Free Practice Questions — Page 11

Question 102

You work for a large retailer, and you need to build a model to predict customer chum. The company has a dataset of historical customer data, including customer demographics purchase history, and website activity. You need to create the model in BigQuery ML and thoroughly evaluate its performance. What should you do?

A. Create a linear regression model in BigQuery ML, and register the model in Vertex AI Model Registry. Evaluate the model performance in Vertex AI .
B. Create a logistic regression model in BigQuery ML and register the model in Vertex AI Model Registry. Evaluate the model performance in Vertex AI .
C. Create a linear regression model in BigQuery ML. Use the ML.EVALUATE function to evaluate the model performance.
D. Create a logistic regression model in BigQuery ML. Use the ML.CONFUSION_MATRIX function to evaluate the model performance.
Show Answer
Correct Answer: B
Explanation:
Customer churn prediction is a binary classification problem (churn vs. not churn), so logistic regression is the appropriate model, not linear regression. BigQuery ML supports logistic regression for this use case. The question also emphasizes thoroughly evaluating model performance, which goes beyond a single metric like a confusion matrix in BigQuery ML. Registering the model in Vertex AI Model Registry and evaluating it in Vertex AI enables more comprehensive evaluation (e.g., ROC-AUC, precision/recall analysis, experiment tracking, and model management), making option B the best choice.

Question 103

You are using Vertex AI and TensorFlow to develop a custom image classification model. You need the model’s decisions and the rationale to be understandable to your company’s stakeholders. You also want to explore the results to identify any issues or potential biases. What should you do?

A. 1. Use TensorFlow to generate and visualize features and statistics. 2. Analyze the results together with the standard model evaluation metrics.
B. 1. Use TensorFlow Profiler to visualize the model execution. 2. Analyze the relationship between incorrect predictions and execution bottlenecks.
C. 1. Use Vertex Explainable AI to generate example-based explanations. 2. Visualize the results of sample inputs from the entire dataset together with the standard model evaluation metrics.
D. 1. Use Vertex Explainable AI to generate feature attributions. Aggregate feature attributions over the entire dataset. 2. Analyze the aggregation result together with the standard model evaluation metrics.
Show Answer
Correct Answer: D
Explanation:
The goal is to make model decisions understandable to stakeholders and to explore results for issues or bias. Vertex Explainable AI feature attributions show which parts of an image contribute most to predictions, directly explaining the model’s rationale. Aggregating these attributions across the full dataset reveals systematic patterns and potential biases that are not visible from single examples alone. Analyzing these insights alongside standard evaluation metrics provides both interpretability and performance context. Other options focus on performance profiling or isolated examples, which are less suitable for overall interpretability and bias analysis.

Question 104

You work for a retail company that is using a regression model built with BigQuery ML to predict product sales. This model is being used to serve online predictions. Recently you developed a new version of the model that uses a different architecture (custom model). Initial analysis revealed that both models are performing as expected. You want to deploy the new version of the model to production and monitor the performance over the next two months. You need to minimize the impact to the existing and future model users. How should you deploy the model?

A. Import the new model to the same Vertex AI Model Registry as a different version of the existing model. Deploy the new model to the same Vertex AI endpoint as the existing model, and use traffic splitting to route 95% of production traffic to the BigQuery ML model and 5% of production traffic to the new model.
B. Import the new model to the same Vertex AI Model Registry as the existing model. Deploy the models to one Vertex AI endpoint. Route 95% of production traffic to the BigQuery ML model and 5% of production traffic to the new model.
C. Import the new model to the same Vertex AI Model Registry as the existing model. Deploy each model to a separate Vertex AI endpoint.
D. Deploy the new model to a separate Vertex AI endpoint. Create a Cloud Run service that routes the prediction requests to the corresponding endpoints based on the input feature values.
Show Answer
Correct Answer: A
Explanation:
To minimize impact on existing users while monitoring the new model, the best approach is to deploy both models to the same Vertex AI endpoint and use traffic splitting. Registering the new model as a different version in the same Model Registry enables clean version management. Traffic splitting (e.g., 95% old, 5% new) allows a controlled canary rollout, real production monitoring over time, and easy rollback, all without requiring any changes from existing clients.

Question 105

You are building a custom image classification model and plan to use Vertex AI Pipelines to implement the end-to-end training. Your dataset consists of images that need to be preprocessed before they can be used to train the model. The preprocessing steps include resizing the images, converting them to grayscale, and extracting features. You have already implemented some Python functions for the preprocessing tasks. Which components should you use in your pipeline?

A. DataprocSparkBatchOp and CustomTrainingJobOp
B. DataflowPythonJobOp, WaitGcpResourcesOp, and CustomTrainingJobOp
C. dsl.ParallelFor, dsl.component, and CustomTrainingJobOp
D. ImageDatasetImportDataOp, dsl.component, and AutoMLImageTrainingJobRunOp
Show Answer
Correct Answer: B
Explanation:
For a custom image classification pipeline with Python-based preprocessing, you need a component that can run scalable preprocessing code and then trigger custom training. DataflowPythonJobOp is well-suited for distributed image preprocessing tasks like resizing, grayscale conversion, and feature extraction using Python. WaitGcpResourcesOp is typically used to ensure the Dataflow job completes before downstream steps. CustomTrainingJobOp is required to train a custom model. Other options either target Spark, AutoML, or require more manual orchestration without clear benefit.

Question 106

You need to use TensorFlow to train an image classification model. Your dataset is located in a Cloud Storage directory and contains millions of labeled images. Before training the model, you need to prepare the data. You want the data preprocessing and model training workflow to be as efficient, scalable, and low maintenance as possible. What should you do?

A. 1. Create a Dataflow job that creates sharded TFRecord files in a Cloud Storage directory. 2. Reference tf.data.TFRecordDataset in the training script. 3. Train the model by using Vertex AI Training with a V100 GPU.
B. 1. Create a Dataflow job that moves the images into multiple Cloud Storage directories, where each directory is named according to the corresponding label 2. Reference tfds.folder_dataset:ImageFolder in the training script. 3. Train the model by using Vertex AI Training with a V100 GPU.
C. 1. Create a Jupyter notebook that uses an nt-standard-64 V100 GPU Vertex AI Workbench instance. 2. Write a Python script that creates sharded TFRecord files in a directory inside the instance. 3. Reference tf.data.TFRecordDataset in the training script. 4. Train the model by using the Workbench instance.
D. 1. Create a Jupyter notebook that uses an n1-standard-64, V100 GPU Vertex AI Workbench instance. 2. Write a Python script that copies the images into multiple Cloud Storage directories, where each. directory is named according to the corresponding label. 3. Reference tfds.foladr_dataset.ImageFolder in the training script. 4. Train the model by using the Workbench instance.
Show Answer
Correct Answer: A
Explanation:
For millions of images, preprocessing must be highly scalable and low maintenance. Using Dataflow to create sharded TFRecord files in Cloud Storage enables distributed, parallel preprocessing and efficient I/O during training. TFRecordDataset is the most performant and scalable input pipeline for TensorFlow. Storing data in Cloud Storage and training with Vertex AI Training (rather than a single Workbench instance) provides managed, scalable infrastructure and avoids local bottlenecks. Folder-based datasets and single-instance preprocessing do not scale as well.

Question 107

You are using Keras and TensorFlow to develop a fraud detection model. Records of customer transactions are stored in a large table in BigQuery. You need to preprocess these records in a cost-effective and efficient way before you use them to train the model. The trained model will be used to perform batch inference in BigQuery. How should you implement the preprocessing workflow?

A. Implement a preprocessing pipeline by using Apache Spark, and run the pipeline on Dataproc. Save the preprocessed data as CSV files in a Cloud Storage bucket.
B. Load the data into a pandas DataFrame. Implement the preprocessing steps using pandas transformations, and train the model directly on the DataFrame.
C. Perform preprocessing in BigQuery by using SQL. Use the BigQueryClient in TensorFlow to read the data directly from BigQuery.
D. Implement a preprocessing pipeline by using Apache Beam, and run the pipeline on Dataflow. Save the preprocessed data as CSV files in a Cloud Storage bucket.
Show Answer
Correct Answer: C
Explanation:
BigQuery is already the system of record for the transaction data and is optimized for large-scale SQL-based preprocessing at low cost. Performing feature engineering directly in BigQuery avoids data movement and additional infrastructure. TensorFlow can then read the processed data efficiently using the BigQuery client, and the same preprocessing logic aligns naturally with batch inference in BigQuery. The other options add unnecessary cost, complexity, or scalability issues.

Question 108

You are investigating the root cause of a misclassification error made by one of your models. You used Vertex AI Pipelines to train and deploy the model. The pipeline reads data from BigQuery. creates a copy of the data in Cloud Storage in TFRecord format, trains the model in Vertex AI Training on that copy, and deploys the model to a Vertex AI endpoint. You have identified the specific version of that model that misclassified, and you need to recover the data this model was trained on. How should you find that copy of the data?

A. Use Vertex AI Feature Store. Modify the pipeline to use the feature store, and ensure that all training data is stored in it. Search the feature store for the data used for the training.
B. Use the lineage feature of Vertex AI Metadata to find the model artifact. Determine the version of the model and identify the step that creates the data copy and search in the metadata for its location.
C. Use the logging features in the Vertex AI endpoint to determine the timestamp of the model’s deployment. Find the pipeline run at that timestamp. Identify the step that creates the data copy, and search in the logs for its location.
D. Find the job ID in Vertex AI Training corresponding to the training for the model. Search in the logs of that job for the data used for the training.
Show Answer
Correct Answer: B
Explanation:
Vertex AI Metadata lineage tracks relationships between pipeline steps and artifacts. By following the lineage from the specific model version, you can identify the exact pipeline run and the component that created the TFRecord data copy, along with its Cloud Storage location. This is the intended and reliable way to recover historical training data for a given model version.

Question 109

You recently trained a XGBoost model that you plan to deploy to production for online inference. Before sending a predict request to your model’s binary, you need to perform a simple data preprocessing step. This step exposes a REST API that accepts requests in your internal VPC Service Controls and returns predictions. You want to configure this preprocessing step while minimizing cost and effort. What should you do?

A. Store a pickled model in Cloud Storage. Build a Flask-based app, package the app in a custom container image, and deploy the model to Vertex AI Endpoints.
B. Build a Flask-based app, package the app and a pickled model in a custom container image, and deploy the model to Vertex AI Endpoints.
C. Build a custom predictor class based on XGBoost Predictor from the Vertex AI SDK, package it and a pickled model in a custom container image based on a Vertex built-in image, and deploy the model to Vertex AI Endpoints.
D. Build a custom predictor class based on XGBoost Predictor from the Vertex AI SDK, and package the handler in a custom container image based on a Vertex built-in container image. Store a pickled model in Cloud Storage, and deploy the model to Vertex AI Endpoints.
Show Answer
Correct Answer: D
Explanation:
Option D best minimizes cost and effort while meeting the requirements. Using a custom predictor based on the Vertex AI XGBoost Predictor avoids building and maintaining a full Flask app, reducing development and operational overhead. Basing the image on a Vertex built‑in container leverages managed serving features and compatibility with Vertex AI Endpoints. Storing the pickled model in Cloud Storage keeps the container image small and allows updating the model independently without rebuilding or redeploying the container, which is more efficient and cost‑effective for production online inference within VPC Service Controls.

Question 110

You work for a telecommunications company. You’re building a model to predict which customers may fail to pay their next phone bill. The purpose of this model is to proactively offer at-risk customers assistance such as service discounts and bill deadline extensions. The data is stored in BigQuery and the predictive features that are available for model training include: - Customer_id - Age - Salary (measured in local currency) - Sex - Average bill value (measured in local currency) - Number of phone calls in the last month (integer) - Average duration of phone calls (measured in minutes) You need to investigate and mitigate potential bias against disadvantaged groups, while preserving model accuracy. What should you do?

A. Determine whether there is a meaningful correlation between the sensitive features and the other features. Train a BigQuery ML boosted trees classification model and exclude the sensitive features and any meaningfully correlated features.
B. Train a BigQuery ML boosted trees classification model with all features. Use the ML.GLOBAL_EXPLAIN method to calculate the global attribution values for each feature of the model. If the feature importance value for any of the sensitive features exceeds a threshold, discard the model and tram without this feature.
C. Train a BigQuery ML boosted trees classification model with all features. Use the ML.EXPLAIN_PREDICT method to calculate the attribution values for each feature for each customer in a test set. If for any individual customer, the importance value for any feature exceeds a predefined threshold, discard the model and train the model again without this feature.
D. Define a fairness metric that is represented by accuracy across the sensitive features. Train a BigQuery ML boosted trees classification model with all features. Use the trained model to make predictions on a test set. Join the data back with the sensitive features, and calculate a fairness metric to investigate whether it meets your requirements.
Show Answer
Correct Answer: D
Explanation:
To investigate and mitigate bias while preserving accuracy, you should explicitly measure fairness rather than removing features upfront. Training the model with all features establishes a strong baseline. Making predictions on a test set and then joining back sensitive attributes allows you to compute fairness metrics (such as accuracy parity or error rates) across groups defined by age, sex, or salary. This directly assesses whether disadvantaged groups are treated unfairly and supports iterative mitigation if needed. The other options either remove features prematurely or rely on feature attribution, which does not directly measure discriminatory outcomes.

Question 111

You are building a MLOps platform to automate your company’s ML experiments and model retraining. You need to organize the artifacts for dozens of pipelines. How should you store the pipelines’ artifacts?

A. Store parameters in Cloud SQL, and store the models’ source code and binaries in GitHub.
B. Store parameters in Cloud SQL, store the models’ source code in GitHub, and store the models’ binaries in Cloud Storage.
C. Store parameters in Vertex ML Metadata, store the models’ source code in GitHub, and store the models’ binaries in Cloud Storage.
D. Store parameters in Vertex ML Metadata and store the models’ source code and binaries in GitHub.
Show Answer
Correct Answer: C
Explanation:
An MLOps platform should separate concerns using services designed for each artifact type. Vertex ML Metadata is purpose-built to track ML experiment metadata, parameters, lineage, and pipeline executions at scale. GitHub is appropriate for version-controlling model and pipeline source code. Cloud Storage is optimized for large, immutable artifacts such as trained model binaries and integrates directly with Vertex AI. Other options misuse Cloud SQL for ML metadata or GitHub for large binary artifacts.

$19

Get all 333 questions with detailed answers and explanations

  • Instant download HTML + PDF delivered the moment payment clears.
  • Secure Stripe checkout we never see or store your card details.
  • 7-day refund if files are defective see our refund policy.