Google

Professional Machine Learning Engineer Free Practice Questions — Page 6

Question 52

You developed a BigQuery ML linear regressor model by using a training dataset stored in a BigQuery table. New data is added to the table every minute. You are using Cloud Scheduler and Vertex AI Pipelines to automate hourly model training, and use the model for direct inference. The feature preprocessing logic includes quantile bucketization and MinMax scaling on data received in the last hour. You want to minimize storage and computational overhead. What should you do?

A. Preprocess and stage the data in BigQuery prior to feeding it to the model during training and inference.
B. Use the TRANSFORM clause in the CREATE MODEL statement in the SQL query to calculate the required statistics.
C. Create a component in the Vertex AI Pipelines directed acyclic graph (DAG) to calculate the required statistics, and pass the statistics on to subsequent components.
D. Create SQL queries to calculate and store the required statistics in separate BigQuery tables that are referenced in the CREATE MODEL statement.
Show Answer
Correct Answer: B
Explanation:
The TRANSFORM clause in BigQuery ML is designed to define feature preprocessing as part of model creation. BigQuery ML persists the learned transformation parameters with the model and automatically applies the same preprocessing during prediction, avoiding separate staging tables or pipeline components. This minimizes both storage and operational/computational overhead compared with preprocessing externally or maintaining separate statistics tables.

Question 53

You work for a hospital. You received approval to collect the necessary patient data, and you trained a Vertex AI tabular AutoML model that calculates patients' risk score for hospital admission. You deployed the model. However, you're concerned that patient demographics might change over time and alter the feature interactions and impact prediction accuracy. You want to be alerted if feature interactions change, and you want to understand the importance of the features for the predictions. You want your alerting approach to minimize cost. What should you do?

A. Create a feature drift monitoring job. Set the sampling rate to 1 and the monitoring frequency to weekly.
B. Create a feature drift monitoring job. Set the sampling rate to 0.1 and the monitoring frequency to weekly.
C. Create a feature attribution drift monitoring job. Set the sampling rate to 1 and the monitoring frequency to weekly.
D. Create a feature attribution drift monitoring job. Set the sampling rate to 0.1 and the monitoring frequency to weekly.
Show Answer
Correct Answer: D
Explanation:
Feature attribution drift monitoring is designed to detect changes in feature attributions (explanations), which reflect how features influence predictions over time. This directly addresses concerns about changing feature interactions and the need to understand feature importance. Using a 0.1 sampling rate minimizes monitoring cost while still providing ongoing detection, and weekly monitoring satisfies the alerting requirement.

Question 54

You developed a Python module by using Keras to train a regression model. You developed two model architectures, linear regression and deep neural network (DNN), within the same module. You are using the training_method argument to select one of the two methods, and you are using the learning_rate and num_hidden_layers arguments in the DNN. You plan to use Vertex AI's hypertuning service with a budget to perform 100 trials. You want to identify the model architecture and hyperparameter values that minimize training loss and maximize model performance. What should you do?

A. Run one hypertuning job for 100 trials. Set num_hidden_layers as a conditional hyperparameter based on its parent hyperparameter training_method, and set learning_rate as a non-conditional hyperparameter.
B. Run two separate hypertuning jobs, a linear regression job for 50 trials, and a DNN job for 50 trials. Compare their final performance on a common validation set, and select the set of hyperparameters with the least training loss.
C. Run one hypertuning job with training_method as the hyperparameter for 50 trials. Select the architecture with the lowest training loss, and further hypertune it and its corresponding hyperparameters tor 50 trials.
D. Run one hypertuning job for 100 trials. Set num_hidden_layers and learning_rate as conditional hyperparameters based on their parent hyperparameter training_method.
Show Answer
Correct Answer: D
Explanation:
Use a single Vertex AI hyperparameter tuning job across the full trial budget and model the architecture choice with a parent hyperparameter (training_method). Hyperparameters that are only meaningful for the DNN should be conditional on that parent. Since the question explicitly states that both learning_rate and num_hidden_layers are used in the DNN, both should be conditional so they are only explored when the DNN architecture is selected. This efficiently searches both architectures within one tuning job while avoiding irrelevant hyperparameter combinations.

Question 55

You have recently developed a custom model for image classification by using a neural network. You need to automatically identify the values for learning rate, number of layers, and kernel size. To do this, you plan to run multiple jobs in parallel to identify the parameters that optimize performance. You want to minimize custom code development and infrastructure management. What should you do?

A. Train an AutoML image classification model.
B. Create a custom training job that uses the Vertex AI Vizier SDK for parameter optimization.
C. Create a Vertex AI hyperparameter tuning job.
D. Create a Vertex AI pipeline that runs different model training jobs in parallel.
Show Answer
Correct Answer: C
Explanation:
Vertex AI Hyperparameter Tuning is designed to optimize hyperparameters such as learning rate, number of layers, and kernel size by launching multiple training trials in parallel and using Vizier behind the scenes. It minimizes custom code and infrastructure management compared with directly using the Vizier SDK. AutoML is not appropriate because the user already has a custom neural network model, and a pipeline that runs parallel jobs does not provide automated hyperparameter search.

Question 56

You have a custom job that runs on Vertex AI on a weekly basis. The job is implemented using a proprietary ML workflow that produces the datasets, models, and custom artifacts, and sends them to a Cloud Storage bucket. Many different versions of the datasets and models were created. Due to compliance requirements, your company needs to track which model was used for making a particular prediction, and needs access to the artifacts for each model. How should you configure your workflows to meet these requirements?

A. Use the Vertex AI Metadata API inside the custom job to create context, execution, and artifacts for each model, and use events to link them together.
B. Create a Vertex AI experiment, and enable autologging inside the custom job.
C. Configure a TensorFlow Extended (TFX) ML Metadata database, and use the ML Metadata API.
D. Register each model in Vertex AI Model Registry, and use model labels to store the related dataset and model information.
Show Answer
Correct Answer: A
Explanation:
Vertex AI Metadata API is designed for custom ML workflows and lineage tracking. By creating contexts, executions, artifacts, and linking them with events, you can record end-to-end lineage between datasets, models, custom artifacts, and executions. This satisfies compliance requirements to identify which model produced a prediction and retain access to associated artifacts. Experiments with autologging are aimed at experiment tracking rather than comprehensive custom lineage, TFX ML Metadata is intended for TFX pipelines rather than Vertex AI custom jobs, and Model Registry alone does not capture full artifact lineage or arbitrary workflow metadata.

Question 57

You work for a multinational organization that has recently begun operations in Spain. Teams within your organization will need to work with various Spanish documents, such as business, legal, and financial documents. You want to use machine learning to help your organization get accurate translations quickly and with the least effort. Your organization does not require domain-specific terms or jargon. What should you do?

A. Create a Vertex AI Workbench notebook instance. In the notebook, extract sentences from the documents, and train a custom AutoML text model.
B. Use Google Translate to translate 1,000 phrases from Spanish to English. Using these translated pairs, train a custom AutoML Translation model.
C. Use the Document Translation feature of the Cloud Translation API to translate the documents.
D. Create a Vertex AI Workbench notebook instance. In the notebook, convert the Spanish documents into plain text, and create a custom TensorFlow seq2seq translation model.
Show Answer
Correct Answer: C
Explanation:
The built-in Document Translation feature of the Cloud Translation API is designed to translate entire documents quickly with minimal setup and supports common business document types. Because there is no requirement for domain-specific terminology or custom translation quality, a pre-trained translation service is the most appropriate and lowest-effort solution. Training AutoML or custom TensorFlow models would require unnecessary data preparation and model development.

Question 58

You work at a large organization that recently decided to move their ML and data workloads to Google Cloud. The data engineering team has exported the structured data to a Cloud Storage bucket in Avro format. You need to propose a workflow that performs analytics, creates features, and hosts the features that your ML models use for online prediction. How should you configure the pipeline?

A. Ingest the Avro files into Cloud Spanner to perform analytics. Use a Dataflow pipeline to create the features, and store them in Vertex AI Feature Store for online prediction.
B. Ingest the Avro files into BigQuery to perform analytics. Use a Dataflow pipeline to create the features, and store them in Vertex AI Feature Store for online prediction.
C. Ingest the Avro files into Cloud Spanner to perform analytics. Use a Dataflow pipeline to create the features, and store them in BigQuery for online prediction.
D. Ingest the Avro files into BigQuery to perform analytics. Use BigQuery SQL to create features and store them in a separate BigQuery table for online prediction.
Show Answer
Correct Answer: B
Explanation:
BigQuery is the appropriate analytics warehouse and natively supports loading Avro data from Cloud Storage. Dataflow is well suited for scalable feature engineering pipelines, and Vertex AI Feature Store is designed to serve features with low latency for online prediction. Cloud Spanner is a transactional database rather than an analytics engine, and BigQuery alone is not the preferred online feature serving layer.

Question 59

You are using Kubeflow Pipelines to develop an end-to-end PyTorch-based MLOps pipeline. The pipeline reads data from BigQuery, processes the data, conducts feature engineering, model training, model evaluation, and deploys the model as a binary file to Cloud Storage. You are writing code for several different versions of the feature engineering and model training steps, and running each new version in Vertex AI Pipelines. Each pipeline run is taking over an hour to complete. You want to speed up the pipeline execution to reduce your development time, and you want to avoid additional costs. What should you do?

A. Comment out the part of the pipeline that you are not currently updating.
B. Enable caching in all the steps of the Kubeflow pipeline.
C. Delegate feature engineering to BigQuery and remove it from the pipeline.
D. Add a GPU to the model training step.
Show Answer
Correct Answer: B
Explanation:
Enable step caching in Vertex AI Pipelines/Kubeflow Pipelines so unchanged components (such as data ingestion, preprocessing, or evaluation) reuse previous outputs instead of recomputing them. Since only feature engineering and training code are changing between iterations, caching skips unaffected steps, significantly reducing runtime without increasing compute costs. Commenting out steps breaks the end-to-end workflow, moving feature engineering to BigQuery changes the architecture rather than addressing iterative development speed, and adding a GPU would typically increase cost.

Question 60

You are creating an ML pipeline for data processing, model training, and model deployment that uses different Google Cloud services. You have developed code for each individual task, and you expect a high frequency of new files. You now need to create an orchestration layer on top of these tasks. You only want this orchestration pipeline to run if new files are present in your dataset in a Cloud Storage bucket. You also want to minimize the compute node costs. What should you do?

A. Create a pipeline in Vertex AI Pipelines. Configure the first step to compare the contents of the bucket to the last time the pipeline was run. Use the scheduler API to run the pipeline periodically.
B. Create a Cloud Function that uses a Cloud Storage trigger and deploys a Cloud Composer directed acyclic graph (DAG).
C. Create a pipeline in Vertex AI Pipelines. Create a Cloud Function that uses a Cloud Storage trigger and deploys the pipeline.
D. Deploy a Cloud Composer directed acyclic graph (DAG) with a GCSObjectUpdateSensor class that detects when a new file is added to the Cloud Storage bucket.
Show Answer
Correct Answer: C
Explanation:
Vertex AI Pipelines is the managed service designed for ML workflow orchestration. Triggering it with a Cloud Storage event via Cloud Functions makes the workflow event-driven so it runs only when new files arrive, avoiding periodic polling and minimizing compute costs. Cloud Composer environments are always-on and incur ongoing compute costs even when using GCS sensors, making them less cost-efficient for this requirement.

Question 61

You need to train an XGBoost model on a small dataset. Your training code requires custom dependencies. You want to minimize the startup time of your training job. How should you set up your Vertex AI custom training job?

A. Store the data in a Cloud Storage bucket, and create a custom container with your training application. In your training application, read the data from Cloud Storage and train the model.
B. Use the XGBoost prebuilt custom container. Create a Python source distribution that includes the data and installs the dependencies at runtime. In your training application, load the data into a pandas DataFrame and train the model.
C. Create a custom container that includes the data. In your training application, load the data into a pandas DataFrame and train the model.
D. Store the data in a Cloud Storage bucket, and use the XGBoost prebuilt custom container to run your training application. Create a Python source distribution that installs the dependencies at runtime. In your training application, read the data from Cloud Storage and train the model.
Show Answer
Correct Answer: C
Explanation:
To minimize startup time, avoid runtime dependency installation by using a custom container with all dependencies preinstalled. Because the dataset is explicitly described as small, bundling it into the custom container avoids an additional Cloud Storage read at job startup. Options B and D install dependencies at runtime, increasing startup latency. Option A still requires fetching the dataset from Cloud Storage. Sources: https://k21academy.com/google-cloud/custom-jobs-in-vertex-ai-customize-train-and-deploy-your-models

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