Professional Machine Learning Engineer Free Practice Questions — Page 11
Question 102
You work for a large retailer, and you need to build a model to predict customer chum. The company has a dataset of historical customer data, including customer demographics purchase history, and website activity. You need to create the model in BigQuery ML and thoroughly evaluate its performance. What should you do?
A. Create a linear regression model in BigQuery ML, and register the model in Vertex AI Model Registry. Evaluate the model performance in Vertex AI .
B. Create a logistic regression model in BigQuery ML and register the model in Vertex AI Model Registry. Evaluate the model performance in Vertex AI .
C. Create a linear regression model in BigQuery ML. Use the ML.EVALUATE function to evaluate the model performance.
D. Create a logistic regression model in BigQuery ML. Use the ML.CONFUSION_MATRIX function to evaluate the model performance.
Show Answer
Correct Answer: B
Explanation: Customer churn prediction is a binary classification problem, so logistic regression is the appropriate BigQuery ML model. Linear regression is intended for continuous targets. While BigQuery ML provides evaluation functions such as ML.EVALUATE and ML.CONFUSION_MATRIX, the requirement to thoroughly evaluate performance is best matched by registering the model in Vertex AI Model Registry and using Vertex AI's richer evaluation capabilities for classification models.
Question 103
You are using Vertex AI and TensorFlow to develop a custom image classification model. You need the model’s decisions and the rationale to be understandable to your company’s stakeholders. You also want to explore the results to identify any issues or potential biases. What should you do?
A. 1. Use TensorFlow to generate and visualize features and statistics. 2. Analyze the results together with the standard model evaluation metrics.
B. 1. Use TensorFlow Profiler to visualize the model execution. 2. Analyze the relationship between incorrect predictions and execution bottlenecks.
C. 1. Use Vertex Explainable AI to generate example-based explanations. 2. Visualize the results of sample inputs from the entire dataset together with the standard model evaluation metrics.
D. 1. Use Vertex Explainable AI to generate feature attributions. Aggregate feature attributions over the entire dataset. 2. Analyze the aggregation result together with the standard model evaluation metrics.
Show Answer
Correct Answer: D
Explanation: Vertex Explainable AI feature attributions show which input features (for images, regions/pixels) most influenced each prediction, making the model's rationale understandable. Aggregating feature attributions across the dataset helps identify systematic patterns, data issues, and potential biases that are not apparent from accuracy metrics alone. Combining these aggregated explanations with standard evaluation metrics provides both interpretability and model quality assessment.
Question 104
You work for a retail company that is using a regression model built with BigQuery ML to predict product sales. This model is being used to serve online predictions. Recently you developed a new version of the model that uses a different architecture (custom model). Initial analysis revealed that both models are performing as expected. You want to deploy the new version of the model to production and monitor the performance over the next two months. You need to minimize the impact to the existing and future model users. How should you deploy the model?
A. Import the new model to the same Vertex AI Model Registry as a different version of the existing model. Deploy the new model to the same Vertex AI endpoint as the existing model, and use traffic splitting to route 95% of production traffic to the BigQuery ML model and 5% of production traffic to the new model.
B. Import the new model to the same Vertex AI Model Registry as the existing model. Deploy the models to one Vertex AI endpoint. Route 95% of production traffic to the BigQuery ML model and 5% of production traffic to the new model.
C. Import the new model to the same Vertex AI Model Registry as the existing model. Deploy each model to a separate Vertex AI endpoint.
D. Deploy the new model to a separate Vertex AI endpoint. Create a Cloud Run service that routes the prediction requests to the corresponding endpoints based on the input feature values.
Show Answer
Correct Answer: A
Explanation: Use Vertex AI's built-in canary deployment by deploying both models to the same endpoint and splitting traffic (95/5) to minimize disruption while monitoring the new model in production. Registering the new model as a new version of the existing model in the same Model Registry preserves version history and simplifies management. Separate endpoints or custom routing add unnecessary operational complexity and require client changes.
Question 105
You are building a custom image classification model and plan to use Vertex AI Pipelines to implement the end-to-end training. Your dataset consists of images that need to be preprocessed before they can be used to train the model. The preprocessing steps include resizing the images, converting them to grayscale, and extracting features. You have already implemented some Python functions for the preprocessing tasks. Which components should you use in your pipeline?
A. DataprocSparkBatchOp and CustomTrainingJobOp
B. DataflowPythonJobOp, WaitGcpResourcesOp, and CustomTrainingJobOp
C. dsl.ParallelFor, dsl.component, and CustomTrainingJobOp
D. ImageDatasetImportDataOp, dsl.component, and AutoMLImageTrainingJobRunOp
Show Answer
Correct Answer: C
Explanation: The question emphasizes that preprocessing has already been implemented as Python functions and asks which pipeline components to use. In Vertex AI Pipelines, existing Python functions are typically wrapped as reusable pipeline steps with dsl.component. If preprocessing should run over multiple partitions or batches, dsl.ParallelFor is the native pipeline construct for parallel execution. Model training is then launched with CustomTrainingJobOp. DataflowPythonJobOp is appropriate when you specifically want to submit a Dataflow job, but the prompt does not indicate Apache Beam/Dataflow or Flex Templates.
Sources:
https://cloud.google.com/blog/topics/developers-practitioners/orchestrating-pytorch-ml-workflows-vertex-ai-pipelines
https://cloud.google.com/blog/topics/developers-practitioners/scalable-ml-workflows-using-pytorch-kubeflow-pipelines-and-vertex-pipelines
Question 106
You need to use TensorFlow to train an image classification model. Your dataset is located in a Cloud Storage directory and contains millions of labeled images. Before training the model, you need to prepare the data. You want the data preprocessing and model training workflow to be as efficient, scalable, and low maintenance as possible. What should you do?
A. 1. Create a Dataflow job that creates sharded TFRecord files in a Cloud Storage directory. 2. Reference tf.data.TFRecordDataset in the training script. 3. Train the model by using Vertex AI Training with a V100 GPU.
B. 1. Create a Dataflow job that moves the images into multiple Cloud Storage directories, where each directory is named according to the corresponding label 2. Reference tfds.folder_dataset:ImageFolder in the training script. 3. Train the model by using Vertex AI Training with a V100 GPU.
C. 1. Create a Jupyter notebook that uses an nt-standard-64 V100 GPU Vertex AI Workbench instance. 2. Write a Python script that creates sharded TFRecord files in a directory inside the instance. 3. Reference tf.data.TFRecordDataset in the training script. 4. Train the model by using the Workbench instance.
D. 1. Create a Jupyter notebook that uses an n1-standard-64, V100 GPU Vertex AI Workbench instance. 2. Write a Python script that copies the images into multiple Cloud Storage directories, where each. directory is named according to the corresponding label. 3. Reference tfds.foladr_dataset.ImageFolder in the training script. 4. Train the model by using the Workbench instance.
Show Answer
Correct Answer: A
Explanation: For millions of images, the most efficient and scalable approach is to preprocess them into sharded TFRecord files using Dataflow, store them in Cloud Storage, and consume them with tf.data.TFRecordDataset during training. TFRecord provides optimized sequential reads and integrates well with TensorFlow input pipelines. Dataflow scales preprocessing, while Vertex AI Training is the managed, scalable service for distributed model training. Folder-based datasets are simpler but generally less efficient at this scale, and using a single Workbench instance for preprocessing or training is less scalable and requires more maintenance.
Question 107
You are using Keras and TensorFlow to develop a fraud detection model. Records of customer transactions are stored in a large table in BigQuery. You need to preprocess these records in a cost-effective and efficient way before you use them to train the model. The trained model will be used to perform batch inference in BigQuery. How should you implement the preprocessing workflow?
A. Implement a preprocessing pipeline by using Apache Spark, and run the pipeline on Dataproc. Save the preprocessed data as CSV files in a Cloud Storage bucket.
B. Load the data into a pandas DataFrame. Implement the preprocessing steps using pandas transformations, and train the model directly on the DataFrame.
C. Perform preprocessing in BigQuery by using SQL. Use the BigQueryClient in TensorFlow to read the data directly from BigQuery.
D. Implement a preprocessing pipeline by using Apache Beam, and run the pipeline on Dataflow. Save the preprocessed data as CSV files in a Cloud Storage bucket.
Show Answer
Correct Answer: C
Explanation: For data already stored in BigQuery and intended for batch inference in BigQuery, performing preprocessing with BigQuery SQL is the most cost-effective and efficient approach. It avoids exporting large datasets or managing separate Spark/Dataflow pipelines, keeps transformations close to the data, and enables consistent preprocessing for both training and inference. TensorFlow can read directly from BigQuery using the BigQuery client/integration for model training.
Question 108
You are investigating the root cause of a misclassification error made by one of your models. You used Vertex AI Pipelines to train and deploy the model. The pipeline reads data from BigQuery. creates a copy of the data in Cloud Storage in TFRecord format, trains the model in Vertex AI Training on that copy, and deploys the model to a Vertex AI endpoint. You have identified the specific version of that model that misclassified, and you need to recover the data this model was trained on. How should you find that copy of the data?
A. Use Vertex AI Feature Store. Modify the pipeline to use the feature store, and ensure that all training data is stored in it. Search the feature store for the data used for the training.
B. Use the lineage feature of Vertex AI Metadata to find the model artifact. Determine the version of the model and identify the step that creates the data copy and search in the metadata for its location.
C. Use the logging features in the Vertex AI endpoint to determine the timestamp of the model’s deployment. Find the pipeline run at that timestamp. Identify the step that creates the data copy, and search in the logs for its location.
D. Find the job ID in Vertex AI Training corresponding to the training for the model. Search in the logs of that job for the data used for the training.
Show Answer
Correct Answer: B
Explanation: Vertex AI Metadata lineage tracks the relationships between pipeline executions, datasets, intermediate artifacts, and model artifacts. Starting from the deployed model version, you can trace its lineage back to the pipeline run and the artifact representing the TFRecord dataset copy stored in Cloud Storage, allowing you to recover the exact training data location. Feature Store is not intended for recovering historical training dataset copies, endpoint logs do not provide artifact lineage, and training job logs are not the authoritative mechanism for tracing data artifacts.
Question 109
You recently trained a XGBoost model that you plan to deploy to production for online inference. Before sending a predict request to your model’s binary, you need to perform a simple data preprocessing step. This step exposes a REST API that accepts requests in your internal VPC Service Controls and returns predictions. You want to configure this preprocessing step while minimizing cost and effort. What should you do?
A. Store a pickled model in Cloud Storage. Build a Flask-based app, package the app in a custom container image, and deploy the model to Vertex AI Endpoints.
B. Build a Flask-based app, package the app and a pickled model in a custom container image, and deploy the model to Vertex AI Endpoints.
C. Build a custom predictor class based on XGBoost Predictor from the Vertex AI SDK, package it and a pickled model in a custom container image based on a Vertex built-in image, and deploy the model to Vertex AI Endpoints.
D. Build a custom predictor class based on XGBoost Predictor from the Vertex AI SDK, and package the handler in a custom container image based on a Vertex built-in container image. Store a pickled model in Cloud Storage, and deploy the model to Vertex AI Endpoints.
Show Answer
Correct Answer: D
Explanation: The best choice is to use a custom predictor based on the Vertex AI XGBoost Predictor and package only the custom prediction handler in a custom container built from a Vertex AI prebuilt serving image, while storing the model artifact in Cloud Storage. This minimizes custom code by reusing the built-in predictor, keeps the model artifact separate from the serving container for easier updates, and aligns with Vertex AI's recommended custom prediction routine architecture. A full Flask application is unnecessary because Vertex AI already provides the prediction server infrastructure.
Question 110
You work for a telecommunications company. You’re building a model to predict which customers may fail to pay their next phone bill. The purpose of this model is to proactively offer at-risk customers assistance such as service discounts and bill deadline extensions. The data is stored in BigQuery and the predictive features that are available for model training include:
- Customer_id
- Age
- Salary (measured in local currency)
- Sex
- Average bill value (measured in local currency)
- Number of phone calls in the last month (integer)
- Average duration of phone calls (measured in minutes)
You need to investigate and mitigate potential bias against disadvantaged groups, while preserving model accuracy.
What should you do?
A. Determine whether there is a meaningful correlation between the sensitive features and the other features. Train a BigQuery ML boosted trees classification model and exclude the sensitive features and any meaningfully correlated features.
B. Train a BigQuery ML boosted trees classification model with all features. Use the ML.GLOBAL_EXPLAIN method to calculate the global attribution values for each feature of the model. If the feature importance value for any of the sensitive features exceeds a threshold, discard the model and tram without this feature.
C. Train a BigQuery ML boosted trees classification model with all features. Use the ML.EXPLAIN_PREDICT method to calculate the attribution values for each feature for each customer in a test set. If for any individual customer, the importance value for any feature exceeds a predefined threshold, discard the model and train the model again without this feature.
D. Define a fairness metric that is represented by accuracy across the sensitive features. Train a BigQuery ML boosted trees classification model with all features. Use the trained model to make predictions on a test set. Join the data back with the sensitive features, and calculate a fairness metric to investigate whether it meets your requirements.
Show Answer
Correct Answer: D
Explanation: The appropriate approach is to evaluate fairness explicitly rather than assume that removing sensitive or correlated features eliminates bias. Train the model, evaluate it on a held-out test set, then analyze performance and fairness metrics across protected groups by joining predictions back to sensitive attributes. This investigates disparate performance while preserving predictive features unless evidence shows mitigation is needed. Feature importance (global or local) is for interpretability, not fairness assessment, and removing correlated features can unnecessarily reduce accuracy without eliminating proxy bias.
Question 111
You are building a MLOps platform to automate your company’s ML experiments and model retraining. You need to organize the artifacts for dozens of pipelines. How should you store the pipelines’ artifacts?
A. Store parameters in Cloud SQL, and store the models’ source code and binaries in GitHub.
B. Store parameters in Cloud SQL, store the models’ source code in GitHub, and store the models’ binaries in Cloud Storage.
C. Store parameters in Vertex ML Metadata, store the models’ source code in GitHub, and store the models’ binaries in Cloud Storage.
D. Store parameters in Vertex ML Metadata and store the models’ source code and binaries in GitHub.
Show Answer
Correct Answer: C
Explanation: Vertex ML Metadata is designed to track ML pipeline metadata, including parameters, artifacts, lineage, and executions. Source code should be version-controlled in GitHub, while model binaries and other large artifacts are best stored in Cloud Storage rather than Git. This aligns with recommended MLOps architecture on Google Cloud.
$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.