Google

Professional Machine Learning Engineer Free Practice Questions — Page 13

Question 122

You are building a TensorFlow text-to-image generative model by using a dataset that contains billions of images with their respective captions. You want to create a low maintenance, automated workflow that reads the data from a Cloud Storage bucket collects statistics, splits the dataset into training/validation/test datasets performs data transformations trains the model using the training/validation datasets, and validates the model by using the test dataset. What should you do?

A. Use the Apache Airflow SDK to create multiple operators that use Dataflow and Vertex AI services. Deploy the workflow on Cloud Composer.
B. Use the MLFlow SDK and deploy it on a Google Kubernetes Engine cluster. Create multiple components that use Dataflow and Vertex AI services.
C. Use the Kubeflow Pipelines (KFP) SDK to create multiple components that use Dataflow and Vertex AI services. Deploy the workflow on Vertex AI Pipelines.
D. Use the TensorFlow Extended (TFX) SDK to create multiple components that use Dataflow and Vertex AI services. Deploy the workflow on Vertex AI Pipelines.
Show Answer
Correct Answer: D
Explanation:
TFX is specifically designed for end-to-end TensorFlow ML pipelines and provides standard components for data ingestion, statistics generation, schema inference, data validation, transformation, dataset splitting, training, evaluation, and serving. It integrates with Dataflow for scalable data processing and can be orchestrated on Vertex AI Pipelines, making it the lowest-maintenance and most automated option for a TensorFlow-based workflow.

Question 123

You are pre-training a large language model on Google Cloud. This model includes custom TensorFlow operations in the training loop. Model training will use a large batch size, and you expect training to take several weeks. You need to configure a training architecture that minimizes both training time and compute costs. What should you do?

A. Implement 8 workers of a2-megagpu-16g machines by using tf.distribute.MultiWorkerMirroredStrategy.
B. Implement a TPU Pod slice with -accelerator-type=v4-l28 by using tf.distribute.TPUStrategy.
C. Implement 16 workers of c2d-highcpu-32 machines by using tf.distribute.MirroredStrategy.
D. Implement 16 workers of a2-highgpu-8g machines by using tf.distribute.MultiWorkerMirroredStrategy.
Show Answer
Correct Answer: A
Explanation:
TPUs generally provide the best performance for large-scale training, but the question explicitly states that the training loop includes custom TensorFlow operations. TPU execution has important restrictions around custom TensorFlow operations in the main training loop, making a TPU Pod slice unsuitable here. CPU-only training is clearly not appropriate for LLM pre-training. Between the GPU options, MultiWorkerMirroredStrategy is the correct distributed strategy, and 8 a2-megagpu-16g instances provide larger GPU memory per worker, which better supports very large batch sizes while reducing the number of workers and associated communication overhead compared to 16 smaller GPU workers.

Question 124

You need to develop a custom TensorFlow model that will be used for online predictions. The training data is stored in BigQuery You need to apply instance-level data transformations to the data for model training and serving. You want to use the same preprocessing routine during model training and serving. How should you configure the preprocessing routine?

A. Create a BigQuery script to preprocess the data, and write the result to another BigQuery table.
B. Create a pipeline in Vertex AI Pipelines to read the data from BigQuery and preprocess it using a custom preprocessing component.
C. Create a preprocessing function that reads and transforms the data from BigQuery. Create a Vertex AI custom prediction routine that calls the preprocessing function at serving time.
D. Create an Apache Beam pipeline to read the data from BigQuery and preprocess it by using TensorFlow Transform and Dataflow.
Show Answer
Correct Answer: D
Explanation:
TensorFlow Transform (tf.Transform) is specifically designed to define preprocessing once and apply the identical transformations during both training and serving. It runs with Apache Beam (commonly on Dataflow) and produces transformation artifacts that ensure consistency. The other options either preprocess only for training, duplicate preprocessing logic, or do not provide a single shared preprocessing graph for both training and serving.

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 126

You are training a custom language model for your company using a large dataset. You plan to use the Reduction Server strategy on Vertex AI. You need to configure the worker pools of the distributed training job. What should you do?

A. Configure the machines of the first two worker pools to have GPUs, and to use a container image where your training code runs. Configure the third worker pool to have GPUs, and use the reductionserver container image.
B. Configure the machines of the first two worker pools to have GPUs and to use a container image where your training code runs. Configure the third worker pool to use the reductionserver container image without accelerators, and choose a machine type that prioritizes bandwidth.
C. Configure the machines of the first two worker pools to have TPUs and to use a container image where your training code runs. Configure the third worker pool without accelerators, and use the reductionserver container image without accelerators, and choose a machine type that prioritizes bandwidth.
D. Configure the machines of the first two pools to have TPUs, and to use a container image where your training code runs. Configure the third pool to have TPUs, and use the reductionserver container image.
Show Answer
Correct Answer: B
Explanation:
Reduction Server on Vertex AI is designed for distributed GPU training. The training worker pools should run the custom training container with GPUs. The dedicated Reduction Server worker pool runs the reductionserver container image and does not require GPUs or TPUs; instead, it should use a machine type with high network bandwidth because its role is gradient aggregation and communication.

Question 127

You recently developed a wide and deep model in TensorFlow. You generated training datasets using a SQL script that preprocessed raw data in BigQuery by performing instance-level transformations of the data. You need to create a training pipeline to retrain the model on a weekly basis. The trained model will be used to generate daily recommendations. You want to minimize model development and training time. How should you develop the training pipeline?

A. Use the Kubeflow Pipelines SDK to implement the pipeline. Use the BigQueryJobOp component to run the preprocessing script and the CustomTrainingJobOp component to launch a Vertex AI training job.
B. Use the Kubeflow Pipelines SDK to implement the pipeline. Use the DataflowPythonJobOp component to preprocess the data and the CustomTrainingJobOp component to launch a Vertex AI training job.
C. Use the TensorFlow Extended SDK to implement the pipeline Use the ExampleGen component with the BigQuery executor to ingest the data the Transform component to preprocess the data, and the Trainer component to launch a Vertex AI training job.
D. Use the TensorFlow Extended SDK to implement the pipeline Implement the preprocessing steps as part of the input_fn of the model. Use the ExampleGen component with the BigQuery executor to ingest the data and the Trainer component to launch a Vertex AI training job.
Show Answer
Correct Answer: A
Explanation:
The preprocessing logic already exists as a BigQuery SQL script that performs the required instance-level transformations. To minimize development time, reuse that existing preprocessing by orchestrating it with a BigQuery job, then launch a managed Vertex AI custom training job. Reimplementing preprocessing in TFX Transform would require rewriting the SQL logic, and using Dataflow adds unnecessary complexity. Putting preprocessing in input_fn is also not the recommended approach for production pipelines.

Question 128

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 modeled with deep learning (e.g., TensorFlow/CNNs). For image models, Integrated Gradients is a standard attribution method that explains predictions by highlighting which pixels or regions contributed most to the output. Tree-based models are generally not appropriate for raw image inputs, and PDP explains global feature effects rather than individual image predictions. Sampled Shapley is more commonly applied to tabular features and is less suitable here than Integrated Gradients for image-based deep learning explanations.

Question 129

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:
For data exploration and preprocessing involving healthcare data with PII, the recommended approach is to de-identify sensitive fields using the Cloud Data Loss Prevention (DLP) API. This minimizes exposure of PII while preserving the data's utility for analysis. Encryption with CMEK or Google-managed keys protects data at rest but requires decryption during analysis, which does not address privacy during exploration. Running workloads inside a VPC Service Controls perimeter improves perimeter security but does not itself de-identify or protect sensitive fields from analysts.

Question 130

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:
The goal is to quickly create an initial object detection model from annotated images with bounding boxes and labels. Vertex AI AutoML for object detection is designed for this use case, requiring minimal code and automatically handling model selection and training. Custom training or fine-tuning in Workbench require more engineering effort, and building a Vertex AI Pipeline is unnecessary for an initial proof of concept.

Question 131

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 TensorBoard is used to track and visualize training metrics and parameters across training epochs. Vertex AI Experiments organizes and compares different training runs and model versions based on metrics. Vertex ML Metadata stores metadata and lineage for ML artifacts, including executions, parameters, and metrics, supporting experiment tracking and reproducibility. Feature Store is for serving and managing features, while Vizier is for hyperparameter tuning rather than experiment tracking or per-epoch metric visualization.

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