Google Cloud Professional Machine Learning Engineer Practice Exam

Google Cloud Certified - Professional Machine Learning Engineer

The Google Cloud Professional Machine Learning Engineer exam validates the ability to build, evaluate, productionize and optimize AI solutions on Google Cloud, from conventional ML models to solutions based on foundation models, with responsible AI practices. Its six sections are architecting low-code AI solutions at about 13 percent, collaborating to manage data and models at about 16 percent, scaling prototypes into ML models at about 21 percent, serving and scaling models at about 20 percent, automating and orchestrating ML pipelines at about 18 percent, and monitoring AI solutions at about 13 percent. This practice exam mirrors that scope with multiple choice and multiple select scenarios.

Question bank updated : questions, answers, explanations and chapters.

Certification Overview

  • Exam name: Professional Machine Learning Engineer
  • Vendor: Google Cloud
  • Duration: 120 minutes
  • Total questions: about 60
  • Our practice exam pass mark: 70%

Who Should Take This Exam?

Machine Learning Engineer, ML Ops Engineer, Data Scientist, AI Engineer, Generative AI Developer, Data Engineer, Applied Scientist, ML Platform Engineer

Prerequisites

No formal prerequisite. Google recommends 3 or more years of industry experience, including 1 or more years designing and managing solutions using Google Cloud.

Topics Covered

  • Architecting low-code AI solutions
  • Collaborating within and across teams to manage data and models
  • Scaling prototypes into ML models
  • Serving and scaling models
  • Automating and orchestrating ML pipelines
  • Monitoring AI solutions

Question Types

  • Multiple Choice (Single Answer)
  • Multiple Choice (Multiple Answers)

Professional Machine Learning Engineer Practice Questions

Our question bank contains 749+ practice questions for this certification. Sample questions from each exam chapter. Expand a question to see the answer choices. With a subscription, you get unlimited practice exams with randomised questions from our full question bank.

Architecting low-code AI solutions

You have a BigQuery table of customer clicks and purchases with no star ratings, and you want to build a product recommender using only SQL. Which CREATE MODEL configuration should you use?
  • A. MODEL_TYPE='LINEAR_REG' with the purchase count as the label
  • B. MODEL_TYPE='MATRIX_FACTORIZATION' with FEEDBACK_TYPE='EXPLICIT'
  • C. MODEL_TYPE='KMEANS' with NUM_CLUSTERS set to the number of products
  • D. MODEL_TYPE='MATRIX_FACTORIZATION' with FEEDBACK_TYPE='IMPLICIT' Correct answer

Option D is correct because click and purchase data is implicit feedback, which BigQuery ML matrix factorization handles with FEEDBACK_TYPE='IMPLICIT'. Option B fails because EXPLICIT feedback needs actual ratings. Options A and C do not produce user-item recommendations.

Your BigQuery ML logistic regression model flags fraudulent payments. The fraud team wants recall and false positive rate at many classification thresholds from a single query so they can choose a cutoff. Which function should you run against the model and the evaluation table?
  • A. ML.FEATURE_INFO
  • B. ML.WEIGHTS
  • C. ML.TRAINING_INFO
  • D. ML.ROC_CURVE Correct answer

Option D is correct because ML.ROC_CURVE returns recall and false positive rate across many thresholds for a classification model, which lets the team pick a cutoff. ML.FEATURE_INFO, ML.WEIGHTS and ML.TRAINING_INFO describe inputs, coefficients and training progress, not threshold trade-offs.

You train a LINEAR_REG model in BigQuery ML on a table with 400 columns, many of them near-duplicates. You want training to push the weights of uninformative columns to exactly zero. Which option should you set?
  • A. MAX_ITERATIONS to a lower value
  • B. L1_REG to a value above zero Correct answer
  • C. OPTIMIZE_STRATEGY to 'NORMAL_EQUATION'
  • D. L2_REG to a value above zero

Option B is correct because L1 regularization (L1_REG) can drive the weights of uninformative features to exactly zero, which gives sparse feature selection. L2_REG (option D) only shrinks weights toward zero without reaching it. Options A and C affect convergence and the solver, not sparsity.

Your team converted a PyTorch image classifier to ONNX and stored the file in Cloud Storage. Analysts already have an object table over a bucket of 200,000 product photos and want to score the photos from BigQuery SQL. Which two actions make that work? (Choose two)
  • A. Pass the object table's uri column straight to ML.PREDICT and let BigQuery ML decode the files
  • B. Create a remote model over a Gemini Enterprise Agent Platform endpoint that serves the ONNX file
  • C. Load the ONNX file into a BigQuery table as BYTES and reference that column in ML.PREDICT
  • D. Create a BigQuery ML model with MODEL_TYPE='ONNX' and MODEL_PATH set to the file's Cloud Storage URI Correct answer
  • E. Decode and resize the photos with ML.DECODE_IMAGE and ML.RESIZE_IMAGE in the query before ML.PREDICT Correct answer

Options D and E are correct because BigQuery ML imports an ONNX model with CREATE MODEL using MODEL_TYPE='ONNX' and a MODEL_PATH pointing to the file in Cloud Storage, and image rows from an object table must be decoded and resized with ML.DECODE_IMAGE and ML.RESIZE_IMAGE before ML.PREDICT can score them. Option A fails because ML.PREDICT does not decode raw files from the uri column, option B is unnecessary because an imported ONNX model runs inside BigQuery, and option C is wrong because the model file is not loaded as table data.

Collaborating within and across teams to manage data and models

You are preparing tabular data for a neural network that predicts delivery times. Route distance ranges from 0.1 to 4,000 km while the number of stops ranges from 0 to 12, and training converges slowly with unstable weights. What should you do?
  • A. One-hot encode the number of stops
  • B. Add L2 regularization to the output layer
  • C. Standardize both numeric features to zero mean and unit variance Correct answer
  • D. Hash both features into 100 buckets

Option C is correct because standardizing puts route distance and number of stops on comparable scales, which stabilizes gradients and speeds convergence. One-hot encoding stops or hashing both features into buckets does not fix the scale mismatch, and L2 regularization on the output layer does not rescale the inputs.

Your binary classifier is trained on 12 million transactions of which 0.4% are fraud. It reports 99.6% accuracy but flags almost no fraud. You need training and evaluation that reflect how well fraud is detected. What should you do?
  • A. Weight the fraud class more heavily in the loss and judge the model by precision-recall AUC Correct answer
  • B. Duplicate every fraud row 50 times, then split into training and test sets
  • C. Train for more epochs with a larger batch size until accuracy passes 99.9%
  • D. Raise the decision threshold to 0.9 and keep accuracy as the main metric

Option A is correct because with 0.4% positives accuracy is dominated by the majority class, so weighting the fraud class and judging by precision-recall AUC measures how well fraud is actually found. Duplicating fraud rows before the split leaks copies into the test set, and training longer or raising the threshold while keeping accuracy preserves the misleading metric.

A churn model predicts next-month cancellation from a table with one row per customer per month, including rolling 90-day usage aggregates. A random 80/20 row split gives 0.94 AUC offline, but the first production month scores 0.71. The scaler was fitted on the full table. Which change to the preprocessing addresses the gap?
  • A. Oversample churned customers with SMOTE before splitting so both sets stay balanced
  • B. Split by month so validation follows training, and fit the scaler on training rows only Correct answer
  • C. Replace the rolling aggregates with raw daily usage and keep the random split
  • D. Stratify the random split by churn label and refit the scaler on the training rows

Option B is correct because rows are customer-months with rolling windows, so a random split leaks overlapping and future behavior into training; splitting by month mimics production, and fitting the scaler on training rows only removes statistics leakage. SMOTE before splitting and a stratified random split keep the temporal leakage, and raw daily usage does not address it.

You preprocess 3 TB of click logs in Dataflow before training a TensorFlow model. The features include a vocabulary of the 50,000 most frequent query tokens and dwell time scaled by the training-set mean and standard deviation. The online prediction service must apply exactly the same transformations to raw requests. Which two steps should you take? (Choose two)
  • A. Save the resulting transform graph with the model and apply it in the serving signature Correct answer
  • B. Write the vocabulary and statistics to a JSON file in Cloud Storage and reimplement the transformations in the prediction service's own code
  • C. Materialize the transformed training examples in BigQuery and have the endpoint read each request's features from that table
  • D. Recompute the vocabulary and the statistics from a rolling window of recent prediction requests so that they follow current traffic
  • E. Implement the preprocessing with TensorFlow Transform so that the vocabulary and the scaling statistics come from a full pass over the data Correct answer

Options A and E are correct because TensorFlow Transform computes the vocabulary and the mean and standard deviation in one full pass and exports them as a transform graph, which saved with the model applies identical logic at serving. Option B reimplements the logic by hand and invites training-serving skew, option C cannot serve arbitrary new requests from a precomputed table, and option D changes the statistics the model was trained with.

Scaling prototypes into ML models

Your image classifier is served from a CPU-only endpoint, and its p95 latency is 40 ms against a 25 ms target. Accuracy has two points of margin above the requirement, and the endpoint's hardware cannot change. What should you do?
  • A. Apply post-training quantization to the model and redeploy the smaller version Correct answer
  • B. Increase the endpoint's minimum replica count so that each replica handles fewer requests per second
  • C. Convert the weights to float64 so that the CPU avoids precision conversions at inference time
  • D. Raise the client's request batch size so that the fixed per-call overhead is spread over more images

Option A is correct because post-training quantization shrinks the weights and speeds up CPU inference with a small accuracy loss, which fits the two points of accuracy margin and the fixed hardware. More replicas (B) add throughput but do not reduce per-request latency, float64 (C) makes CPU math slower and larger, and a bigger client batch (D) raises the latency of each call.

Your marketplace has 30 million listings and must return personalized recommendations within 100 ms. The current model scores each user-listing pair with a deep network, so scoring more than a few thousand candidates misses the latency budget. You want to keep personalization and cover the whole catalog. What should you do?
  • A. Keep the pairwise network and score a random sample of 5,000 listings per user, caching each user's top results for a day
  • B. Train a two-tower model, precompute the listing embeddings, and retrieve nearest neighbours of the user embedding from an approximate index Correct answer
  • C. Shard the 30 million listings across a larger autoscaled endpoint and score all pairs in parallel for every request
  • D. Cluster the listings offline and run the pairwise network only on the listings in the user's most-visited cluster

Option B is correct because a two-tower model lets you compute listing embeddings offline and find the nearest neighbours of the user embedding with an approximate index in milliseconds, keeping personalization across the whole catalog. Random sampling (A) and cluster pruning (D) drop most of the catalog, and scoring all 30 million pairs per request (C) is far too expensive for a 100 ms budget.

Your fraud-detection service combines five gradient-boosted tree models and a neural network. The ensemble's online prediction takes 180 ms against a 60 ms limit, and larger machine types gave no improvement. Offline, the ensemble beats the best single member by 3 points of recall, and the business accepts losing at most 1 point. You have plenty of historical data. What should you do?
  • A. Quantize the weights of all six models to int8 and keep the ensemble structure unchanged
  • B. Train one smaller model on the ensemble's predicted probabilities as soft labels, and serve that model Correct answer
  • C. Move the ensemble to a machine type with more vCPUs and an attached GPU to shorten each member's inference
  • D. Keep the best single tree model by validation recall and retire the rest of the ensemble

Option B is correct because distilling the ensemble into one smaller student trained on its soft probabilities keeps most of the ensemble's recall at a fraction of the latency, and the ample data supports it. Quantizing six models (A) keeps the structure and its cost, bigger machines (C) already showed no gain, and keeping only the best tree (D) would likely lose the 3 points of recall the business only partly tolerates.

Serving and scaling models

You trained a scikit-learn model that scores numeric vectors, but clients send raw JSON containing free-text fields that must be tokenized and scaled first, and the raw scores must be mapped to class labels afterwards. You want an online endpoint for this model and you do not want to maintain your own web server code. What should you do?
  • A. Deploy the model in a prebuilt scikit-learn container and put a Cloud Run service in front of the endpoint to transform requests and responses
  • B. Wrap the tokenization and scaling in a BigQuery remote function that the prebuilt scikit-learn container calls before it scores each request
  • C. Ask each client team to tokenize and scale the text before the call, then send numeric vectors to a prebuilt scikit-learn container on the endpoint
  • D. Build a custom prediction routine whose Predictor class applies the preprocessing and postprocessing, and upload it as the model Correct answer

Option D is correct because a custom prediction routine lets you ship a Predictor class whose preprocess and postprocess methods tokenize and scale the raw JSON and map scores to labels, inside the prebuilt serving container, with no web server code to maintain. Options A and B add a separate service or an unrelated BigQuery function in the request path, and option C pushes the transformation onto clients, which is what the requirement rules out.

Your team built a serving image around an in-house model server that listens on port 5000, scores requests at /score, and answers liveness checks at /ping. The image works when run locally, but the endpoint reports the deployment unhealthy and routes no traffic to it. What should you do?
  • A. Add a VPC firewall rule that lets the Google health-check ranges reach port 5000 on the network that hosts the endpoint's replicas
  • B. Set a readiness probe on the deployed model that calls /ping on port 5000 before the endpoint is allowed to route traffic to it
  • C. Rebuild the image so the server listens on port 8080 and serves /predict and /health, the values the platform fixes for every deployment
  • D. Upload the model with container port 5000, predict route /score, and health route /ping, and bind the server to 0.0.0.0 Correct answer

Option D is correct because a custom serving container is registered with its own port, predict route and health route, and the server must listen on 0.0.0.0 for the platform to reach it. The image is unhealthy because the platform probes the default values, not the ones your server uses. Option C rebuilds working code to fit defaults, which are not fixed for custom containers, and options A and B do not change the routes or port the platform checks.

Your fraud model handles about 400 requests per second on an endpoint. You want a sample of live feature values and predictions in BigQuery to analyze training-serving skew and to build retraining sets. You do not want to add logging code to the serving container or to store every request. What should you do?
  • A. Create a log-based metric over the container's stdout and chart the extracted feature values as a distribution in Cloud Monitoring
  • B. Add code to the container that writes each request and its prediction to a BigQuery table through the streaming insert API
  • C. Enable Data Access audit logs for the prediction API on the project and route the matching entries to BigQuery with a log sink
  • D. Turn on request-response logging for the endpoint with a 10% sampling rate and a BigQuery table as the destination for the logged payloads Correct answer

Option D is correct because endpoint request-response logging captures a configurable sampled percentage of payloads and predictions into a BigQuery table, with no code change in the container. Option A only yields metrics rather than rows for skew analysis, option B requires logging code and stores every request, and option C audit logs record API access, not the prediction payloads.

Automating and orchestrating ML pipelines

Your team stored a pretrained SavedModel in a Cloud Storage folder before your pipeline existed. The pipeline's fine-tuning component declares its input as Input[Model]. What should you do to hand the existing model to that component?
  • A. Add a dsl.importer step with the folder URI and the Model artifact type, and connect its output to the component Correct answer
  • B. Register the folder as an artifact through the metadata API before the run and give the component the artifact's resource name
  • C. Pass the folder's gs:// URI to the component as a string pipeline parameter, which the compiler converts to a Model artifact
  • D. Mount the folder at /gcs in the fine-tuning component and read the files directly from the mounted path in the training code

Option A is correct because dsl.importer brings an existing artifact from a URI into the pipeline as a typed Model artifact, which an Input[Model] parameter accepts. Option C fails because a string parameter is not converted into an artifact, and options B and D do not produce an artifact that the component's Input[Model] can receive.

Your pipeline must train the same demand model separately for each region in a list passed as a pipeline parameter, run at most four trainings at the same time, and continue only when all trainings have finished. The region list changes from run to run. What should you do?
  • A. Wrap the training task in dsl.ParallelFor over the region parameter and set its parallelism to 4 Correct answer
  • B. Define one training task per current region with the region hard-coded, and chain them in groups of four by using the after() method
  • C. Write a Python for loop in the pipeline function over the region parameter and call the training component once per region
  • D. Submit one pipeline job per region from a Cloud Run function and limit a Cloud Tasks queue to four concurrent dispatches

Option A is correct because dsl.ParallelFor iterates over a pipeline parameter that is only known at run time, its parallelism argument caps concurrent iterations at four, and downstream tasks wait for the whole loop. Option C fails because a pipeline parameter cannot be iterated by a Python loop at compile time, and option B hard-codes the region list.

A pipeline creates a temporary BigQuery staging dataset in its first step, then trains and evaluates a model. When training fails, the dataset is left behind and nobody is told. You want the dataset deleted and the on-call channel notified on every run, whether it succeeds or fails. What should you do?
  • A. Set the pipeline job's failure policy to fail slow so that the cleanup task at the end still runs after a training failure
  • B. Create an alerting policy on the failed pipeline job state that triggers a Cloud Run function to delete the dataset and notify
  • C. Add a final cleanup-and-notify task that depends on the evaluation task by using the after() method
  • D. Put the training and evaluation tasks in a dsl.ExitHandler group whose exit task deletes the dataset and sends the notification Correct answer

Option D is correct because a dsl.ExitHandler runs its exit task after the tasks in the group whether they succeed or fail, so cleanup and notification happen on every run. Option C does not run when the evaluation task never finishes successfully, and options A and B depend on failure policy or external alerting instead of guaranteed in-run cleanup.

Monitoring AI solutions

You retrain a ticket-routing classifier every week on labels that customers correct through an in-app feedback button. Security reports that a small group of authenticated users could submit mislabeled corrections to steer the model away from routing billing disputes. Access controls on the feedback table already pass review, and the weekly retraining must stay automated. What should you do?
  • A. Replace the weekly job with online updates applied on each correction, which lets later corrections quickly overwrite the effect of any mislabeled ones
  • B. Raise the L2 regularization strength and add training epochs to average out the small share of mislabeled corrections in each weekly batch
  • C. Restrict writes on the feedback table to one service account protected by a customer-managed encryption key and rotate that key every 90 days
  • D. Add a pipeline step that compares each week's corrections with historical label distributions and per-user submission patterns, and gate promotion on a frozen golden evaluation set Correct answer

Option D is correct because poisoning through user-submitted labels is best countered by validating each batch before it can influence a release: comparing corrections against historical label distributions and per-user patterns catches coordinated steering, and a frozen golden evaluation set blocks promotion of a degraded model while the retraining stays automated. Option A makes the model react faster to poisoned labels, option B only hopes regularization absorbs targeted bias, and option C repeats access control that already passes review.

Forty teams in your organization each build Gemini-based features and create their own Model Armor templates, some with no filters enabled. Security requires that every Gemini request and response in all projects be screened for sensitive data and malicious URLs, whatever a team's template says. What should you do?
  • A. Grant the Model Armor User role only to a central security group so that teams can no longer create their own templates
  • B. Publish a vetted Model Armor template in a shared project and ask each team to reference it in its Gemini API calls
  • C. Attach a Cloud Armor security policy with preconfigured WAF rules to the load balancer in front of each team's application
  • D. Set organization-level Model Armor floor settings that enable the sensitive data and malicious URL filters Correct answer

Option D is correct because Model Armor floor settings defined at the organization level apply minimum filters to every project beneath it, so sensitive data and malicious URL screening is enforced whatever a team's own template contains. Options A and B depend on teams cooperating or on restricting template creation rather than enforcing a floor, and option C, Cloud Armor, is a WAF for web traffic and does not inspect Gemini prompts and responses.

Your data-analysis assistant asks Gemini to write Python that the application then runs to build charts from customer-uploaded spreadsheets. A red team got generated code to read environment variables and call an internal service. Which two measures reduce the risk of executing model-written code? (Choose two)
  • A. Scan each generated script for os, subprocess and socket imports with a denylist before running it
  • B. Run the sandbox under a dedicated service account that holds no roles on production data or internal services Correct answer
  • C. Run the code inside the application's own Cloud Run container and cap each execution at 10 seconds
  • D. Run the generated code in an isolated sandbox that has no outbound network route Correct answer
  • E. Add a system instruction that tells the model to refuse code that reads local files, environment variables or network connections

Options B and D are correct because model-written code must be treated as untrusted: an isolated sandbox with no outbound network route stops it from calling the internal service or exfiltrating data, and a service account with no roles on production data limits what it can touch even if it escapes. A denylist of imports (A) is easy to bypass, running in the application's own container (C) shares its environment variables and network, and a system instruction (E) is guidance the model can be talked out of, not an enforced control.

Free Study Guide

Read the free Google Cloud Professional Machine Learning Engineer study guide: every exam topic explained in plain English, with diagrams, exam tips and the mistakes to avoid.

More Google Cloud Practice Exams

All Google Cloud practice exams →

Practise with realistic mock exams to prepare for your Google Cloud certification.