Google

Professional Machine Learning Engineer Free Practice Questions — Page 8

Question 72

You are training and deploying updated versions of a regression model with tabular data by using Vertex AI Pipelines, Vertex AI Training, Vertex AI Experiments, and Vertex AI Endpoints. The model is deployed in a Vertex AI endpoint, and your users call the model by using the Vertex AI endpoint. You want to receive an email when the feature data distribution changes significantly, so you can retrigger the training pipeline and deploy an updated version of your model. What should you do?

A. Use Vertex Al Model Monitoring. Enable prediction drift monitoring on the endpoint, and specify a notification email.
B. In Cloud Logging, create a logs-based alert using the logs in the Vertex Al endpoint. Configure Cloud Logging to send an email when the alert is triggered.
C. In Cloud Monitoring create a logs-based metric and a threshold alert for the metric. Configure Cloud Monitoring to send an email when the alert is triggered.
D. Export the container logs of the endpoint to BigQuery. Create a Cloud Function to run a SQL query over the exported logs and send an email. Use Cloud Scheduler to trigger the Cloud Function.
Show Answer
Correct Answer: A
Explanation:
Vertex AI Model Monitoring is purpose-built to detect feature data distribution changes (prediction/data drift) on deployed endpoints. By enabling prediction drift monitoring and configuring email notifications, you get automatic detection and alerts without building custom logging, metrics, or pipelines. The other options require manual, complex setups and are not specialized for model data drift.

Question 73

You recently created a new Google Cloud project. After testing that you can submit a Vertex AI Pipeline job from the Cloud Shell, you want to use a Vertex AI Workbench user-managed notebook instance to run your code from that instance. You created the instance and ran the code but this time the job fails with an insufficient permissions error. What should you do?

A. Ensure that the Workbench instance that you created is in the same region of the Vertex AI Pipelines resources you will use.
B. Ensure that the Vertex AI Workbench instance is on the same subnetwork of the Vertex AI Pipeline resources that you will use.
C. Ensure that the Vertex AI Workbench instance is assigned the Identity and Access Management (IAM) Vertex AI User role.
D. Ensure that the Vertex AI Workbench instance is assigned the Identity and Access Management (IAM) Notebooks Runner role.
Show Answer
Correct Answer: C
Explanation:
The code runs from a Vertex AI Workbench instance but fails when submitting a Vertex AI Pipeline job, which indicates missing permissions to call the Vertex AI Pipelines API. The service account attached to the Workbench instance must have permissions such as aiplatform.pipelineJobs.create, which are included in the predefined Vertex AI User IAM role. Region or subnet alignment does not cause IAM permission errors, and the Notebooks Runner role is intended for executing/scheduling notebooks, not for creating Vertex AI Pipeline jobs.

Question 74

You are developing an ML model in a Vertex AI Workbench notebook. You want to track artifacts and compare models during experimentation using different approaches. You need to rapidly and easily transition successful experiments to production as you iterate on your model implementation. What should you do?

A. 1. Initialize the Vertex SDK with the name of your experiment. Log parameters and metrics for each experiment, and attach dataset and model artifacts as inputs and outputs to each execution. 2. After a successful experiment create a Vertex AI pipeline.
B. 1. Initialize the Vertex SDK with the name of your experiment. Log parameters and metrics for each experiment, save your dataset to a Cloud Storage bucket, and upload the models to Vertex AI Model Registry. 2. After a successful experiment, create a Vertex AI pipeline.
C. 1. Create a Vertex AI pipeline with parameters you want to track as arguments to your PipelineJob. Use the Metrics, Model, and Dataset artifact types from the Kubeflow Pipelines DSL as the inputs and outputs of the components in your pipeline. 2. Associate the pipeline with your experiment when you submit the job.
D. 1. Create a Vertex AI pipeline. Use the Dataset and Model artifact types from the Kubeflow Pipelines DSL as the inputs and outputs of the components in your pipeline. 2. In your training component, use the Vertex AI SDK to create an experiment run. Configure the log_params and log_metrics functions to track parameters and metrics of your experiment.
Show Answer
Correct Answer: A
Explanation:
The goal is fast, flexible experimentation in a Vertex AI Workbench notebook with easy comparison of runs and a smooth path to production. Initializing the Vertex AI SDK with an experiment, logging parameters and metrics, and attaching dataset and model artifacts lets you track and compare experiments natively without extra infrastructure or manual steps. Once an approach is successful, you can then formalize it into a Vertex AI pipeline for production. The other options either add unnecessary manual artifact management or force you into pipelines too early, reducing iteration speed.

Question 75

You are developing a model to help your company create more targeted online advertising campaigns. You need to create a dataset that you will use to train the model. You want to avoid creating or reinforcing unfair bias in the model. What should you do? (Choose two.)

A. Include a comprehensive set of demographic features
B. Include only the demographic groups that most frequently interact with advertisements
C. Collect a random sample of production traffic to build the training dataset
D. Collect a stratified sample of production traffic to build the training dataset
E. Conduct fairness tests across sensitive categories and demographics on the trained model
Show Answer
Correct Answer: D, E
Explanation:
To reduce unfair bias, the training data must fairly represent different demographic groups and the model must be evaluated for bias. Collecting a stratified sample of production traffic ensures that relevant demographic groups are adequately represented rather than over- or under-sampled. In addition, conducting fairness tests across sensitive categories on the trained model helps detect and address disparate performance or outcomes, preventing reinforcement of bias.

Question 76

You want to migrate a scikit-learn classifier model to TensorFlow. You plan to train the TensorFlow classifier model using the same training set that was used to train the scikit-learn model, and then compare the performances using a common test set. You want to use the Vertex AI Python SDK to manually log the evaluation metrics of each model and compare them based on their F1 scores and confusion matrices. How should you log the metrics?

A. Use the aiplatform.log_classification_metrics function to log the F1 score, and use the aiplatform.log_metrics function to log the confusion matrix.
B. Use the aiplatform.log_classification_metrics function to log the F1 score and the confusion matrix.
C. Use the aiplatform.log_metrics function to log the F1 score and the confusion matrix.
D. Use the aiplatform.log_metrics function to log the F1 score: and use the aiplatform.log_classification_metrics function to log the confusion matrix.
Show Answer
Correct Answer: D
Explanation:
In the Vertex AI Python SDK, aiplatform.log_classification_metrics is intended for structured classification artifacts such as confusion matrices (and ROC curves), not arbitrary scalar scores. Scalar metrics like F1 are logged with the generic aiplatform.log_metrics function. Therefore, log the F1 score with log_metrics and the confusion matrix with log_classification_metrics.

Question 77

You created a model that uses BigQuery ML to perform linear regression. You need to retrain the model on the cumulative data collected every week. You want to minimize the development effort and the scheduling cost. What should you do?

A. Use BigQuery’s scheduling service to run the model retraining query periodically.
B. Create a pipeline in Vertex AI Pipelines that executes the retraining query, and use the Cloud Scheduler API to run the query weekly.
C. Use Cloud Scheduler to trigger a Cloud Function every week that runs the query for retraining the model.
D. Use the BigQuery API Connector and Cloud Scheduler to trigger Workflows every week that retrains the model.
Show Answer
Correct Answer: A
Explanation:
BigQuery ML supports retraining via SQL, and BigQuery’s built-in scheduled queries can run that retraining SQL on a weekly schedule. This requires no additional infrastructure, code, or orchestration services, minimizing both development effort and scheduling cost compared to pipelines, Cloud Functions, or Workflows.

Question 78

You work for an organization that operates a streaming music service. You have a custom production model that is serving a “next song” recommendation based on a user's recent listening history. Your model is deployed on a Vertex AI endpoint. You recently retrained the same model by using fresh data. The model received positive test results offline. You now want to test the new model in production while minimizing complexity. What should you do?

A. Create a new Vertex AI endpoint for the new model and deploy the new model to that new endpoint. Build a service to randomly send 5% of production traffic to the new endpoint. Monitor end-user metrics such as listening time. If end-user metrics improve between models over time, gradually increase the percentage of production traffic sent to the new endpoint.
B. Capture incoming prediction requests in BigQuery. Create an experiment in Vertex AI Experiments. Run batch predictions for both models using the captured data. Use the user’s selected song to compare the models performance side by side. If the new model’s performance metrics are better than the previous model, deploy the new model to production.
C. Deploy the new model to the existing Vertex AI endpoint. Use traffic splitting to send 5% of production traffic to the new model. Monitor end-user metrics, such as listening time. If end-user metrics improve between models over time, gradually increase the percentage of production traffic sent to the new model.
D. Configure a model monitoring job for the existing Vertex AI endpoint. Configure the monitoring job to detect prediction drift and set a threshold for alerts. Update the model on the endpoint from the previous model to the new model. If you receive an alert of prediction drift, revert to the previous model.
Show Answer
Correct Answer: C
Explanation:
Deploying the new model to the existing Vertex AI endpoint and using built-in traffic splitting allows you to test the model on real production traffic with minimal additional infrastructure. Sending a small percentage (e.g., 5%) of requests to the new model enables safe, gradual rollout and direct comparison using real end-user metrics like listening time. This approach avoids the complexity of managing a new endpoint or custom routing services while supporting controlled experimentation and rollback.

Question 79

You work for a company that is developing an application to help users with meal planning. You want to use machine learning to scan a corpus of recipes and extract each ingredient (e.g., carrot, rice, pasta) and each kitchen cookware (e.g., bowl, pot, spoon) mentioned. Each recipe is saved in an unstructured text file. What should you do?

A. Create a text dataset on Vertex AI for entity extraction Create two entities called “ingredient” and “cookware”, and label at least 200 examples of each entity. Train an AutoML entity extraction model to extract occurrences of these entity types. Evaluate performance on a holdout dataset.
B. Create a multi-label text classification dataset on Vertex AI. Create a test dataset, and label each recipe that corresponds to its ingredients and cookware. Train a multi-class classification model. Evaluate the model’s performance on a holdout dataset.
C. Use the Entity Analysis method of the Natural Language API to extract the ingredients and cookware from each recipe. Evaluate the model's performance on a prelabeled dataset.
D. Create a text dataset on Vertex AI for entity extraction. Create as many entities as there are different ingredients and cookware. Train an AutoML entity extraction model to extract those entities. Evaluate the model’s performance on a holdout dataset.
Show Answer
Correct Answer: A
Explanation:
The task is to extract specific items (ingredients and cookware) mentioned within unstructured recipe text, which is a named entity extraction problem. Option A correctly proposes training a custom entity extraction model on Vertex AI with two entity types (ingredient and cookware), allowing precise, domain-specific extraction. Text classification (B) is inappropriate because it labels whole documents rather than spans of text. The Natural Language API’s generic entity analysis (C) is not designed for custom domain entities and lacks control and accuracy for this use case. Option D is impractical because creating an entity per ingredient or tool does not scale.

Question 80

You work for a retail company. You have been tasked with building a model to determine the probability of churn for each customer. You need the predictions to be interpretable so the results can be used to develop marketing campaigns that target at-risk customers. What should you do?

A. Build a random forest regression model in a Vertex AI Workbench notebook instance. Configure the model to generate feature importances after the model is trained.
B. Build an AutoML tabular regression model. Configure the model to generate explanations when it makes predictions.
C. Build a custom TensorFlow neural network by using Vertex AI custom training. Configure the model to generate explanations when it makes predictions.
D. Build a random forest classification model in a Vertex AI Workbench notebook instance. Configure the model to generate feature importances after the model is trained.
Show Answer
Correct Answer: D
Explanation:
Churn prediction is fundamentally a classification problem (churn vs. not churn), even though models can output probabilities. A random forest classification model naturally produces class probabilities and, importantly, provides feature importances that are easy to interpret and directly actionable for marketing teams. This satisfies both requirements: predicting churn risk and ensuring interpretability. Regression-based options (A, B) are mismatched to the problem framing, and a custom neural network (C) is less interpretable despite explanation tools.

Question 81

You are developing a custom TensorFlow classification model based on tabular data. Your raw data is stored in BigQuery. contains hundreds of millions of rows, and includes both categorical and numerical features. You need to use a MaxMin scaler on some numerical features, and apply a one-hot encoding to some categorical features such as SKU names. Your model will be trained over multiple epochs. You want to minimize the effort and cost of your solution. What should you do?

A. 1. Write a SQL query to create a separate lookup table to scale the numerical features. 2. Deploy a TensorFlow-based model from Hugging Face to BigQuery to encode the text features. 3. Feed the resulting BigQuery view into Vertex AI Training.
B. 1. Use BigQuery to scale the numerical features. 2. Feed the features into Vertex AI Training. 3. Allow TensorFlow to perform the one-hot text encoding.
C. 1. Use TFX components with Dataflow to encode the text features and scale the numerical features. 2. Export results to Cloud Storage as TFRecords. 3. Feed the data into Vertex AI Training.
D. 1. Write a SQL query to create a separate lookup table to scale the numerical features. 2. Perform the one-hot text encoding in BigQuery. 3. Feed the resulting BigQuery view into Vertex AI Training.
Show Answer
Correct Answer: C
Explanation:
The data is extremely large (hundreds of millions of rows) and preprocessing includes full‑pass, stateful transformations (MinMax scaling and categorical vocab generation). These are inefficient and complex to implement reliably in BigQuery SQL and would need auxiliary tables and tight coupling between training and serving logic. TFX with the Transform component runs these transformations once at scale on Dataflow, materializes the results (e.g., TFRecords), and allows efficient multi‑epoch training without recomputing preprocessing each epoch. This minimizes long‑term cost and effort while ensuring correctness and consistency between training and serving.

$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.