Google

Professional Machine Learning Engineer Free Practice Questions — Page 19

Question 134

You work for a hospital that wants to optimize how it schedules operations. You need to create a model that uses the relationship between the number of surgeries scheduled and beds used. You want to predict how many beds will be needed for patients each day in advance based on the scheduled surgeries. You have one year of data for the hospital organized in 365 rows. The data includes the following variables for each day: • Number of scheduled surgeries • Number of beds occupied • Date You want to maximize the speed of model development and testing. What should you do?

A. Create a BigQuery table. Use BigQuery ML to build a regression model, with number of beds as the target variable, and number of scheduled surgeries and date features (such as day of week) as the predictors.
B. Create a BigQuery table. Use BigQuery ML to build an ARIMA model, with number of beds as the target variable, and date as the time variable.
C. Create a Vertex AI tabular dataset. Train an AutoML regression model, with number of beds as the target variable, and number of scheduled minor surgeries and date features (such as day of the week) as the predictors.
D. Create a Vertex AI tabular dataset. Train a Vertex AI AutoML Forecasting model, with number of beds as the target variable, number of scheduled surgeries as a covariate and date as the time variable.
Show Answer
Correct Answer: A
Explanation:
BigQuery ML regression directly models beds occupied from the scheduled surgery count and date-derived features. With only 365 rows, it is quick to build and test in SQL. The ARIMA option omits surgeries, while Vertex AI AutoML Forecasting adds complexity that is unnecessary for this small, predictor-based task. Sources: https://cloud.google.com/blog/topics/healthcare-life-sciences/looker-helps-predict-hospital-readmission-rates-with-google-cloud

Question 135

You lead a data science team at a large international corporation. Most of the models your team trains are large-scale models using high-level TensorFlow APIs on AI Platform with GPUs. Your team usually takes a few weeks or months to iterate on a new version of a model. You were recently asked to review your team’s spending. How should you reduce your Google Cloud compute costs without impacting the model’s performance?

A. Use AI Platform to run distributed training jobs with checkpoints.
B. Use AI Platform to run distributed training jobs without checkpoints.
C. Migrate to training with Kuberflow on Google Kubernetes Engine, and use preemptible VMs with checkpoints.
D. Migrate to training with Kuberflow on Google Kubernetes Engine, and use preemptible VMs without checkpoints.
Show Answer
Correct Answer: C
Explanation:
Use Kubeflow on GKE with preemptible VMs and checkpoints. Preemptible VMs cost less, and checkpoints let interrupted training resume from saved progress, avoiding the loss of substantial work. This reduces compute costs without changing the model’s training objective or performance.

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 136

You need to build an ML model for a social media application to predict whether a user’s submitted profile photo meets the requirements. The application will inform the user if the picture meets the requirements. How should you build a model to ensure that the application does not falsely accept a non-compliant picture?

A. Use AutoML to optimize the model’s recall in order to minimize false negatives.
B. Use AutoML to optimize the model’s F1 score in order to balance the accuracy of false positives and false negatives.
C. Use Vertex AI Workbench user-managed notebooks to build a custom model that has three times as many examples of pictures that meet the profile photo requirements.
D. Use Vertex AI Workbench user-managed notebooks to build a custom model that has three times as many examples of pictures that do not meet the profile photo requirements.
Show Answer
Correct Answer: A
Explanation:
Treat non-compliant photos as the positive class and optimize recall. This reduces false negatives—non-compliant photos predicted as compliant and therefore falsely accepted. F1 also balances other errors, while simply increasing examples of one class does not directly optimize the error the application needs to avoid.

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 137

You need to quickly build and train a model to predict the sentiment of customer reviews with custom categories without writing code. You do not have enough data to train a model from scratch. The resulting model should have high predictive performance. Which service should you use?

A. AutoML Natural Language
B. Cloud Natural Language API
C. AI Hub pre-made Jupyter Notebooks
D. AI Platform Training built-in algorithms
Show Answer
Correct Answer: A
Explanation:
AutoML Natural Language lets you build a text classification model for custom categories without writing code. It can leverage pretrained models, so it is more suitable than training from scratch when labeled data is limited. The Cloud Natural Language API uses predefined categories and sentiment capabilities rather than training a custom-category model.

Question 138

You have a large corpus of written support cases that can be classified into 3 separate categories: Technical Support, Billing Support, or Other Issues. You need to quickly build, test, and deploy a service that will automatically classify future written requests into one of the categories. How should you configure the pipeline?

A. Use the Cloud Natural Language API to obtain metadata to classify the incoming cases.
B. Use AutoML Natural Language to build and test a classifier. Deploy the model as a REST API.
C. Use BigQuery ML to build and test a logistic regression model to classify incoming requests. Use BigQuery ML to perform inference.
D. Create a TensorFlow model using Google’s BERT pre-trained model. Build and test a classifier, and deploy the model using Vertex AI.
Show Answer
Correct Answer: B
Explanation:
AutoML Natural Language is designed to train and evaluate a custom text classifier from labeled examples, then serve predictions through an API. That fits the need to quickly classify support cases into the organization’s three categories. Cloud Natural Language API provides general-purpose language analysis rather than a custom classifier, while the BigQuery ML and custom BERT options require more hands-on model development.

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.

$19

Get all 370 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.