Courseiva
hardMultiple Choice

PDE Practice Question: A company has a batch prediction job that runs…

A company has a batch prediction job that runs daily using AI Platform Batch Prediction. The job uses a TensorFlow model and processes 10 GB of data. Recently, the job started failing with the error 'The replica worker 0 exited with a non-zero exit code: Out of memory'. Which action should the team take to resolve this without rewriting the model?

⚠ Common exam trap

Google Cloud often tests the distinction between scaling horizontally (adding workers) and scaling vertically (increasing machine resources), where candidates mistakenly assume parallelism solves memory issues, but the error is per-worker memory exhaustion, not throughput.

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

✓

Use a machine type with more memory, such as n1-highmem-8.

The error 'Out of memory' on replica worker 0 indicates that the machine type assigned to the prediction job does not have enough RAM to load the model and process the 10 GB batch. Increasing the machine type to one with more memory (e.g., n1-highmem-8) directly addresses the memory constraint without requiring any code changes. This is the most straightforward fix because AI Platform Batch Prediction allows you to specify machine types in the job configuration, and the error is purely a resource allocation issue.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    Increase the number of workers (parallelism) to distribute the data across more machines.

    Why it's wrong here

    Adding workers increases parallelism across replicas but each worker still loads the full model and receives its own data shard, so per-worker memory is unchanged. It is tempting because horizontal scaling normally relieves overloaded batch jobs, and would apply if the bottleneck were throughput rather than per-replica RAM.

  • ✓

    Use a machine type with more memory, such as n1-highmem-8.

    Why this is correct

    The out-of-memory error originates from the replica worker exhausting RAM during batch prediction, not from the model itself. Selecting a higher-memory machine type such as n1-highmem-8 gives the worker sufficient memory, resolving the failure without altering the TensorFlow model.

  • ✗

    Reduce the batch size parameter in the prediction job configuration.

    Why it's wrong here

    Batch size governs how many instances a single prediction call handles, not the memory consumed by the loaded model or the 10 GB input shard assigned to each replica. It is tempting because smaller batches reduce peak activation memory, which helps when inference itself, rather than data loading, exhausts RAM.

  • ✗

    Optimize the model to use less memory by pruning or quantization.

    Why it's wrong here

    Pruning or quantisation alters the model artefacts and typically requires retraining and revalidation, which the stem explicitly excludes by demanding no model rewrite. It is tempting because reducing model memory genuinely lowers runtime footprint, and would be right if retraining were permitted.

Visual reference

Client Recursive Resolver Root DNS (13 root servers) TLD DNS (.com, .org, …) Authoritative example.com query IP addr answer

About these practice questions

Courseiva writes every PDE question from scratch — 747 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 →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This PDE 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 PDE exam.