Professional Machine Learning Engineer Free Practice Questions — Page 3
Question 21
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. Use Vertex AI to evaluate the model performance.
B. Create a logistic regression model in BigQuery ML, and register the model in Vertex AI Model Registry. Use ML.ARIMA_EVALUATE function to evaluate the model performance.
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: D
Explanation: Customer churn prediction is a binary classification problem, so a logistic regression model is appropriate in BigQuery ML. ML.CONFUSION_MATRIX is used to evaluate classification performance by comparing predicted and actual labels. Linear regression is for continuous targets, and ML.ARIMA_EVALUATE is for time-series forecasting, not classification.
Question 22
You are an ML engineer at a bank. The bank's leadership team wants to reduce the number of loan defaults. The bank has labeled historic data about loan defaults stored in BigQuery. You have been asked to use AI to support the loan application process. For compliance reasons, you need to provide explanations for loan rejections. What should you do?
A. Import the historic loan default data into AutoML. Train and deploy a linear regression model to predict default probability. Report the probability of default for each loan application.
B. Create a custom application that uses the Gemini large language model (LLM). Provide the historic data as context to the model, and prompt the model to predict customer defaults. Report the prediction and explanation provided by the LLM for each loan application.
C. Train and deploy a BigQuery ML classification model trained on historic loan default data. Enable feature-based explanations for each prediction. Report the prediction, probability of default, and feature attributions for each loan application.
D. Load the historic loan default data into a Vertex AI Workbench instance. Train a deep learning classification model using TensorFlow to predict loan default. Run inference for each loan application, and report the predictions.
Show Answer
Correct Answer: C
Explanation: A classification model is appropriate for predicting loan default (a binary outcome), and BigQuery ML can train directly on BigQuery data while supporting feature-based explanations (feature attributions) for individual predictions, which helps satisfy compliance requirements. Option A incorrectly uses linear regression for a classification problem, B relies on an LLM rather than supervised predictive modeling for structured labeled data, and D does not address the requirement to provide explanations.
Question 23
You are developing a natural language processing model that analyzes customer feedback to identify positive, negative, and neutral experiences. During the testing phase, you notice that the model demonstrates a significant bias against certain demographic groups, leading to skewed analysis results. You want to address this issue following Google's responsible AI practices. What should you do?
A. Use Vertex AI's model evaluation lo assess bias in the model's predictions, and use post-processing to adjust outputs for identified demographic discrepancies.
B. Implement a more complex model architecture that can capture nuanced patterns in language to reduce bias.
C. Audit the training dataset to identify underrepresented groups and augment the dataset with additional samples before retraining the model.
D. Use Vertex Explainable AI to generate explanations and systematically adjust the predictions to address identified biases.
Show Answer
Correct Answer: C
Explanation: The most appropriate action under Google's Responsible AI practices is to address bias at its source by auditing the training data, identifying underrepresented groups, and improving dataset representation before retraining. Increasing model complexity does not inherently reduce bias. Explainability helps diagnose behavior but does not mitigate bias by itself. While Vertex AI bias evaluation is useful for measuring bias, relying on post-processing to adjust outputs is generally not the preferred root-cause mitigation compared with improving the training data.
Question 24
You recently deployed an image classification model on Google Cloud. You used Cloud Build to build a CI/CD pipeline for the model. You need to ensure that the model stays up-to-date with data and code changes by using an efficient retraining process. What should you do?
A. Use Cloud Run functions to monitor data drift in real time and trigger a Vertex AI Training job to retrain the model when data drift exceeds a predetermined threshold.
B. Configure a Git repository trigger in Cloud Build to initiate retraining when there are new code commits to the model's repository and a Pub/Sub trigger when there is new data in Cloud Storage.
C. Use Cloud Scheduler to initiate a daily retraining job in Vertex AI Pipelines.
D. Configure Cloud Composer to orchestrate a weekly retraining job that includes data extraction from BigQuery, model retraining with Vertex AI Training, and model deployment to a Vertex AI endpoint.
Show Answer
Correct Answer: B
Explanation: Option B is the best fit because it automates retraining based on both relevant code changes (via Cloud Build Git triggers) and new data arrivals (via Pub/Sub notifications from Cloud Storage), aligning with an event-driven CI/CD/MLOps workflow. Option A only addresses data drift and not code changes. Options C and D rely on fixed schedules, which are less efficient than triggering retraining only when code or data changes.
Question 25
You need to train a ControlNet model with Stable Diffusion XL for an image editing use case. You want to train this model as quickly as possible. Which hardware configuration should you choose to train your model?
A. Configure one a2-highgpu-1g instance with an NVIDIA A100 GPU with 80 GB of RAM. Use float32 precision during model training.
B. Configure one a2-highgpu-1g instance with an NVIDIA A100 GPU with 80 GB of RAM. Use bfloat16 quantization during model training.
C. Configure four n1-standard-16 instances, each with one NVIDIA Tesla T4 GPU with 16 GB of RAM. Use float32 precision during model training.
D. Configure four n1-standard-16 instances, each with one NVIDIA Tesla T4 GPU with 16 GB of RAM. Use floar16 quantization during model training.
Show Answer
Correct Answer: B
Explanation: An NVIDIA A100 80 GB is well suited for Stable Diffusion XL and ControlNet training. Using bfloat16 on A100 hardware significantly improves training throughput and reduces memory usage compared with float32 while maintaining training quality. The T4 GPUs have substantially less memory, making SDXL ControlNet training much more constrained even with mixed precision, and four separate T4 instances are not the fastest choice for this workload.
Question 26
You are the lead ML engineer on a mission-critical project that involves analyzing massive datasets using Apache Spark. You need to establish a robust environment that allows your team to rapidly prototype Spark models using Jupyter notebooks. What is the fastest way to achieve this?
A. Set up a Vertex AI Workbench instance with a Spark kernel.
B. Use Colab Enterprise with a Spark kernel.
C. Set up a Dataproc cluster with Spark and use Jupyter notebooks.
D. Configure a Compute Engine instance with Spark and use Jupyter notebooks.
Show Answer
Correct Answer: A
Explanation: Vertex AI Workbench with a Spark kernel provides the quickest managed notebook environment for Spark-based prototyping while offering an enterprise-grade, collaborative development experience. It integrates with managed Spark services, avoiding the need to provision and manage a Dataproc cluster directly. Dataproc is purpose-built for Spark execution, but creating and managing a cluster is an extra setup step. Colab Enterprise is fast for notebooks, but the emphasis on a robust, mission-critical environment favors Vertex AI Workbench.
Sources:
https://cloud.google.com/vertex-ai-notebooks?hl=en
Question 27
You are training a large-scale deep learning model on a Cloud TPU. While monitoring the training progress through Tensorboard, you observe that the TPU utilization is consistently low and there are delays between the completion of one training step and the start of the next step. You want to improve TPU utilization and overall training performance. How should you address this issue?
A. Apply tf.data.Detaset.map with vectorized operations and parallelization.
B. Use tf.data.Detaset.interleave with multiple data sources.
C. Use tf.data.Detaset.cache on the dataset after the first epoch.
D. Implement tf.data.Detaset.prefetch in the data pipeline.
Show Answer
Correct Answer: D
Explanation: Low TPU utilization with gaps between training steps typically indicates an input pipeline bottleneck. Using tf.data.Dataset.prefetch overlaps input pipeline work (reading, preprocessing, transferring batches) with model execution so the next batch is ready when the current step finishes, reducing idle time and improving TPU utilization. The other options can help specific pipelines but do not directly address the observed delay between steps.
Question 28
You are building an ML pipeline to process and analyze both steaming and batch datasets. You need the pipeline to handle data validation, preprocessing, model training, and model deployment in a consistent and automated way. You want to design an efficient and scalable solution that captures model training metadata and is easily reproducible. You want to be able to reuse custom components for different parts of your pipeline. What should you do?
A. Use Cloud Composer for distributed processing of batch and streaming data in the pipeline.
B. Use Dataflow for distributed processing of batch and streaming data in the pipeline.
C. Use Cloud Build to build and push Docker images for each pipeline component.
D. Implement an orchestration framework such as Kubeflow Pipelines or Vertex AI Pipelines.
Show Answer
Correct Answer: D
Explanation: Kubeflow Pipelines and Vertex AI Pipelines are purpose-built ML orchestration frameworks that support end-to-end ML workflows including data validation, preprocessing, training, evaluation, deployment, metadata tracking, reproducibility, and reusable pipeline components. Dataflow and Cloud Composer address data processing/orchestration but do not provide the full ML pipeline capabilities described. Cloud Build builds container images but is not an ML pipeline orchestrator.
Question 29
You are developing an ML model on Vertex AI that needs to meet specific interpretability requirements for regulatory compliance. You want to use a combination of model architectures and modeling techniques to maximize accuracy and interpretability. How should you create the model?
A. Use a convolutional neural network (CNN)-based deep learning model architecture, and use local interpretable model-agnostic explanations (LIME) for interpretability.
B. Use a recurrent neural network (RNN)-based deep learning model architecture, and use integrated gradients for interpretability.
C. Use a boosted decision tree-based model architecture, and use SHAP values for interpretability.
D. Use a long short-term memory (LSTM)-based model architecture, and use local interpretable model-agnostic explanations (LIME) for interpretability.
Show Answer
Correct Answer: C
Explanation: A boosted decision tree combined with SHAP values provides a strong balance of predictive performance and interpretability. Tree-based models are generally far more interpretable than deep neural networks, and SHAP offers consistent, theoretically grounded feature attributions that are widely used for model explainability, including in regulated settings. The deep learning options rely on post hoc explanation methods but remain inherently less interpretable.
Question 30
You have developed a fraud detection model for a large financial institution using Vertex AI. The model achieves high accuracy, but the stakeholders are concerned about the model's potential for bias based on customer demographics. You have been asked to provide insights into the model's decision-making process and identify any fairness issues. What should you do?
A. Create feature groups using Vertex AI Feature Store to segregate customer demographic features and non-demographic features. Retrain the model using only non-demographic features.
B. Use feature attribution in Vertex AI to analyze model predictions and the impact of each feature on the model's predictions.
C. Enable Vertex AI Model Monitoring to detect training-serving skew. Configure an alert to send an email when the skew or drift for a modes feature exceeds a predefined threshold. Re-train the model by appending new data to existing raining data.
D. Compile a dataset of unfair predictions. Use Vertex AI Vector Search to identify similar data points in the model's predictions. Report these data points to the stakeholders.
Show Answer
Correct Answer: B
Explanation: Feature attribution in Vertex AI explains which input features most influenced individual predictions and overall model behavior. This helps assess whether demographic attributes are driving decisions and supports investigation of potential fairness and bias. The other options either remove features without first analyzing bias, monitor data drift rather than fairness, or use a service unrelated to model fairness analysis.
$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.