Google

Professional Machine Learning Engineer Free Practice Questions — Page 14

Question 132

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:
For a PySpark workload migration proof of concept, Google Cloud's managed Spark service (Dataproc) minimizes operational effort compared with manually configuring VMs or GKE. Pairing it with a Vertex AI Workbench notebook provides an interactive development environment while executing Spark jobs on a proper managed Spark cluster. A and B require manual setup. A standalone Vertex AI Workbench instance can support development, but by itself it is not the intended managed execution environment for migrating Spark workloads.

Question 133

You developed a Vertex AI pipeline that trains a classification model on data stored in a large BigQuery table. The pipeline has four steps, where each step is created by a Python function that uses the KubeFlow v2 API. The components have the following names: You launch your Vertex AI pipeline as the following: You perform many model iterations by adjusting the code and parameters of the training step. You observe high costs associated with the development, particularly the data export and preprocessing steps. You need to reduce model development costs. What should you do?

A. Change the components’ YAML filenames to export.yaml, preprocess,yaml, f "train- {dt}.yaml", f"calibrate-{dt).vaml".
B. Add the {"kubeflow.v1.caching": True} parameter to the set of params provided to your PipelineJob.
C. Move the first step of your pipeline to a separate step, and provide a cached path to Cloud Storage as an input to the main pipeline.
D. Change the name of the pipeline to f"my-awesome-pipeline-{dt}".
Show Answer
Correct Answer: A
Explanation:
Kubeflow/Vertex AI pipeline caching depends on the component specification and inputs. If the component YAML filenames are generated with a timestamp (for example, train-{dt}.yaml or export variants), the component identity changes between runs, preventing cache reuse. Using stable component YAML filenames allows expensive unchanged steps such as data export and preprocessing to be reused across iterative training runs. Option B is not appropriate for KFP v2 in this form, C requires redesign rather than fixing the caching issue, and D further defeats cache reuse by changing pipeline identity.

Question 134

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: A
Explanation:
Use OCR to extract text from the PDFs with the Vision API, then use Natural Language API analyzeSentiment to obtain an overall sentiment score that maps to customer satisfaction. analyzeEntitySentiment is intended for sentiment toward specific entities, not overall document sentiment. A custom Document AI extractor requires training and is unnecessary when the goal is to quickly process forms and obtain the comments' sentiment.

Question 135

You developed a Transformer model in TensorFlow to translate text. Your training data includes millions of documents in a Cloud Storage bucket. You plan to use distributed training to reduce training time. You need to configure the training job while minimizing the effort required to modify code and to manage the cluster’s configuration. What should you do?

A. Create a Vertex AI custom training job with GPU accelerators for the second worker pool. Use tf.distribute.MultiWorkerMirroredStrategy for distribution.
B. Create a Vertex AI custom distributed training job with Reduction Server. Use N1 high-memory machine type instances for the first and second pools, and use N1 high-CPU machine type instances for the third worker pool.
C. Create a training job that uses Cloud TPU VMs. Use tf.distribute.TPUStrategy for distribution.
D. Create a Vertex AI custom training job with a single worker pool of A2 GPU machine type instances. Use tf.distribute.MirroredStrategv for distribution.
Show Answer
Correct Answer: A
Explanation:
The requirement is distributed training with minimal code changes and minimal cluster management. Vertex AI custom training manages the infrastructure, and TensorFlow's tf.distribute.MultiWorkerMirroredStrategy is the standard approach for synchronous multi-worker GPU training with only small code modifications. Option D is not distributed because it uses a single worker pool. Option B adds unnecessary Reduction Server complexity. Option C can provide excellent performance for Transformers, but migrating to TPUs typically requires more validation and potentially TPU-specific adaptations than scaling existing GPU training with MultiWorkerMirroredStrategy on Vertex AI.

Question 136

You work as an analyst at a large banking firm. You are developing a robust scalable ML pipeline to tram several regression and classification models. Your primary focus for the pipeline is model interpretability. You want to productionize the pipeline as quickly as possible. What should you do?

A. Use Tabular Workflow for Wide & Deep through Vertex AI Pipelines to jointly train wide linear models and deep neural networks
B. Use Google Kubernetes Engine to build a custom training pipeline for XGBoost-based models
C. Use Tabular Workflow for TabNet through Vertex AI Pipelines to train attention-based models
D. Use Cloud Composer to build the training pipelines for custom deep learning-based models
Show Answer
Correct Answer: C
Explanation:
The best fit is the managed Tabular Workflow for TabNet through Vertex AI Pipelines. It supports scalable training for tabular regression and classification while emphasizing interpretability through TabNet's sequential attention mechanism. Because it is a prebuilt Vertex AI workflow, it also enables faster productionization than building custom pipelines on GKE or Cloud Composer. Wide & Deep includes a deep neural network component and is not primarily designed around interpretability.

Question 137

You work for a retail company. You have been asked to develop a model to predict whether a customer will purchase a product on a given day. Your team has processed the company’s sales data, and created a table with the following rows: • Customer_id • Product_id • Date • Days_since_last_purchase (measured in days) • Average_purchase_frequency (measured in 1/days) • Purchase (binary class, if customer purchased product on the Date) You need to interpret your model’s results for each individual prediction. What should you do?

A. Create a BigQuery table. Use BigQuery ML to build a boosted tree classifier. Inspect the partition rules of the trees to understand how each prediction flows through the trees.
B. Create a Vertex AI tabular dataset. Train an AutoML model to predict customer purchases. Deploy the model to a Vertex AI endpoint and enable feature attributions. Use the “explain” method to get feature attribution values for each individual prediction.
C. Create a BigQuery table. Use BigQuery ML to build a logistic regression classification model. Use the values of the coefficients of the model to interpret the feature importance, with higher values corresponding to more importance
D. Create a Vertex AI tabular dataset. Train an AutoML model to predict customer purchases. Deploy the model to a Vertex AI endpoint. At each prediction, enable L1 regularization to detect non-informative features.
Show Answer
Correct Answer: B
Explanation:
The requirement is to interpret results for each individual prediction (local explainability). Vertex AI's feature attributions provide per-prediction explanations by showing how each feature contributed to that specific prediction. Inspecting tree rules or logistic regression coefficients provides model-level or cumbersome interpretation rather than direct local explanations, and L1 regularization is for feature selection, not explaining individual predictions.

Question 138

You work for a social media company. You want to create a no-code image classification model for an iOS mobile application to identify fashion accessories. You have a labeled dataset in Cloud Storage. You need to configure a training workflow that minimizes cost and serves predictions with the lowest possible latency. What should you do?

A. Train the model by using AutoML, and register the model in Vertex AI Model Registry. Configure your mobile application to send batch requests during prediction.
B. Train the model by using AutoML Edge, and export it as a Core ML model. Configure your mobile application to use the .mlmodel file directly.
C. Train the model by using AutoML Edge, and export the model as a TFLite model. Configure your mobile application to use the .tflite file directly.
D. Train the model by using AutoML, and expose the model as a Vertex AI endpoint. Configure your mobile application to invoke the endpoint during prediction.
Show Answer
Correct Answer: B
Explanation:
Use a no-code AutoML Edge image classification workflow and deploy the model on-device. For an iOS application, exporting to Core ML (.mlmodel) provides native on-device inference, which minimizes serving latency by avoiding network calls and reduces ongoing serving costs because no hosted endpoint is required. Vertex AI endpoints introduce network latency and serving costs, and TensorFlow Lite is cross-platform but Core ML is the native format for iOS.

Question 139

Your company stores a large number of audio files of phone calls made to your customer call center in an on-premises database. Each audio file is in wav format and is approximately 5 minutes long. You need to analyze these audio files for customer sentiment. You plan to use the Speech-to-Text API You want to use the most efficient approach. What should you do?

A. 1. Upload the audio files to Cloud Storage 2. Call the speech:longrunningrecognize API endpoint to generate transcriptions 3. Call the predict method of an AutoML sentiment analysis model to analyze the transcriptions.
B. 1. Upload the audio files to Cloud Storage. 2. Call the speech:longrunningrecognize API endpoint to generate transcriptions 3. Create a Cloud Function that calls the Natural Language API by using the analyzeSentiment method
C. 1. Iterate over your local files in Python 2. Use the Speech-to-Text Python library to create a speech.RecognitionAudio object, and set the content to the audio file data 3. Call the speech:recognize API endpoint to generate transcriptions 4. Call the predict method of an AutoML sentiment analysis model to analyze the transcriptions.
D. 1. Iterate over your local files in Python 2. Use the Speech-to-Text Python Library to create a speech.RecognitionAudio object and set the content to the audio file data 3. Call the speech:longrunningrecognize API endpoint to generate transcriptions. 4. Call the Natural Language API by using the analyzeSentiment method
Show Answer
Correct Answer: B
Explanation:
For ~5-minute audio files, uploading to Cloud Storage and using the asynchronous speech:longrunningrecognize API is the appropriate transcription approach. For sentiment analysis, the built-in Natural Language API analyzeSentiment is the most efficient choice when no custom domain-specific model or labeled training data requirement is stated. AutoML would require training and is unnecessary for this generic sentiment analysis task. A Cloud Function is a reasonable way to automate invoking the Natural Language API after transcription.

Question 140

You work for a retail company. You have created a Vertex AI forecast model that produces monthly item sales predictions. You want to quickly create a report that will help to explain how the model calculates the predictions. You have one month of recent actual sales data that was not included in the training dataset. How should you generate data for your report?

A. Create a batch prediction job by using the actual sales data. Compare the predictions to the actuals in the report.
B. Create a batch prediction job by using the actual sales data, and configure the job settings to generate feature attributions. Compare the results in the report.
C. Generate counterfactual examples by using the actual sales data. Create a batch prediction job using the actual sales data and the counterfactual examples. Compare the results in the report.
D. Train another model by using the same training dataset as the original, and exclude some columns. Using the actual sales data create one batch prediction job by using the new model and another one with the original model. Compare the two sets of predictions in the report.
Show Answer
Correct Answer: B
Explanation:
Feature attributions are the appropriate explainability mechanism for Vertex AI predictions. Running a batch prediction job on the held-out actual sales data with feature attributions enabled produces both predictions and per-feature contribution scores, allowing a report that explains why the model made each prediction. Simply comparing predictions to actuals evaluates accuracy but does not explain the model, while counterfactuals or retraining another model are unnecessary for this goal.

Question 141

You recently deployed a model to a Vertex AI endpoint. Your data drifts frequently, so you have enabled request-response logging and created a Vertex AI Model Monitoring job. You have observed that your model is receiving higher traffic than expected. You need to reduce the model monitoring cost while continuing to quickly detect drift. What should you do?

A. Replace the monitoring job with a DataFlow pipeline that uses TensorFlow Data Validation (TFDV)
B. Replace the monitoring job with a custom SQL script to calculate statistics on the features and predictions in BigQuery
C. Decrease the sample_rate parameter in the RandomSampleConfig of the monitoring job
D. Increase the monitor_interval parameter in the ScheduleConfig of the monitoring job
Show Answer
Correct Answer: C
Explanation:
Decreasing the RandomSampleConfig sample_rate reduces the proportion of prediction requests analyzed by Vertex AI Model Monitoring, directly lowering monitoring costs while preserving the monitoring frequency. Increasing the monitor_interval would delay drift detection, contrary to the requirement to detect drift quickly. Replacing the managed monitoring solution with Dataflow/TFDV or custom BigQuery SQL adds operational complexity and is not the most appropriate cost optimization for this scenario.

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