Google

Professional Machine Learning Engineer Free Practice Questions — Page 16

Question 152

You work for a company that captures live video footage of checkout areas in their retail stores. You need to use the live video footage to build a model to detect the number of customers waiting for service in near real time. You want to implement a solution quickly and with minimal effort. How should you build the model?

A. Use the Vertex AI Vision Occupancy Analytics model.
B. Use the Vertex AI Vision Person/vehicle detector model.
C. Train an AutoML object detection model on an annotated dataset by using Vertex AutoML.
D. Train a Seq2Seq+ object detection model on an annotated dataset by using Vertex AutoML.
Show Answer
Correct Answer: A
Explanation:
The Vertex AI Vision Occupancy Analytics model is purpose-built for analyzing live video streams to measure occupancy and queue-related scenarios such as counting people in defined areas. It is a prebuilt solution requiring minimal setup, making it the fastest and lowest-effort approach. The Person/vehicle detector identifies people but would require additional logic to count customers waiting in a queue. AutoML options require collecting and annotating data and training a custom model, which does not meet the requirement for quick implementation with minimal effort.

Question 153

You work for a food product company. Your company’s historical sales data is stored in BigQuery.You need to use Vertex AI’s custom training service to train multiple TensorFlow models that read the data from BigQuery and predict future sales. You plan to implement a data preprocessing algorithm that performs mm-max scaling and bucketing on a large number of features before you start experimenting with the models. You want to minimize preprocessing time, cost, and development effort. How should you configure this workflow?

A. Write the transformations into Spark that uses the spark-bigquery-connector, and use Dataproc to preprocess the data.
B. Write SQL queries to transform the data in-place in BigQuery.
C. Add the transformations as a preprocessing layer in the TensorFlow models.
D. Create a Dataflow pipeline that uses the BigQuerylO connector to ingest the data, process it, and write it back to BigQuery.
Show Answer
Correct Answer: B
Explanation:
Use BigQuery SQL to perform the preprocessing in-place. Min-max scaling and bucketing are straightforward SQL transformations, and performing them where the data already resides avoids data movement, minimizes preprocessing time and infrastructure cost, and requires less development effort than building Spark or Dataflow pipelines. Embedding preprocessing in TensorFlow would repeat preprocessing during each training run and is less efficient when training multiple models on the same transformed dataset.

Question 154

You have recently trained a scikit-learn model that you plan to deploy on Vertex AI. This model will support both online and batch prediction. You need to preprocess input data for model inference. You want to package the model for deployment while minimizing additional code. What should you do?

A. 1. Upload your model to the Vertex AI Model Registry by using a prebuilt scikit-ieam prediction container. 2. Deploy your model to Vertex AI Endpoints, and create a Vertex AI batch prediction job that uses the instanceConfig.instanceType setting to transform your input data.
B. 1. Wrap your model in a custom prediction routine (CPR). and build a container image from the CPR local model. 2. Upload your scikit learn model container to Vertex AI Model Registry. 3. Deploy your model to Vertex AI Endpoints, and create a Vertex AI batch prediction job
C. 1. Create a custom container for your scikit learn model. 2. Define a custom serving function for your model. 3. Upload your model and custom container to Vertex AI Model Registry. 4. Deploy your model to Vertex AI Endpoints, and create a Vertex AI batch prediction job.
D. 1. Create a custom container for your scikit learn model. 2. Upload your model and custom container to Vertex AI Model Registry. 3. Deploy your model to Vertex AI Endpoints, and create a Vertex AI batch prediction job that uses the instanceConfig.instanceType setting to transform your input data.
Show Answer
Correct Answer: B
Explanation:
Custom Prediction Routines (CPR) are designed for adding preprocessing/postprocessing to inference while minimizing the amount of custom infrastructure code. They let you wrap a scikit-learn model with custom prediction logic without building a full model server from scratch, and the resulting container can be deployed for both online and batch prediction. Prebuilt prediction containers do not support arbitrary preprocessing logic, while fully custom containers require more code and infrastructure.

Question 155

You work at a bank. You need to develop a credit risk model to support loan application decisions. You decide to implement the model by using a neural network in TensorFlow. Due to regulatory requirements, you need to be able to explain the model’s predictions based on its features. When the model is deployed, you also want to monitor the model’s performance over time. You decided to use Vertex AI for both model development and deployment. What should you do?

A. Use Vertex Explainable AI with the sampled Shapley method, and enable Vertex AI Model Monitoring to check for feature distribution drift.
B. Use Vertex Explainable AI with the sampled Shapley method, and enable Vertex AI Model Monitoring to check for feature distribution skew.
C. Use Vertex Explainable AI with the XRAI method, and enable Vertex AI Model Monitoring to check for feature distribution drift.
D. Use Vertex Explainable AI with the XRAI method, and enable Vertex AI Model Monitoring to check for feature distribution skew.
Show Answer
Correct Answer: A
Explanation:
For a TensorFlow neural network on tabular credit-risk data, Vertex Explainable AI's sampled Shapley method is the appropriate feature-attribution technique. XRAI is intended for image models, not tabular features. To monitor model performance over time in production, enable Vertex AI Model Monitoring for feature distribution drift, which detects changes in serving data over time. Feature distribution skew compares training and serving distributions at a point in time, whereas drift tracks changes in production data over time.

Question 156

You work for an online grocery store. You recently developed a custom ML model that recommends a recipe when a user arrives at the website. You chose the machine type on the Vertex AI endpoint to optimize costs by using the queries per second (QPS) that the model can serve, and you deployed it on a single machine with 8 vCPUs and no accelerators. A holiday season is approaching and you anticipate four times more traffic during this time than the typical daily traffic. You need to ensure that the model can scale efficiently to the increased demand. What should you do?

A. 1. Maintain the same machine type on the endpoint. 2. Set up a monitoring job and an alert for CPU usage. 3. If you receive an alert, add a compute node to the endpoint.
B. 1. Change the machine type on the endpoint to have 32 vCPUs. 2. Set up a monitoring job and an alert for CPU usage. 3. If you receive an alert, scale the vCPUs further as needed.
C. 1. Maintain the same machine type on the endpoint Configure the endpoint to enable autoscaling based on vCPU usage. 2. Set up a monitoring job and an alert for CPU usage. 3. If you receive an alert, investigate the cause.
D. 1. Change the machine type on the endpoint to have a GPU. Configure the endpoint to enable autoscaling based on the GPU usage. 2. Set up a monitoring job and an alert for GPU usage. 3. If you receive an alert, investigate the cause.
Show Answer
Correct Answer: C
Explanation:
Vertex AI endpoints support autoscaling by adding or removing replica nodes based on utilization metrics such as CPU. Since the current machine type was already selected for cost-efficient QPS, keeping the same machine type and enabling autoscaling is the appropriate way to handle a temporary 4x traffic increase. Manual scaling is reactive, vertical scaling to a much larger machine is unnecessary overprovisioning, and adding GPUs is not justified for a CPU-based deployment.

Question 157

You have been tasked with deploying prototype code to production. The feature engineering code is in PySpark and runs on Dataproc Serverless. The model training is executed by using a Vertex AI custom training job. The two steps are not connected, and the model training must currently be run manually after the feature engineering step finishes. You need to create a scalable and maintainable production process that runs end-to-end and tracks the connections between steps. What should you do?

A. Create a Vertex AI Workbench notebook. Use the notebook to submit the Dataproc Serverless feature engineering job. Use the same notebook to submit the custom model training job. Run the notebook cells sequentially to tie the steps together end-to-end.
B. Create a Vertex AI Workbench notebook. Initiate an Apache Spark context in the notebook and run the PySpark feature engineering code. Use the same notebook to run the custom model training job in TensorFlow. Run the notebook cells sequentially to tie the steps together end-to-end.
C. Use the Kubeflow pipelines SDK to write code that specifies two components: - The first is a Dataproc Serverless component that launches the feature engineering job - The second is a custom component wrapped in the create_custom_training_job_from_component utility that launches the custom model training job Create a Vertex AI Pipelines job to link and run both components
D. Use the Kubeflow pipelines SDK to write code that specifies two components - The first component initiates an Apache Spark context that runs the PySpark feature engineering code - The second component runs the TensorFlow custom model training code Create a Vertex AI Pipelines job to link and run both components.
Show Answer
Correct Answer: C
Explanation:
Vertex AI Pipelines (Kubeflow Pipelines SDK) is the production orchestration solution for connecting ML workflow steps, providing scalable execution, lineage, metadata tracking, and reproducibility. Use a Dataproc Serverless pipeline component for the PySpark feature engineering job, then a Vertex AI custom training component (via create_custom_training_job_from_component) for model training. Workbench notebooks are intended for interactive development rather than production orchestration, and there is no need to start a Spark context inside a pipeline component when Dataproc Serverless already manages the Spark runtime.

Question 158

You have developed a BigQuery ML model that predicts customer chum, and deployed the model to Vertex AI Endpoints. You want to automate the retraining of your model by using minimal additional code when model feature values change. You also want to minimize the number of times that your model is retrained to reduce training costs. What should you do?

A. 1 Enable request-response logging on Vertex AI Endpoints 2. Schedule a TensorFlow Data Validation job to monitor prediction drift 3. Execute model retraining if there is significant distance between the distributions
B. 1. Enable request-response logging on Vertex AI Endpoints 2. Schedule a TensorFlow Data Validation job to monitor training/serving skew 3. Execute model retraining if there is significant distance between the distributions
C. 1. Create a Vertex AI Model Monitoring job configured to monitor prediction drift 2. Configure alert monitoring to publish a message to a Pub/Sub queue when a monitoring alert is detected 3. Use a Cloud Function to monitor the Pub/Sub queue, and trigger retraining in BigQuery
D. 1. Create a Vertex AI Model Monitoring job configured to monitor training/serving skew 2. Configure alert monitoring to publish a message to a Pub/Sub queue when a monitoring alert is detected 3. Use a Cloud Function to monitor the Pub/Sub queue, and trigger retraining in BigQuery
Show Answer
Correct Answer: D
Explanation:
Use Vertex AI Model Monitoring rather than manually scheduling TensorFlow Data Validation to minimize additional code. The trigger is based on changes in model feature values, which correspond to monitoring training/serving skew (feature distribution differences), not prediction drift (changes in model outputs). Configure monitoring alerts to Pub/Sub and invoke a Cloud Function to retrain the BigQuery ML model only when a significant skew alert occurs, reducing unnecessary retraining. Sources: https://www.dumpspedia.com/professional-machine-learning-engineer-google-professional-machine-learning-engineer-dumps.html

Question 159

You work for a retail company. You have a managed tabular dataset in Vertex AI that contains sales data from three different stores. The dataset includes several features, such as store name and sale timestamp. You want to use the data to train a model that makes sales predictions for a new store that will open soon. You need to split the data between the training, validation, and test sets. What approach should you use to split the data?

A. Use Vertex AI manual split, using the store name feature to assign one store for each set
B. Use Vertex AI default data split
C. Use Vertex AI chronological split, and specify the sales timestamp feature as the time variable
D. Use Vertex AI random split, assigning 70% of the rows to the training set, 10% to the validation set, and 20% to the test set
Show Answer
Correct Answer: C
Explanation:
For sales forecasting with a timestamp feature, the evaluation should reflect real-world deployment by training on earlier data and validating/testing on later data. A chronological split using the sales timestamp helps avoid training on future observations and is the recommended approach for time-dependent prediction tasks. Splitting by store would instead hold out an entire store, changing the problem to cross-store generalization rather than temporal forecasting.

Question 160

You recently used XGBoost to train a model in Python that will be used for online serving. Your model prediction service will be called by a backend service implemented in Golang running on a Google Kubernetes Engine (GKE) cluster. Your model requires pre and postprocessing steps. You need to implement the processing steps so that they run at serving time. You want to minimize code changes and infrastructure maintenance, and deploy your model into production as quickly as possible. What should you do?

A. Use FastAPI to implement an HTTP server. Create a Docker image that runs your HTTP server, and deploy it on your organization’s GKE cluster.
B. Use FastAPI to implement an HTTP server. Create a Docker image that runs your HTTP server, Upload the image to Vertex AI Model Registry and deploy it to a Vertex AI endpoint.
C. Use the Predictor interface to implement a custom prediction routine. Build the custom container, upload the container to Vertex AI Model Registry and deploy it to a Vertex AI endpoint.
D. Use the XGBoost prebuilt serving container when importing the trained model into Vertex AI. Deploy the model to a Vertex AI endpoint. Work with the backend engineers to implement the pre- and postprocessing steps in the Golang backend service.
Show Answer
Correct Answer: C
Explanation:
Custom Prediction Routines (CPR) are designed for exactly this use case: adding Python preprocessing and postprocessing around model inference while using Vertex AI managed online prediction. CPR avoids writing and maintaining your own HTTP server, minimizes infrastructure management compared with running FastAPI on GKE or in a fully custom serving container, and keeps the serving logic with the model for rapid deployment. Using the prebuilt XGBoost container alone cannot perform the required pre/postprocessing at serving time without moving that logic into the backend service.

Question 161

You developed a custom model by using Vertex AI to forecast the sales of your company’s products based on historical transactional data. You anticipate changes in the feature distributions and the correlations between the features in the near future. You also expect to receive a large volume of prediction requests. You plan to use Vertex AI Model Monitoring for drift detection and you want to minimize the cost. What should you do?

A. Use the features for monitoring. Set a monitoring-frequency value that is higher than the default.
B. Use the features for monitoring. Set a prediction-sampling-rate value that is closer to 1 than 0.
C. Use the features and the feature attributions for monitoring. Set a monitoring-frequency value that is lower than the default.
D. Use the features and the feature attributions for monitoring. Set a prediction-sampling-rate value that is closer to 0 than 1.
Show Answer
Correct Answer: D
Explanation:
Choose monitoring of both features and feature attributions because you expect changes in both feature distributions and relationships, and attribution monitoring can help detect shifts in how features influence predictions. To minimize cost with a high prediction volume, set the prediction sampling rate closer to 0 so only a representative subset of predictions is monitored. Increasing sampling or monitoring frequency would increase monitoring costs.

$19

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