mediumMultiple SelectObjective-mapped
PMLE Practice Question: A media company uses a custom Python script on a…
A media company uses a custom Python script on a Compute Engine VM to run batch predictions with a large ML model. The script loads the model from Cloud Storage, processes records from a Pub/Sub pull subscription, and writes results to BigQuery. Predictions are taking too long and the VM often runs out of memory. Which two changes should the company implement to improve performance and scalability? (Choose TWO)
⚠ Common exam trap
Google Cloud often tests the distinction between vertical scaling (larger VM) and horizontal scaling (load-balanced VMs or Dataflow), where candidates mistakenly choose a larger VM thinking it solves memory issues without recognizing the scalability bottleneck.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Change Pub/Sub to a push subscription that sends messages to a load-balanced group of VMs
Switching to a push subscription with a load-balanced group of VMs distributes the message processing load across multiple instances, preventing any single VM from being overwhelmed. This directly addresses the memory exhaustion issue by parallelizing the work and allowing horizontal scaling.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Deploy the model on Vertex AI Prediction for batch prediction
Why it's wrong here
Vertex AI Prediction is for online predictions, not batch; it would not help with batch scalability.
- ✓
Change Pub/Sub to a push subscription that sends messages to a load-balanced group of VMs
Why this is correct
Push subscriptions with load balancing allow horizontal scaling across multiple VMs.
- ✓
Use Dataflow to read from Pub/Sub, run predictions using the model, and write to BigQuery
Why this is correct
Dataflow provides distributed processing with auto-scaling, handling large volumes efficiently.
- ✗
Switch to a larger VM with more memory
Why it's wrong here
A larger VM is a vertical scaling approach that is limited and does not solve the bottleneck.
- ✗
Store results in Cloud SQL instead of BigQuery
Why it's wrong here
Cloud SQL is not optimized for large-scale analytical workloads and does not improve prediction speed.
Go deeper
Related to this question
About these practice questions
Courseiva writes every PMLE question from scratch — 990 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This PMLE practice question is part of Courseiva's free Google Cloud certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the PMLE exam.