Google

Professional Machine Learning Engineer Free Practice Questions — Page 15

Question 142

You are implementing a batch inference ML pipeline in Google Cloud. The model was developed using TensorFlow and is stored in SavedModel format in Cloud Storage. You need to apply the model to a historical dataset containing 10 TB of data that is stored in a BigQuery table. How should you perform the inference?

A. Export the historical data to Cloud Storage in Avro format. Configure a Vertex AI batch prediction job to generate predictions for the exported data
B. Import the TensorFlow model by using the CREATE MODEL statement in BigQuery ML. Apply the historical data to the TensorFlow model
C. Export the historical data to Cloud Storage in CSV format. Configure a Vertex AI batch prediction job to generate predictions for the exported data
D. Configure a Vertex AI batch prediction job to apply the model to the historical data in BigQuery
Show Answer
Correct Answer: B
Explanation:
BigQuery ML can import a TensorFlow SavedModel from Cloud Storage using CREATE MODEL and run ML.PREDICT directly against the BigQuery table. This avoids exporting a 10 TB dataset. The Vertex AI batch prediction option for BigQuery has had input size limitations for BigQuery sources, making it unsuitable for a single 10 TB table in this scenario. Exporting to Cloud Storage is unnecessary.

Question 143

You work at a bank. You have a custom tabular ML model that was provided by the bank’s vendor. The training data is not available due to its sensitivity. The model is packaged as a Vertex AI Model serving container, which accepts a string as input for each prediction instance. In each string, the feature values are separated by commas. You want to deploy this model to production for online predictions and monitor the feature distribution over time with minimal effort. What should you do?

A. 1. Upload the model to Vertex AI Model Registry, and deploy the model to a Vertex AI endpoint 2. Create a Vertex AI Model Monitoring job with feature drift detection as the monitoring objective, and provide an instance schema
B. 1. Upload the model to Vertex AI Model Registry, and deploy the model to a Vertex AI endpoint 2. Create a Vertex AI Model Monitoring job with feature skew detection as the monitoring objective, and provide an instance schema
C. 1. Refactor the serving container to accept key-value pairs as input format 2. Upload the model to Vertex AI Model Registry, and deploy the model to a Vertex AI endpoint 3. Create a Vertex AI Model Monitoring job with feature drift detection as the monitoring objective.
D. 1. Refactor the serving container to accept key-value pairs as input format 2. Upload the model to Vertex AI Model Registry, and deploy the model to a Vertex AI endpoint 3. Create a Vertex AI Model Monitoring job with feature skew detection as the monitoring objective
Show Answer
Correct Answer: A
Explanation:
Feature drift monitoring compares serving data over time and does not require access to the original training dataset, making it appropriate when the training data is unavailable. Feature skew monitoring requires a training baseline for comparison, which is not available here. Because the goal is minimal effort, there is no need to refactor the serving container if an instance schema can be provided to describe the comma-separated input features for model monitoring.

Question 144

You recently deployed a scikit-learn model to a Vertex AI endpoint. You are now testing the model on live production traffic. While monitoring the endpoint, you discover twice as many requests per hour than expected throughout the day. You want the endpoint to efficiently scale when the demand increases in the future to prevent users from experiencing high latency. What should you do?

A. Deploy two models to the same endpoint, and distribute requests among them evenly
B. Configure an appropriate minReplicaCount value based on expected baseline traffic
C. Set the target utilization percentage in the autoscailngMetricSpecs configuration to a higher value
D. Change the model’s machine type to one that utilizes GPUs
Show Answer
Correct Answer: B
Explanation:
Configure an appropriate minReplicaCount to match the observed baseline traffic so sufficient replicas are always available. Vertex AI autoscaling can then scale above this baseline as demand increases. Increasing the target utilization percentage delays scale-out, deploying multiple models to the same endpoint does not address autoscaling, and switching to GPUs is unrelated unless compute performance is the bottleneck.

Question 145

Your team has a model deployed to a Vertex AI endpoint. You have created a Vertex AI pipeline that automates the model training process and is triggered by a Cloud Function. You need to prioritize keeping the model up-to-date, but also minimize retraining costs. How should you configure retraining?

A. Configure Pub/Sub to call the Cloud Function when a sufficient amount of new data becomes available
B. Configure a Cloud Scheduler job that calls the Cloud Function at a predetermined frequency that fits your team’s budget
C. Enable model monitoring on the Vertex AI endpoint. Configure Pub/Sub to call the Cloud Function when anomalies are detected
D. Enable model monitoring on the Vertex AI endpoint. Configure Pub/Sub to call the Cloud Function when feature drift is detected
Show Answer
Correct Answer: D
Explanation:
Feature drift monitoring provides a data-driven trigger for retraining only when the input data distribution has meaningfully changed. This helps keep the deployed model current while avoiding unnecessary retraining jobs and associated costs. A fixed schedule may retrain too often or too rarely, new data alone does not necessarily require retraining, and generic anomaly detection is not as directly tied to model degradation from changing feature distributions.

Question 146

You are training an ML model on a large dataset. You are using a TPU to accelerate the training process. You notice that the training process is taking longer than expected. You discover that the TPU is not reaching its full capacity. What should you do?

A. Increase the learning rate
B. Increase the number of epochs
C. Decrease the learning rate
D. Increase the batch size
Show Answer
Correct Answer: D
Explanation:
If a TPU is underutilized, a common optimization is to increase the batch size so the accelerator has more work to process in parallel. TPUs achieve high throughput with larger batches, while changing the learning rate or number of epochs does not address hardware utilization. Increasing batch size may require corresponding tuning of optimization hyperparameters, but it is the primary step to improve TPU utilization.

Question 147

You are deploying a new version of a model to a production Vertex Al endpoint that is serving traffic. You plan to direct all user traffic to the new model. You need to deploy the model with minimal disruption to your application. What should you do?

A. 1. Create a new endpoint 2. Create a new model. Set it as the default version. Upload the model to Vertex AI Model Registry 3. Deploy the new model to the new endpoint 4. Update Cloud DNS to point to the new endpoint
B. 1. Create a new endpoint 2. Create a new model. Set the parentModel parameter to the model ID of the currently deployed model and set it as the default version. Upload the model to Vertex AI Model Registry 3. Deploy the new model to the new endpoint, and set the new model to 100% of the traffic.
C. 1. Create a new model. Set the parentModel parameter to the model ID of the currently deployed model. Upload the model to Vertex AI Model Registry. 2. Deploy the new model to the existing endpoint, and set the new model to 100% of the traffic
D. 1. Create a new model. Set it as the default version. Upload the model to Vertex AI Model Registry 2. Deploy the new model to the existing endpoint
Show Answer
Correct Answer: C
Explanation:
Deploying the new model to the existing endpoint avoids changing the serving endpoint, minimizing disruption. Registering it as a new model version by setting the parentModel preserves model lineage. Then update the endpoint's traffic split so the new deployment receives 100% of traffic. Creating a new endpoint requires clients or DNS to switch endpoints, increasing operational disruption. Simply deploying a new model without explicitly updating the traffic split does not ensure all requests go to the new model.

Question 148

You work for a bank with strict data governance requirements. You recently implemented a custom model to detect fraudulent transactions. You want your training code to download internal data by using an API endpoint hosted in your project’s network. You need the data to be accessed in the most secure way, while mitigating the risk of data exfiltration. What should you do?

A. Enable VPC Service Controls for peerings, and add Vertex AI to a service perimeter.
B. Create a Cloud Run endpoint as a proxy to the data. Use Identity and Access Management (IAM) authentication to secure access to the endpoint from the training job.
C. Configure VPC Peering with Vertex AI, and specify the network of the training job.
D. Download the data to a Cloud Storage bucket before calling the training job.
Show Answer
Correct Answer: A
Explanation:
VPC Service Controls are specifically designed to mitigate data exfiltration by creating a service perimeter around supported Google Cloud services, including Vertex AI. If the training job must access internal resources securely while minimizing exfiltration risk, placing Vertex AI inside a VPC Service Controls perimeter is the strongest control. VPC peering alone provides connectivity but not exfiltration protection, a Cloud Run proxy adds an application layer but does not provide the same perimeter-based data loss prevention, and copying data to Cloud Storage unnecessarily expands the data footprint.

Question 149

You recently deployed a pipeline in Vertex AI Pipelines that trains and pushes a model to a Vertex AI endpoint to serve real-time traffic. You need to continue experimenting and iterating on your pipeline to improve model performance. You plan to use Cloud Build for CI/CD You want to quickly and easily deploy new pipelines into production, and you want to minimize the chance that the new pipeline implementations will break in production. What should you do?

A. Set up a CI/CD pipeline that builds and tests your source code. If the tests are successful, use the Google. Cloud console to upload the built container to Artifact Registry and upload the compiled pipeline to Vertex AI Pipelines.
B. Set up a CI/CD pipeline that builds your source code and then deploys built artifacts into a pre-production environment. Run unit tests in the pre-production environment. If the tests are successful deploy the pipeline to production.
C. Set up a CI/CD pipeline that builds and tests your source code and then deploys built artifacts into a pre-production environment. After a successful pipeline run in the pre-production environment, deploy the pipeline to production.
D. Set up a CI/CD pipeline that builds and tests your source code and then deploys built artifacts into a pre-production environment. After a successful pipeline run in the pre-production environment, rebuild the source code and deploy the artifacts to production.
Show Answer
Correct Answer: C
Explanation:
A robust CI/CD workflow should build and test the source code, deploy the built artifacts to a pre-production (staging) environment, validate them by executing the pipeline end-to-end, and then promote the same tested artifacts to production. This minimizes production risk while enabling rapid iteration. Option A lacks staging validation, Option B relies only on unit tests rather than an end-to-end pipeline run, and Option D unnecessarily rebuilds before production, meaning production artifacts may differ from the tested ones.

Question 150

You work for a bank. You have created a custom model to predict whether a loan application should be flagged for human review. The input features are stored in a BigQuery table. The model is performing well, and you plan to deploy it to production. Due to compliance requirements the model must provide explanations for each prediction. You want to add this functionality to your model code with minimal effort and provide explanations that are as accurate as possible. What should you do?

A. Create an AutoML tabular model by using the BigQuery data with integrated Vertex Explainable AI.
B. Create a BigQuery ML deep neural network model and use the ML.EXPLAIN_PREDICT method with the num_integral_steps parameter.
C. Upload the custom model to Vertex AI Model Registry and configure feature-based attribution by using sampled Shapley with input baselines.
D. Update the custom serving container to include sampled Shapley-based explanations in the prediction outputs.
Show Answer
Correct Answer: C
Explanation:
The model already exists and performs well, so rebuilding it as AutoML or BigQuery ML adds unnecessary work. Vertex AI Explainable AI supports custom models through feature-based attribution, and configuring sampled Shapley with input baselines provides high-quality per-prediction explanations with minimal code changes. Modifying the custom serving container to compute explanations yourself would require more implementation effort than using the managed explanation service.

Question 151

You have created a Vertex AI pipeline that includes two steps. The first step preprocesses 10 TB data completes in about 1 hour, and saves the result in a Cloud Storage bucket. The second step uses the processed data to train a model. You need to update the model’s code to allow you to test different algorithms. You want to reduce pipeline execution time and cost while also minimizing pipeline changes. What should you do?

A. Add a pipeline parameter and an additional pipeline step. Depending on the parameter value, the pipeline step conducts or skips data preprocessing, and starts model training.
B. Create another pipeline without the preprocessing step, and hardcode the preprocessed Cloud Storage file location for model training.
C. Configure a machine with more CPU and RAM from the compute-optimized machine family for the data preprocessing step.
D. Enable caching for the pipeline job, and disable caching for the model training step.
Show Answer
Correct Answer: D
Explanation:
Enable pipeline caching so the expensive preprocessing step is reused across runs when its inputs and code have not changed. Disable caching for the model training step so changes to the training code or algorithm result in a fresh execution each time. This minimizes pipeline changes while reducing execution time and cost by avoiding repeated preprocessing.

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