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: The workflow described is an end-to-end TensorFlow ML pipeline at massive scale: ingesting data from Cloud Storage, collecting statistics, splitting datasets, performing transformations, training, and evaluating. TensorFlow Extended (TFX) is purpose-built for exactly these steps (ExampleGen, StatisticsGen, SchemaGen, Transform, Trainer, Evaluator) and integrates natively with Dataflow for scalable data processing and Vertex AI Pipelines for low-maintenance, managed orchestration. Kubeflow Pipelines is more general-purpose and would require more custom components, whereas TFX provides opinionated, automated components optimized for TensorFlow workloads processing large text/image datasets.
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: The training loop includes custom TensorFlow operations, which are not supported on TPUs, eliminating option B. CPU-only training (C) would be far too slow. Between the GPU options, a2‑megagpu‑16g provides larger GPUs and memory per worker, which is better for large batch sizes and long-running LLM pre-training, while using MultiWorkerMirroredStrategy for efficient scaling. This minimizes training time and overall cost compared to smaller GPUs spread across more 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: You need the same instance-level preprocessing logic applied consistently during both training and online serving. TensorFlow Transform (tf.Transform) is designed exactly for this purpose: you define preprocessing once, execute it with Apache Beam (often on Dataflow) for training data from BigQuery, and export transformation artifacts that are reused at serving time. Other options either preprocess offline only (A), are pipeline orchestration rather than reusable instance-level transforms (B), or rely on custom serving code that is not the standard, recommended approach for consistent TensorFlow preprocessing (C).
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: To ensure consistent preprocessing between training (batch Dataflow) and real-time serving, the same transformation logic must be reused. Refactoring the batch pipeline’s transformation code into reusable components and invoking that same code in the serving endpoint guarantees identical preprocessing. Data validation alone doesn’t enforce identical transformations, sharing code with end users is impractical and error-prone, and batching real-time requests through Dataflow introduces latency and undermines 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: With the Reduction Server strategy on Vertex AI, the training workers run on GPUs using your custom training container, while the Reduction Server handles gradient aggregation and communication only. The Reduction Server does not benefit from GPUs or TPUs; instead it should run the reductionserver container on CPU machines optimized for high network bandwidth. Therefore, configure the first two worker pools with GPUs and your training image, and the third pool without accelerators using a high-bandwidth machine type.
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 data preprocessing logic already exists as a SQL script running in BigQuery, so reusing it directly minimizes redevelopment time. Using Kubeflow Pipelines with BigQueryJobOp allows you to orchestrate that existing preprocessing without rewriting it in TFX or Dataflow. CustomTrainingJobOp then cleanly launches a managed Vertex AI TensorFlow training job. TFX options (C, D) would require reimplementing preprocessing with TensorFlow Transform or changing the model input pipeline, increasing development time, while Dataflow (B) adds unnecessary complexity since BigQuery already handles the transformations efficiently.
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 bridge images are best handled by deep learning (e.g., CNNs built with TensorFlow), which can automatically learn spatial and visual features relevant to defects. Integrated Gradients is specifically designed to explain deep neural network predictions by attributing importance to input pixels, producing intuitive visual explanations (e.g., heatmaps) that stakeholders can understand and act upon.
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: Cloud DLP allows you to inspect and de‑identify personally identifiable information (for example, masking, tokenization, or pseudonymization) before analysis. This enables safe data exploration and preprocessing without exposing raw PII, which is the primary requirement. Encryption options (B and D) protect data at rest but still require decryption during analysis, exposing PII, and VPC Service Controls (C) improves perimeter security but does not address PII visibility during exploration.
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 using annotated images and with sufficient budget on Google Cloud. Vertex AI AutoML for object detection is designed for rapid prototyping: it requires minimal code, directly supports bounding boxes and labels, and automatically handles model selection and hyperparameter tuning. The other options involve more manual setup and ML expertise (custom training, pipelines, or fine-tuning), which would slow down initial model creation.
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: You need services that track training parameters, log metrics per epoch, and allow comparison across model versions. Vertex ML Metadata records parameters, metrics, and lineage. Vertex AI Experiments organizes and compares multiple training runs. Vertex AI TensorBoard visualizes training metrics at each epoch. Vizier is for hyperparameter optimization and Feature Store/Pipelines are not required for experiment tracking and comparison.
$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.