Google

Professional Machine Learning Engineer Free Practice Questions — Page 18

Question 125

You have trained a model by using data that was preprocessed in a batch Dataflow pipeline. Your use case requires real-time inference. You want to ensure that the data preprocessing logic is applied consistently between training and serving. What should you do?

A. Perform data validation to ensure that the input data to the pipeline is the same format as the input data to the endpoint.
B. Refactor the transformation code in the batch data pipeline so that it can be used outside of the pipeline. Use the same code in the endpoint.
C. Refactor the transformation code in the batch data pipeline so that it can be used outside of the pipeline. Share this code with the end users of the endpoint.
D. Batch the real-time requests by using a time window and then use the Dataflow pipeline to preprocess the batched requests. Send the preprocessed requests to the endpoint.
Show Answer
Correct Answer: B
Explanation:
Refactor the preprocessing/transformation logic into reusable code and invoke the same code from the online serving endpoint. This ensures that the identical feature engineering and preprocessing steps are applied during both training and real-time inference, avoiding training-serving skew. Data validation alone does not enforce identical transformations, sharing preprocessing with end users is unnecessary and unreliable, and routing online requests through a batch Dataflow pipeline adds latency that conflicts with real-time inference.

Question 125

You are building a predictive maintenance model to preemptively detect part defects in bridges. You plan to use high definition images of the bridges as model inputs. You need to explain the output of the model to the relevant stakeholders so they can take appropriate action. How should you build the model?

A. Use scikit-learn to build a tree-based model, and use SHAP values to explain the model output.
B. Use scikit-learn to build a tree-based model, and use partial dependence plots (PDP) to explain the model output.
C. Use TensorFlow to create a deep learning-based model, and use Integrated Gradients to explain the model output.
D. Use TensorFlow to create a deep learning-based model, and use the sampled Shapley method to explain the model output.
Show Answer
Correct Answer: C
Explanation:
High-definition images are best processed by a deep learning model, such as a TensorFlow convolutional neural network. Integrated Gradients can attribute predictions to image pixels or regions, producing visual explanations that help stakeholders identify areas associated with a defect.

Question 126

You are analyzing customer data for a healthcare organization that is stored in Cloud Storage. The data contains personally identifiable information (PII). You need to perform data exploration and preprocessing while ensuring the security and privacy of sensitive fields. What should you do?

A. Use the Cloud Data Loss Prevention (DLP) API to de-identify the PII before performing data exploration and preprocessing.
B. Use customer-managed encryption keys (CMEK) to encrypt the PII data at rest, and decrypt the PII data during data exploration and preprocessing.
C. Use a VM inside a VPC Service Controls security perimeter to perform data exploration and preprocessing.
D. Use Google-managed encryption keys to encrypt the PII data at rest, and decrypt the PII data during data exploration and preprocessing.
Show Answer
Correct Answer: A
Explanation:
Use the Cloud Data Loss Prevention (DLP) API to identify and de-identify PII before exploration and preprocessing. This reduces exposure of sensitive fields while leaving data available for analysis. Encryption at rest and VPC Service Controls provide other security protections, but do not conceal PII from analysts who access the decrypted data.

Question 127

You work for an auto insurance company. You are preparing a proof-of-concept ML application that uses images of damaged vehicles to infer damaged parts. Your team has assembled a set of annotated images from damage claim documents in the company’s database. The annotations associated with each image consist of a bounding box for each identified damaged part and the part name. You have been given a sufficient budget to train models on Google Cloud. You need to quickly create an initial model. What should you do?

A. Download a pre-trained object detection model from TensorFlow Hub. Fine-tune the model in Vertex AI Workbench by using the annotated image data.
B. Train an object detection model in AutoML by using the annotated image data.
C. Create a pipeline in Vertex AI Pipelines and configure the AutoMLTrainingJobRunOp component to train a custom object detection model by using the annotated image data.
D. Train an object detection model in Vertex AI custom training by using the annotated image data.
Show Answer
Correct Answer: B
Explanation:
Use AutoML to train an object detection model from the annotated images. The bounding boxes and part names provide the labels it needs, and AutoML is the quickest way to create an initial model without building and managing a custom training workflow.

Question 128

You work for a bank. You have been asked to develop an ML model that will support loan application decisions. You need to determine which Vertex AI services to include in the workflow. You want to track the model’s training parameters and the metrics per training epoch. You plan to compare the performance of each version of the model to determine the best model based on your chosen metrics. Which Vertex AI services should you use?

A. Vertex ML Metadata, Vertex AI Feature Store, and Vertex AI Vizier
B. Vertex AI Pipelines, Vertex AI Experiments, and Vertex AI Vizier
C. Vertex ML Metadata, Vertex AI Experiments, and Vertex AI TensorBoard
D. Vertex AI Pipelines, Vertex AI Feature Store, and Vertex AI TensorBoard
Show Answer
Correct Answer: C
Explanation:
Vertex AI Experiments tracks parameters and metrics across training runs, making it possible to compare model versions. Vertex AI TensorBoard visualizes training metrics by epoch. Vertex ML Metadata records metadata and lineage for runs and associated artifacts.

Question 129

You work for a startup that has multiple data science workloads. Your compute infrastructure is currently on-premises, and the data science workloads are native to PySpark. Your team plans to migrate their data science workloads to Google Cloud. You need to build a proof of concept to migrate one data science job to Google Cloud. You want to propose a migration process that requires minimal cost and effort. What should you do first?

A. Create a n2-standard-4 VM instance and install Java, Scala, and Apache Spark dependencies on it.
B. Create a Google Kubernetes Engine cluster with a basic node pool configuration, install Java, Scala, and Apache Spark dependencies on it.
C. Create a Standard (1 master, 3 workers) Dataproc cluster, and run a Vertex AI Workbench notebook instance on it.
D. Create a Vertex AI Workbench notebook with instance type n2-standard-4.
Show Answer
Correct Answer: C
Explanation:
Use Dataproc for the proof of concept because it provides a managed Spark environment for the existing PySpark job, avoiding the manual setup and maintenance required with a VM or GKE. A Workbench notebook can support interactive development and testing against the cluster. A standalone Workbench VM does not provide the same managed distributed Spark environment.

Question 130

You work for a hotel and have a dataset that contains customers’ written comments scanned from paper-based customer feedback forms, which are stored as PDF files. Every form has the same layout. You need to quickly predict an overall satisfaction score from the customer comments on each form. How should you accomplish this task?

A. Use the Vision API to parse the text from each PDF file. Use the Natural Language API analyzeSentiment feature to infer overall satisfaction scores.
B. Use the Vision API to parse the text from each PDF file. Use the Natural Language API analyzeEntitySentiment feature to infer overall satisfaction scores.
C. Uptrain a Document AI custom extractor to parse the text in the comments section of each PDF file. Use the Natural Language API analyzeSentiment feature to infer overall satisfaction scores.
D. Uptrain a Document AI custom extractor to parse the text in the comments section of each PDF file. Use the Natural Language API analyzeEntitySentiment feature to infer overall satisfaction scores.
Show Answer
Correct Answer: C
Explanation:
Because the forms share a layout, a Document AI custom extractor can target the comments section rather than passing all form text to sentiment analysis. Natural Language API’s analyzeSentiment then provides an overall sentiment score; analyzeEntitySentiment scores individual entities instead. Sources: https://cloud.google.com/document-ai/docs/create-dataset

Question 131

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:
A credit-risk model uses tabular features, for which sampled Shapley can attribute predictions to individual features; XRAI is intended for image explanations. To monitor changes in feature distributions over time after deployment, enable Vertex AI Model Monitoring for drift. Skew instead compares serving data with training data.

Question 132

You work for a semiconductor manufacturing company. You need to create a real-time application that automates the quality control process. High-definition images of each semiconductor are taken at the end of the assembly line in real time. The photos are uploaded to a Cloud Storage bucket along with tabular data that includes each semiconductor’s batch number, serial number, dimensions, and weight. You need to configure model training and serving while maximizing model accuracy. What should you do?

A. Use Vertex AI Data Labeling Service to label the images, and tram an AutoML image classification model. Deploy the model, and configure Pub/Sub to publish a message when an image is categorized into the failing class.
B. Use Vertex AI Data Labeling Service to label the images, and train an AutoML image classification model. Schedule a daily batch prediction job that publishes a Pub/Sub message when the job completes.
C. Convert the images into an embedding representation. Import this data into BigQuery, and train a BigQuery ML K-means clustering model with two clusters. Deploy the model and configure Pub/Sub to publish a message when a semiconductor’s data is categorized into the failing cluster.
D. Import the tabular data into BigQuery, use Vertex AI Data Labeling Service to label the data and train an AutoML tabular classification model. Deploy the model, and configure Pub/Sub to publish a message when a semiconductor’s data is categorized into the failing class.
Show Answer
Correct Answer: A
Explanation:
The quality signal is in the semiconductor images, so label them and train an AutoML image classification model to distinguish passing from failing parts. Deploy it for online predictions to support real-time inspection, then publish a Pub/Sub message when a prediction indicates failure. Batch prediction would add delay, while clustering or a tabular-only model would not directly classify visual defects.

Question 133

You work for a rapidly growing social media company. Your team builds TensorFlow recommender models in an on-premises CPU cluster. The data contains billions of historical user events and 100,000 categorical features. You notice that as the data increases, the model training time increases. You plan to move the models to Google Cloud. You want to use the most scalable approach that also minimizes training time. What should you do?

A. Deploy the training jobs by using TPU VMs with TPUv3 Pod slices, and use the TPUEmbeading API
B. Deploy the training jobs in an autoscaling Google Kubernetes Engine cluster with CPUs
C. Deploy a matrix factorization model training job by using BigQuery ML
D. Deploy the training jobs by using Compute Engine instances with A100 GPUs, and use the tf.nn.embedding_lookup API
Show Answer
Correct Answer: A
Explanation:
TPUv3 Pod slices provide scalable distributed training, and the TPUEmbedding API is optimized for large embedding tables and categorical features common in recommender systems. This combination is better suited to scaling the TensorFlow workload and reducing training time than CPU-based GKE or a BigQuery ML matrix-factorization job. The A100 option accelerates training, but does not use the specialized TPU embedding support.

$19

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