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 requirement is to count customers waiting for service from live video with near–real-time results, implemented quickly and with minimal effort. Vertex AI Vision Occupancy Analytics is a prebuilt, purpose-built model for people counting and queue/occupancy analysis on live video streams, requiring no data labeling or custom training. The person/vehicle detector would need additional logic to infer waiting counts, and AutoML options require time-consuming data annotation and training, which contradicts the goal of fast, low-effort implementation.

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:
To minimize preprocessing time, cost, and development effort, the best approach is to perform the transformations directly in BigQuery using SQL. BigQuery can efficiently handle min–max scaling and bucketing at scale using its built-in SQL functions, without moving data out of the warehouse. This avoids additional infrastructure (Dataproc or Dataflow), reduces data movement and operational overhead, and keeps preprocessing independent of model code so multiple TensorFlow models can reuse the same prepared dataset. Compared to embedding preprocessing in TensorFlow, this also avoids repeated computation during training and speeds up experimentation.

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:
You need preprocessing for both online and batch prediction while minimizing extra code. Vertex AI Custom Prediction Routines (CPR) are designed for this use case: they let you add pre‑/post‑processing logic around a scikit‑learn model without writing your own HTTP server or full custom container. Prebuilt containers (A) do not support custom preprocessing, and fully custom containers/serving functions (C, D) add unnecessary complexity. Therefore, wrapping the model in a CPR and deploying it for online and batch prediction is the best option.

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:
The model uses tabular (non-image) features, so Vertex Explainable AI with sampled Shapley values is appropriate for explaining neural network predictions. XRAI is designed for image data and is not suitable here. To monitor performance over time in production, feature distribution drift detection is needed, as it captures changes in the underlying data distribution after deployment; skew mainly compares training vs serving data at a point in time. Therefore, using sampled Shapley explanations and enabling model monitoring for drift is the correct approach.

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 (such as vCPU usage). Keeping the same cost-optimized machine type and enabling autoscaling allows the service to automatically handle a 4× traffic increase without manual intervention or overprovisioning. Monitoring and alerts provide visibility, but scaling happens proactively via autoscaling. Manual scaling (A), vertical scaling with larger machines (B), or adding GPUs (D) are either reactive, unnecessarily expensive, or not aligned with the workload.

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:
A production-grade, scalable, and maintainable end-to-end workflow on Google Cloud should use Vertex AI Pipelines (Kubeflow Pipelines) for orchestration and lineage tracking. Option C correctly models each step as a pipeline component: Dataproc Serverless is used as-is to run PySpark feature engineering, and Vertex AI custom training is launched via a pipeline component using create_custom_training_job_from_component. This approach provides proper dependency tracking, reproducibility, monitoring, and automation. Notebook-based approaches (A, B) are not suitable for production orchestration, and directly managing Spark contexts inside pipeline components (D) is unnecessary and bypasses Dataproc Serverless best practices.

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: C
Explanation:
You want automated retraining with minimal additional code and minimal unnecessary retraining when feature values change over time. Vertex AI Model Monitoring is the managed service designed for this, requiring far less custom code than TensorFlow Data Validation. Monitoring prediction drift is appropriate when production feature distributions evolve over time compared to historical production baselines, which is the typical trigger for retraining to control costs. Alerts via Pub/Sub and a Cloud Function provide a lightweight, event‑driven retraining trigger. Training/serving skew is mainly for detecting mismatches at or shortly after deployment, not ongoing feature drift.

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: A
Explanation:
The goal is to predict sales for a new, unseen store. To best simulate this at evaluation time, the model should be trained on some stores and evaluated on a different store that is completely held out. A manual split using the store name feature achieves this and avoids leakage of store-specific patterns into validation or test sets. A chronological split is appropriate for forecasting future time periods of the same entities, but it does not address generalization to a new store.

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:
You need preprocessing and postprocessing to run at serving time while minimizing code changes and infrastructure maintenance and getting to production quickly. Vertex AI Custom Prediction Routines let you package the model together with pre/postprocessing logic without building and managing your own HTTP server. Deploying a custom container to a Vertex AI endpoint provides managed, scalable online serving and avoids pushing logic into the Golang backend or operating your own GKE service. This best satisfies all constraints compared with FastAPI-on-GKE or prebuilt XGBoost containers without preprocessing support.

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:
You expect feature distribution and correlation changes, so monitoring both features and feature attributions provides better drift detection coverage. Because you also expect a large volume of prediction requests and want to minimize cost, you should reduce the prediction-sampling rate so that only a small, representative subset of predictions is analyzed. Lowering sampling rate reduces monitoring cost while still enabling effective drift detection at scale.

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