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: The goal is a low-cost, low-effort proof of concept to migrate an existing PySpark workload. Cloud Dataproc is Google Cloud’s managed Spark service and is explicitly designed for this migration use case. A standard Dataproc cluster provides Spark preconfigured, requires no manual installation, and closely matches an on‑prem Spark environment, making the PoC realistic and representative of a future production design. Options A and B require significant manual setup and operational overhead, while option D alone provides an interactive notebook environment but does not, by itself, represent a managed Spark cluster for running and scaling PySpark jobs.
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: Vertex AI Pipelines (KFP v2) rely on component input signatures for caching. Using dynamic names (for example including a timestamp like {dt}) changes the component definition or inputs on every run, which prevents reuse of cached outputs. By changing the component YAML filenames to stable, deterministic names, the expensive export and preprocessing steps can be cached and reused across iterations, significantly reducing development cost. Options B and C are either not applicable to KFP v2 or add unnecessary complexity, and D has no impact on execution or cost.
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: C
Explanation: The forms have a consistent layout and the comments are scanned from paper PDFs, so using Document AI with a custom extractor is the most reliable way to accurately extract only the comments section. Once the relevant text is extracted, the Natural Language API analyzeSentiment feature is the correct choice to compute an overall sentiment score, which directly maps to overall customer satisfaction. Entity sentiment is unnecessary because the goal is a single overall score, not sentiment toward specific entities, and Vision API alone is less precise for structured form extraction.
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 goal is to use distributed training while minimizing code changes and cluster management. A Vertex AI custom training job is fully managed, so you do not need to configure or manage the cluster manually. Using tf.distribute.MultiWorkerMirroredStrategy enables synchronous multi-node GPU training with minimal code modifications to an existing TensorFlow model.
Option B adds unnecessary complexity with multiple pools and a reduction server. Option C (TPUs) often requires additional code adaptations and TPU-specific configuration, increasing effort. Option D only uses a single worker pool, which limits true distributed, multi-node training and does not scale as effectively. Therefore, A best meets all requirements.
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 requirements emphasize strong model interpretability and rapid productionization for tabular regression and classification. Vertex AI Tabular Workflows with TabNet are purpose-built for this: they are managed, scalable, and quick to deploy, and TabNet provides inherent interpretability via its sequential attention mechanism with feature attributions. The other options either emphasize less interpretable models, require more custom engineering, or are not optimized for fast, managed ML pipelines.
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 interpretability). Vertex AI AutoML supports per-prediction feature attributions via the explain method, which shows how each feature contributes to a specific prediction. Other options provide only global importance or indirect, cumbersome interpretability and do not directly explain 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: You need a no-code workflow with minimal cost and the lowest latency for an iOS app. Training with AutoML Edge is designed for on-device (edge) deployment and requires no custom code. Exporting the model as a Core ML (.mlmodel) file allows the iOS app to run inference directly on the device, eliminating network calls, minimizing latency, and avoiding ongoing endpoint serving costs. Cloud-hosted endpoints or batch predictions introduce network latency and higher operational costs, and TFLite is less native to iOS than Core ML.
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: The audio files are long (≈5 minutes), so the efficient and supported approach is to upload them to Cloud Storage and use the asynchronous speech:longrunningrecognize API. For sentiment analysis, using the pre-trained Natural Language API analyzeSentiment method is the most efficient choice because it requires no custom training or labeled data, unlike AutoML sentiment analysis, which would add unnecessary complexity and overhead. Local processing and the synchronous speech:recognize API are not suitable for large volumes of long audio files.
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: To explain how a Vertex AI forecasting model generates its predictions, you need model interpretability, not just accuracy comparison. Running a batch prediction job with feature attributions enabled provides per-feature contribution information for each prediction, which directly explains the drivers behind forecasted sales. Simply comparing predictions to actuals (A) does not explain model logic, counterfactuals (C) are unnecessary for a quick report, and retraining another model (D) is inefficient and indirect. Therefore, generating batch predictions with feature attributions is the correct approach.
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: Reducing the sample_rate in RandomSampleConfig lowers the volume of requests analyzed by Vertex AI Model Monitoring, directly reducing monitoring costs while still allowing near-real-time drift detection. Increasing the monitoring interval would delay detection, and replacing the managed monitoring with custom pipelines or SQL increases complexity without guaranteeing faster or cheaper detection.
$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.