Google

Professional Machine Learning Engineer Free Practice Questions — Page 16

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, the most efficient and scalable approach is to preprocess them into sharded TFRecord files using Dataflow, store them in Cloud Storage, and consume them with tf.data.TFRecordDataset during training. TFRecord provides optimized sequential reads and integrates well with TensorFlow input pipelines. Dataflow scales preprocessing, while Vertex AI Training is the managed, scalable service for distributed model training. Folder-based datasets are simpler but generally less efficient at this scale, and using a single Workbench instance for preprocessing or training is less scalable and requires more maintenance.

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:
For data already stored in BigQuery and intended for batch inference in BigQuery, performing preprocessing with BigQuery SQL is the most cost-effective and efficient approach. It avoids exporting large datasets or managing separate Spark/Dataflow pipelines, keeps transformations close to the data, and enables consistent preprocessing for both training and inference. TensorFlow can read directly from BigQuery using the BigQuery client/integration for model training.

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 the relationships between pipeline executions, datasets, intermediate artifacts, and model artifacts. Starting from the deployed model version, you can trace its lineage back to the pipeline run and the artifact representing the TFRecord dataset copy stored in Cloud Storage, allowing you to recover the exact training data location. Feature Store is not intended for recovering historical training dataset copies, endpoint logs do not provide artifact lineage, and training job logs are not the authoritative mechanism for tracing data artifacts.

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:
The best choice is to use a custom predictor based on the Vertex AI XGBoost Predictor and package only the custom prediction handler in a custom container built from a Vertex AI prebuilt serving image, while storing the model artifact in Cloud Storage. This minimizes custom code by reusing the built-in predictor, keeps the model artifact separate from the serving container for easier updates, and aligns with Vertex AI's recommended custom prediction routine architecture. A full Flask application is unnecessary because Vertex AI already provides the prediction server infrastructure.

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:
The appropriate approach is to evaluate fairness explicitly rather than assume that removing sensitive or correlated features eliminates bias. Train the model, evaluate it on a held-out test set, then analyze performance and fairness metrics across protected groups by joining predictions back to sensitive attributes. This investigates disparate performance while preserving predictive features unless evidence shows mitigation is needed. Feature importance (global or local) is for interpretability, not fairness assessment, and removing correlated features can unnecessarily reduce accuracy without eliminating proxy bias.

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:
Vertex ML Metadata is designed to track ML pipeline metadata, including parameters, artifacts, lineage, and executions. Source code should be version-controlled in GitHub, while model binaries and other large artifacts are best stored in Cloud Storage rather than Git. This aligns with recommended MLOps architecture on Google Cloud.

Question 112

You work for a pharmaceutical company based in Canada. Your team developed a BigQuery ML model to predict the number of flu infections for the next month in Canada. Weather data is published weekly, and flu infection statistics are published monthly. You need to configure a model retraining policy that minimizes cost. What should you do?

A. Download the weather and flu data each week. Configure Cloud Scheduler to execute a Vertex AI pipeline to retrain the model weekly.
B. Download the weather and flu data each month. Configure Cloud Scheduler to execute a Vertex AI pipeline to retrain the model monthly.
C. Download the weather and flu data each week. Configure Cloud Scheduler to execute a Vertex AI pipeline to retrain the model every month.
D. Download the weather data each week, and download the flu data each month. Deploy the model to a Vertex AI endpoint with feature drift monitoring, and retrain the model if a monitoring alert is detected.
Show Answer
Correct Answer: B
Explanation:
Retraining can only benefit from new labeled training data. Because flu infection statistics (the target labels) are published monthly, retraining more frequently does not add new labels and increases cost. Downloading both weather and flu data monthly and scheduling monthly retraining minimizes cost. Option D is inappropriate because BigQuery ML batch prediction does not require deployment to a Vertex AI endpoint, and endpoint feature drift monitoring is not the standard retraining policy for this scenario. Sources: https://cloud.google.com/blog/topics/developers-practitioners/continuous-model-evaluation-bigquery-ml-stored-procedures-and-cloud-scheduler https://cloud.google.com/bigquery/docs/bqml-introduction

Question 113

You developed a custom model by using Vertex AI to predict your application's user churn rate. You are using Vertex AI Model Monitoring for skew detection. The training data stored in BigQuery contains two sets of features - demographic and behavioral. You later discover that two separate models trained on each set perform better than the original model. You need to configure a new model monitoring pipeline that splits traffic among the two models. You want to use the same prediction-sampling-rate and monitoring-frequency for each model. You also want to minimize management effort. What should you do?

A. Keep the training dataset as is. Deploy the models to two separate endpoints, and submit two Vertex AI Model Monitoring jobs with appropriately selected feature-thresholds parameters.
B. Keep the training dataset as is. Deploy both models to the same endpoint and submit a Vertex AI Model Monitoring job with a monitoring-config-from-file parameter that accounts for the model IDs and feature selections.
C. Separate the training dataset into two tables based on demographic and behavioral features. Deploy the models to two separate endpoints, and submit two Vertex AI Model Monitoring jobs.
D. Separate the training dataset into two tables based on demographic and behavioral features. Deploy both models to the same endpoint, and submit a Vertex AI Model Monitoring job with a monitoring-config-from-file parameter that accounts for the model IDs and training datasets.
Show Answer
Correct Answer: D
Explanation:
For skew detection, each model should be monitored against the training dataset that corresponds to how it was trained. Since the original model was split into two models using different feature subsets (demographic vs. behavioral), each model needs its own appropriate training dataset reference. To minimize management effort, deploy both models to the same endpoint and use a single Model Monitoring job configured from a file that specifies the model IDs and their respective training datasets. Separate endpoints or multiple monitoring jobs increase operational overhead.

Question 114

You work at a leading healthcare firm developing state-of-the-art algorithms for various use cases. You have unstructured textual data with custom labels. You need to extract and classify various medical phrases with these labels. What should you do?

A. Use the Healthcare Natural Language API to extract medical entities
B. Use a BERT-based model to fine-tune a medical entity extraction model
C. Use AutoML Entity Extraction to train a medical entity extraction model
D. Use TensorFlow to build a custom medical entity extraction model
Show Answer
Correct Answer: C
Explanation:
The requirement is to extract and classify medical phrases using custom labels from unstructured text. The Healthcare Natural Language API provides pre-trained medical entity extraction but is not intended for arbitrary custom entity schemas. AutoML Entity Extraction is designed to train custom entity extraction models on annotated data, making it the appropriate managed solution. Building or fine-tuning BERT/TensorFlow models is possible but is more complex than necessary for this use case.

Question 115

You are collaborating on a model prototype with your team. You need to create a Vertex AI Workbench environment for the members of your team and also limit access to other employees in your project. What should you do?

A. 1. Create a new service account and grant it the Notebook Viewer role 2. Grant the Service Account User role to each team member on the service account 3. Grant the Vertex AI User role to each team member 4. Provision a Vertex AI Workbench user-managed notebook instance that uses the new service account
B. 1. Grant the Vertex AI User role to the default Compute Engine service account 2. Grant the Service Account User role to each team member on the default Compute Engine service account 3. Provision a Vertex AI Workbench user-managed notebook instance that uses the default Compute Engine service account.
C. 1. Create a new service account and grant it the Vertex AI User role 2. Grant the Service Account User role to each team member on the service account 3. Grant the Notebook Viewer role to each team member. 4. Provision a Vertex AI Workbench user-managed notebook instance that uses the new service account
D. 1. Grant the Vertex AI User role to the primary team member 2. Grant the Notebook Viewer role to the other team members 3. Provision a Vertex AI Workbench user-managed notebook instance that uses the primary user’s account
Show Answer
Correct Answer: C
Explanation:
Use a dedicated service account for the notebook, grant that service account the Vertex AI User role so workloads running as the notebook can access Vertex AI, grant team members Service Account User on that service account so they can use it, and grant Notebook Viewer so they can access the notebook while limiting broader project access. Using the default Compute Engine service account is not recommended, and granting only Notebook Viewer to the service account would not provide Vertex AI permissions.

$19

Get all 367 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.