LevelUpWith

Explore / Google Cloud Professional Machine Learning Engineer Exam Prep / Practice questions

Google Cloud Professional Machine Learning Engineer practice questions

10 questions from the bank behind this course's timed mock. Free to read and to answer, no account needed, and each has its answer and an explanation. They belong to Google Cloud Professional Machine Learning Engineer Exam Prep.

Answer them one at a time →Read lesson 1 free

  1. Question 1

    An ML engineer has 60 hours to prepare for the Professional Machine Learning Engineer exam. She deploys and scales models on endpoints every day at work but has never set up drift or skew monitoring. She first budgets her hours by section weight. What is the best change to make to that plan?

    1. Move some hours from Serving and scaling models (section 4) to Monitoring AI solutions (section 6)
    2. Spread the 60 hours evenly across all six sections so that no section is missed
    3. Move hours from Monitoring AI solutions into Scaling prototypes into ML models (section 3), because it has the largest weight
    4. Drop Monitoring AI solutions completely, because at ~13% it is one of the two smallest sections
    Show the answer

    Answer: A. Move some hours from Serving and scaling models (section 4) to Monitoring AI solutions (section 6)

    Start from the section weights, then move hours toward your weak spots. Her strength is serving and her gap is monitoring, so hours should move from section 4 to section 6. Dropping monitoring is wrong because ~13% is still about 7 questions.

  2. Question 2

    A payments company is training an AutoML binary classifier to flag fraudulent transactions. Compliance rules say the model must catch at least 90% of fraud cases. Within that limit, the risk team wants as few false alarms as possible, because analysts review every flagged transaction by hand. Which optimisation objective should the ML engineer set?

    1. maximize-au-roc
    2. maximize-precision-at-recall
    3. maximize-recall-at-precision
    4. minimize-log-loss
    Show the answer

    Answer: B. maximize-precision-at-recall

    The business fixes recall at 90% and wants the highest precision at that recall, which is exactly what maximize-precision-at-recall optimises. maximize-recall-at-precision does the reverse: it fixes precision and maximises recall, so it doesn't match the compliance rule.

  3. Question 3

    A data scientist registered the BigQuery view `proj.fs.device_features_v` as a feature group. The view has only an `entity_id` column and three feature columns. The team now needs training sets that show each device's feature values as they were at past label times, so the model does not learn from future data. What should they change first?

    1. Add a TIMESTAMP column named `feature_timestamp` to the source so that Feature Store treats it as a time series and keeps history
    2. Join the labels to the view on `entity_id` only, because each entity has exactly one row
    3. Export the view to CSV every day and keep the files as a history archive for each team
    4. Do nothing, because Feature Store manages timestamps automatically and can serve any past value for each entity
    Show the answer

    Answer: A. Add a TIMESTAMP column named `feature_timestamp` to the source so that Feature Store treats it as a time series and keeps history

    If the source has no feature timestamp column, Feature Store manages the timestamps itself and serves only the latest value for each entity. Adding `feature_timestamp` keeps the history that point-in-time training needs. The 'do nothing' option is wrong because those managed timestamps never give you past values.

  4. Question 4

    An ML engineer at a utility company builds a regression model that forecasts hourly electricity demand in megawatts. Under-forecasting by a large amount can force expensive emergency power purchases, while small errors barely matter. Operations managers want the error reported in megawatts. Which evaluation metric best fits these requirements?

    1. RMSE
    2. NDCG@k
    3. PR AUC
    4. MAPE
    Show the answer

    Answer: A. RMSE

    RMSE squares each error before averaging, so large misses count far more than small ones, and the result is in the label's own units (megawatts). MAPE is a real regression metric, but it reports percentages rather than megawatts and doesn't put extra weight on large errors.

  5. Question 5

    An ML engineer submits an Agent Platform CustomTrainingJob with base_output_dir set to gs://acme-ml-out/fraud-run3. The job finishes with status Succeeded and the logs show the training loss converging. However, gs://acme-ml-out/fraud-run3/model/ is empty, and no model artifact exists anywhere in Cloud Storage. The script ends with booster.save_model("/tmp/model/model.bst"). What is the most likely cause, and what should be fixed?

    1. The model was written only to the training VM's local disk, which is deleted when the job ends. The script must copy the file to the Cloud Storage path in AIP_MODEL_DIR.
    2. The job ran as the default Custom Code Service Agent, which can't write to Cloud Storage. The job needs a dedicated service account with Storage Admin.
    3. The prebuilt XGBoost training container ignores local paths. The team must switch to a custom container in Artifact Registry to keep artifacts.
    4. base_output_dir only sets AIP_CHECKPOINT_DIR. The script must also set model_serving_container_image_uri for AIP_MODEL_DIR to be created.
    Show the answer

    Answer: A. The model was written only to the training VM's local disk, which is deleted when the job ends. The script must copy the file to the Cloud Storage path in AIP_MODEL_DIR.

    The service deletes the VMs after the job, so a model saved only to /tmp disappears even though the job reports Succeeded. The script has to write to AIP_MODEL_DIR in Cloud Storage. A permissions problem is the nearest distractor, but a write failure would surface as an error during the run, not as a silent success.

  6. Question 6

    An ML engineer wants to fully fine-tune a 13B-parameter PyTorch model in fp32 with the Adam optimizer. The job will run on one Agent Platform node with 8x A100 80 GB GPUs. A first try with DistributedDataParallel (DDP) runs out of memory on every GPU, even with a per-GPU batch size of 1. What is the best way to make this run without changing the hardware?

    1. Move to TensorFlow MultiWorkerMirroredStrategy so each GPU holds a mirrored copy of the model
    2. Switch to PyTorch FSDP so that parameters, gradients and optimizer state are sharded across the 8 GPUs
    3. Keep DDP and turn on gradient all-reduce across all 8 GPUs on every step
    4. Keep DDP and add a Reduction Server worker pool of n1-highcpu-16 reducers
    Show the answer

    Answer: B. Switch to PyTorch FSDP so that parameters, gradients and optimizer state are sharded across the 8 GPUs

    At about 16 bytes per parameter, the training state is about 208 GB, so a full copy can never fit on one 80 GB GPU. FSDP shards that state to about 26 GB per GPU before activations. Reduction Server only speeds up gradient sync, and DDP still keeps a full copy of the model on every GPU.

  7. Question 7

    An ML engineer at a retailer runs a canary. One Agent Platform endpoint sends 85% of traffic to the champion forecasting model and 15% to a challenger. During the canary, the error rate on the shared monitoring dashboard rises by about 2%. The team cannot tell which model is causing it, so it cannot decide whether to ramp up or roll back. What should the engineer have done to make this decision straightforward?

    1. Deploy the challenger to a separate endpoint and compare that endpoint's metrics against the original endpoint
    2. Build a shadow serving layer in Cloud Run so that the challenger's errors never reach users
    3. Log the deployed_model_id returned with each prediction response and break the dashboards down by it
    4. Run the canary at a 50/50 split so that both models produce enough errors to compare
    Show the answer

    Answer: C. Log the deployed_model_id returned with each prediction response and break the dashboards down by it

    Each prediction response carries the deployed_model_id that served it, so logging it lets you link a spike to a specific version while both models share one endpoint. A separate endpoint would also separate the metrics, but the clients would need to change URLs and you would lose the simple traffic-split ramp and rollback, so it is not the best fix.

  8. Question 8

    An ML engineer serves an image classifier on Agent Platform with one GPU per node. To cut latency, the team applies unstructured magnitude pruning and sets 80% of individual weights to zero. After fine-tuning, golden-set accuracy is within budget and the compressed model file is much smaller, but p95 latency on the GPU has not changed. The latency target still has to be met without a larger machine. What should the engineer do next?

    1. Enable server-side request batching with a longer batch timeout to lower per-request latency
    2. Apply structured pruning that removes whole channels or attention heads, fine-tune to recover accuracy, and re-benchmark p95 latency and golden-set quality
    3. Move the deployment to a GPU with more memory so the sparse model has room to run faster
    4. Raise the unstructured sparsity to 95% so that more of the weights are zero
    Show the answer

    Answer: B. Apply structured pruning that removes whole channels or attention heads, fine-tune to recover accuracy, and re-benchmark p95 latency and golden-set quality

    Dense GPU kernels still do the multiplications for zeroed weights, so unstructured pruning makes the file smaller but usually not faster. Removing whole channels or heads makes the matrices smaller, and that does cut latency. Raising unstructured sparsity has the same flaw and puts more accuracy at risk.

  9. Question 9

    A data analyst at an insurer keeps three BigQuery ML models: claim fraud, claim severity and customer churn. All three use the same feature engineering: ML.STANDARD_SCALER on premium, ML.QUANTILE_BUCKETIZE on vehicle_age and ML.FEATURE_CROSS of region and product. Each model's TRANSFORM clause currently holds its own copy, and the copies have started to differ. The analyst wants a single definition that all three models use, while still sending raw columns at prediction time. What should the analyst do?

    1. Move the scaling, bucketizing and feature cross into a scheduled query that each model's training query reads from.
    2. Create a transform-only BigQuery ML model that holds the shared preprocessing, and reuse it across the three models.
    3. Keep the three TRANSFORM clauses but add a code review step that compares them before each retrain.
    4. Run ML.TRANSFORM once a week to write the preprocessed rows to a table, and train and predict all three models from that table.
    Show the answer

    Answer: B. Create a transform-only BigQuery ML model that holds the shared preprocessing, and reuse it across the three models.

    A transform-only model keeps preprocessing separate from training and stores it with its learned statistics, so several models can reuse one definition. Writing ML.TRANSFORM output to a table moves the transforms out of the model, so the serving path would have to reproduce them again. That brings back the duplication you were trying to remove.

  10. Question 10

    You are the ML platform lead at a bank where a dozen product teams each build their own Model Armor templates for different chatbots. The CISO requires that no team can deploy a template with weaker prompt injection and Sensitive Data Protection screening than a company-wide baseline, and the rule must apply to every project in the organisation. What should you configure?

    1. Model Armor floor settings at the organisation level that set the minimum filters and confidence levels every template must meet
    2. Gemini safety settings of BLOCK_LOW_AND_ABOVE for every harm category in each team's generate_content calls
    3. One shared Model Armor template that every team is told to reference in its sanitize_user_prompt calls
    4. Separate prompt and response templates for each team, all set to the LOW_AND_ABOVE confidence level
    Show the answer

    Answer: A. Model Armor floor settings at the organisation level that set the minimum filters and confidence levels every template must meet

    Floor settings set a minimum level of protection that every template in a project or organisation must meet, so the baseline is enforced rather than left to each team. A shared template is the closest distractor, but nothing stops a team from creating and using its own weaker template.

The full timed mock

50 questions in 120 minutes, with a pass mark of 70%. Each paper is drawn from a bank of questions written for the mock alone, and these 10 are left out of it. Full access opens it, with every level of the course.

See the course →See the plans

LevelUpWith is independent of the organisation that sets this exam. These questions were written for this course; they are not taken from the exam.