10 free Google Professional Machine Learning Engineer practice questions with the correct answer and a full explanation for each, taken from the CertStash pack of 339 questions. Work through them, then open each answer to check your reasoning.
Get all 339 questions (US$39) · Download these 10 as a PDF
Question 1
You are building an ML model to detect anomalies in real-time sensor data. You will use Pub/Sub to handle incoming requests. You want to store the results for analytics and visualization.
How should you configure the pipeline?
Show answer and explanation
Correct answer: A. 1 = Dataflow, 2 = AI Platform, 3 = BigQuery
For real-time anomaly detection on sensor data, Dataflow provides scalable stream processing from Pub/Sub, AI Platform handles the ML model inference, and BigQuery stores results for analytics and visualization. This is the standard Google Cloud pattern for real-time ML pipelines where Dataflow acts as the processing engine, AI Platform serves the model, and BigQuery provides the data warehouse for downstream analytics.
Why the other options are wrong
- B. DataProc is for batch processing and not optimal for real-time streaming; Bigtable is a NoSQL database not suited for analytics and visualization.
- C. BigQuery should be the destination for analytics, not the processor; Cloud Functions lacks the scalability needed for continuous ML inference on high-volume sensor data.
- D. BigQuery is not a processing engine; Cloud Storage is not suitable for serving ML models in real-time scenarios.
Question 2
Your organization wants to make its internal shuttle service route more efficient. The shuttles currently stop at all pick-up points across the city every 30 minutes between 7 am and 10 am. The development team has already built an application on Google Kubernetes Engine that requires users to confirm their presence and shuttle station one day in advance.
What approach should you take?
Show answer and explanation
Correct answer: C. 1. Define the optimal route as the shortest route that passes by all shuttle stations with confirmed attendance at the given time under capacity constraints. 2. Dispatch an appropriately sized shuttle and indicate the required stops on the map.
Since users confirm their presence and shuttle station in advance, this is a deterministic optimization problem with known constraints, not a prediction problem. The optimal solution uses route optimization algorithms to find the shortest route that satisfies capacity constraints and includes only confirmed stops. This approach is more efficient and interpretable than building ML models when ground truth data (confirmed attendance) is already available.
Why the other options are wrong
- A. Regression predicts continuous values (number of passengers) when binary decisions (stop/no stop) are needed, and adds unnecessary complexity.
- B. While classification could work, this ignores the optimization aspect and fails to minimize distance and maximize efficiency given known confirmed reservations.
- D. Reinforcement learning is overly complex and inappropriate when the problem can be solved deterministically with known, confirmed attendance data and capacity constraints.
Question 3
You were asked to investigate failures of a production line component based on sensor readings. After receiving the dataset, you discover that less than 1% of the readings are positive examples representing failure incidents. You have tried to train several classification models, but none of them converge.
How should you resolve the class imbalance problem?
Show answer and explanation
Correct answer: C. Downsample the data with upweighting to create a sample with 10% positive examples.
With under 1% positive examples, the recommended Google practice is to downsample the majority class and then upweight the retained majority examples by the same factor. Downsampling to roughly 10% positives lets the model see far more of the rare failure signal and converge faster, while upweighting keeps the model calibrated to the true class distribution. This preserves all of the positive examples and the statistical meaning of the original data.
Why the other options are wrong
- A. Generating extra positive examples from the class distribution fabricates failure records that do not reflect real sensor behavior and leaves the model calibrated to synthetic data.
- B. A convolutional network with max pooling and softmax is an architecture choice for image-style inputs and does nothing to fix a skewed label distribution.
- D. Discarding negative examples until the classes are equal throws away most of the majority data without any upweighting, so the model loses information and its predicted probabilities no longer match production conditions.
Question 4
You want to rebuild your ML pipeline for structured data on Google Cloud. You are using PySpark to conduct data transformations at scale, but your pipelines are taking over 12 hours to run. To speed up development and pipeline run time, you want to use a serverless tool and SQL syntax.
You have already moved your raw data into Cloud Storage.
How should you build the pipeline on Google Cloud while meeting the speed and processing requirements?
Show answer and explanation
Correct answer: D. Ingest your data into BigQuery using BigQuery Load, convert your PySpark commands into BigQuery SQL queries to transform the data, and then write the transformations to a new table.
BigQuery is the serverless, SQL-first option that satisfies both requirements. Loading the Cloud Storage files with BigQuery Load and rewriting the PySpark logic as BigQuery SQL removes all cluster management and uses BigQuery's distributed engine to cut the 1-our runtime, with results materialized into a new table for downstream ML.
Why the other options are wrong
- A. Cloud Data Fusion is driven through a graphical pipeline designer rather than SQL, so it does not meet the stated requirement to develop in SQL syntax.
- B. Running SparkSQL on Dataproc still means provisioning and tuning clusters, which is not serverless and keeps the same Spark execution bottleneck.
- C. Cloud SQL is a transactional database that is not built for large-scale analytical transformations, and routing work through federated queries adds latency and complexity.
Question 5
You manage a team of data scientists who use a cloud-based backend system to submit training jobs. This system has become very difficult to administer, and you want to use a managed service instead. The data scientists you work with use many different frameworks, including Keras, PyTorch, theano, Scikit-learn, and custom libraries.
What should you do?
Show answer and explanation
Correct answer: A. Use the AI Platform custom containers feature to receive training jobs using any framework.
AI Platform's custom containers feature allows data scientists to submit training jobs using any framework by containerizing their code and dependencies. This provides a managed service that eliminates administrative overhead while supporting Keras, PyTorch, Theano, Scikit-learn, and custom libraries without framework restrictions.
Why the other options are wrong
- B. Kubeflow with TFJob is optimized for TensorFlow; it doesn't natively support all frameworks and adds administrative complexity.
- C. Managing a library of VM images requires ongoing administration and doesn't provide managed service benefits.
- D. Slurm is a traditional HPC workload manager that requires significant infrastructure administration and cloud-native integration work.
Question 6
You work for an online retail company that is creating a visual search engine. You have set up an end-to-end ML pipeline on Google Cloud to classify whether an image contains your company's product. Expecting the release of new products in the near future, you configured a retraining functionality in the pipeline so that new data can be fed into your ML models. You also want to use AI Platform's continuous evaluation service to ensure that the models have high accuracy on your test dataset.
What should you do?
Show answer and explanation
Correct answer: B. Extend your test dataset with images of the newer products when they are introduced to retraining.
When new products are introduced and incorporated into model retraining, the test dataset should be extended to include representative images of these new products. This ensures continuous evaluation remains valid and measures model performance on the current product catalog, preventing evaluation drift where the model sees new products in production but was only tested on old products.
Why the other options are wrong
- A. Keeping the original unchanged test dataset becomes stale and doesn't reflect the production distribution after new products are added.
- C. Completely replacing the test dataset loses historical baselines and makes it impossible to track performance evolution.
- D. Waiting for metric degradation to update the test dataset is reactive; evaluation should remain valid proactively as the catalog changes.
Question 7
You need to build classification workflows over several structured datasets currently stored in BigQuery. Because you will be performing the classification several times, you want to complete the following steps without writing code: exploratory data analysis, feature selection, model building, training, and hyperparameter tuning and serving.
What should you do?
Show answer and explanation
Correct answer: A. Configure AutoML Tables to perform the classification task.
AutoML Tables is designed for structured data classification workflows and automates the complete pipeline: exploratory data analysis, feature selection, model building, training, hyperparameter tuning, and serving, all without writing code. This directly matches the requirement to complete multiple steps without code.
Why the other options are wrong
- B. BigQuery ML requires writing SQL code and doesn't automate feature selection or comprehensive hyperparameter tuning.
- C. AI Platform Notebooks requires writing code with pandas, contradicting the no-code requirement.
- D. AI Platform requires writing training code and doesn't automate exploratory data analysis or feature selection.
Question 8
You work for a public transportation company and need to build a model to estimate delay times for multiple transportation routes. Predictions are served directly to users in an app in real time. Because different seasons and population increases impact the data relevance, you will retrain the model every month. You want to follow Googl-ecommended best practices.
How should you configure the end-to-end architecture of the predictive model?
Show answer and explanation
Correct answer: A. Configure Kubeflow Pipelines to schedule your multi-step workflow from training to deploying your model.
Kubeflow Pipelines is Google-recommended for orchestrating multi-step ML workflows including training, evaluation, and deployment. It provides native scheduling capabilities for monthly retraining, manages dependencies between steps, and follows MLOps best practices for production ML systems with reproducibility and versioning.
Why the other options are wrong
- B. BigQuery ML scheduled queries are simpler but lack the orchestration depth and deployment management needed for complex retraining pipelines.
- C. Cloud Functions with Cloud Scheduler works but lacks proper workflow orchestration and isn't the Google-recommended pattern for production ML pipelines.
- D. Cloud Composer (Airflow) is suitable but Kubeflow Pipelines is more aligned with Google's ML best practices and Kubernetes-native environments.
Question 9
You are developing ML models with AI Platform for image segmentation on CT scans. You frequently update your model architectures based on the newest available research papers, and have to rerun training on the same dataset to benchmark their performance. You want to minimize computation costs and manual intervention while having version control for your code.
What should you do?
Show answer and explanation
Correct answer: C. Use Cloud Build linked with Cloud Source Repositories to trigger retraining when new code is pushed to the repository.
Repositories to trigger retraining when new code is pushed to the repository. Cloud Build integrated with Cloud Source Repositories provides automatic triggering of builds and jobs when code is pushed, enabling version control, minimizing manual intervention, and reducing costs by automating the retraining workflow. This directly addresses the need for code version control combined with automated retraining whenever model architectures are updated.
Why the other options are wrong
- A. Cloud Functions with Cloud Storage polling is less integrated and requires manual configuration of storage triggers rather than leveraging native version control systems.
- B. Manual gcloud submissions require explicit user intervention each time, defeating the requirement to minimize manual intervention.
- D. Daily scheduled workflows ignore code changes and would waste computation on days without updates, plus lack proper version control integration.
Question 10
Your team needs to build a model that predicts whether images contain a driver's license, passport, or credit card. The data engineering team already built the pipeline and generated a dataset composed of 10,000 images with driver's licenses, 1,000 images with passports, and 1,000 images with credit cards. You now have to train a model with the following label map: [`˜drivers_license', `˜passport', `˜credit_card'].
Which loss function should you use?
Show answer and explanation
Correct answer: D. Sparse categorical cross-entropy
The three document types are mutually exclusive, so this is single-label multi-class classification. The label map ['drivers_license', 'passport', 'credit_card'] supplies labels as integer class indices, and sparse categorical cross-entropy is the loss designed for integer-encoded targets in a mutually exclusive multi-class problem. It computes the same objective as categorical cross-entropy without requiring one-hot expansion of the labels.
Why the other options are wrong
- A. Categorical hinge optimizes a margin objective rather than class probabilities and is not the standard choice for this kind of image classifier.
- B. Binary cross-entropy is for two-class or multi-label problems where labels are independent, not for three mutually exclusive categories.
- C. Categorical cross-entropy expects one-hot encoded label vectors, which the integer indices produced by the label map do not provide.
That was 10 of 339.
The full Google Professional Machine Learning Engineer pack has all 339 questions, each with the answer, the explanation and why the other options are wrong, plus a questions-only copy for timed runs. US$39, paid once, with free monthly updates and a pass-or-your-money-back guarantee.
