# Free GME practice questions

> 10 free GME practice questions with the correct answer and an explanation.

Page: https://devopscodelab.com/exams/google-ml-engineer/free-practice-questions/
Practice exams: https://devopscodelab.com/exams/google-ml-engineer/

### Question 1 of 10

A company wants an internal assistant that answers employee questions grounded in 40,000 PDF policy documents stored in Cloud Storage. Answers must cite the source document, and the team wants to avoid building its own chunking, embedding, and retrieval pipeline. What should the ML engineer do?

- A. Generate embeddings for each page with a text embedding model, store them in Vector Search on Agent Platform, and write retrieval and prompt logic in Cloud Run
- B. Fine-tune a Gemini model with supervised tuning on question-answer pairs generated from the 40,000 PDFs so the knowledge is stored in the weights
- C. Create an Agent Search data store over the Cloud Storage bucket and use a search app with generative answers that return citations
- D. Load the PDFs into BigQuery, run ML.GENERATE_EMBEDDING on the text, and use VECTOR_SEARCH results as context in a hand-written prompt template

**Answer:** C

**Explanation:** Agent Search (formerly Vertex AI Search), part of Agent Builder, ingests unstructured documents, handles parsing, chunking, indexing, and retrieval, and can return grounded summaries with citations, so no custom RAG pipeline is needed. Vector Search and BigQuery vector search both work but require the team to build chunking, embedding, and prompting themselves. Supervised tuning does not provide reliable citations and goes stale as policies change.

### Question 2 of 10

Several teams compute the same customer features with slightly different SQL, causing inconsistent model results. Features already live in BigQuery, and two models need low-latency online lookups. What should the ML engineer do to consolidate features?

- A. Register the BigQuery feature tables in Agent Platform Feature Store as feature groups and serve them through an online store
- B. Copy the feature tables into Memorystore for Redis nightly and document the column meanings in a team wiki so models can read them with low latency
- C. Export each team's features to Cloud Storage as Parquet files and load them into every training job directly
- D. Publish a shared BigQuery view per feature and have the online models query the views directly at prediction time

**Answer:** A

**Explanation:** Agent Platform Feature Store (in Gemini Enterprise Agent Platform, formerly Vertex AI) uses BigQuery as its offline source, so existing tables can be registered as feature groups once and served with low latency from an online store, giving every team the same definitions. Shared views fix consistency but querying BigQuery at request time is too slow for online lookups. A Redis copy and Parquet exports duplicate data and leave no governed feature registry.

### Question 3 of 10

An ML team uses Experiments on Agent Platform. A data scientist trains a scikit-learn model in a Workbench notebook and wants each run's parameters, metrics, and the resulting model artifact to be comparable in the console. What is the simplest way to do this?

- A. Create an Agent Platform TensorBoard instance and write scikit-learn scores as TensorFlow summary events inside the notebook's training loop
- B. Write metrics into a BigQuery table after every run and build a Looker Studio dashboard over that table
- C. Call aiplatform.init with the experiment name, then start_run, log_params, and log_metrics in the notebook
- D. Save each trained model to Cloud Storage with the hyperparameters encoded in the object name

**Answer:** C

**Explanation:** The Agent Platform SDK's experiment APIs record parameters and metrics for each run, and runs are compared side by side in the Experiments console and backed by Agent Platform ML Metadata (formerly Vertex ML Metadata). A BigQuery dashboard or object naming conventions are manual and give no lineage. TensorBoard is designed for time-series training curves, and forcing scikit-learn scores into summary events adds work without run comparison.

### Question 4 of 10

An ML engineer needs to train a PyTorch model across several GPU nodes on Agent Platform. Which configuration is required in the custom training job?

- A. A batch prediction job configured with GPUs and the training script passed as the model URI
- B. A single worker pool with replica_count set to one and the largest GPU machine type available
- C. Multiple worker pools (a primary replica plus worker replicas) and distributed training code
- D. A Workbench instance with multiple GPUs attached and the training loop run inside a notebook cell

**Answer:** C

**Explanation:** Agent Platform custom training uses worker pool specs: the first pool holds the primary replica and further pools hold workers, and the code uses a distributed framework such as torch.distributed with the cluster environment Agent Platform provides. A single replica is not multi-node. A notebook is not a distributed training job. Batch prediction is for inference.

### Question 5 of 10

A team fine-tunes a large transformer on Cloud TPU through Agent Platform. Each step processes a fixed number of tokens, but training is much slower than expected and profiling shows frequent recompilation of the XLA graph. What is the MOST likely cause and fix?

- A. Input sequences have varying lengths; pad or bucket them to a small set of fixed shapes so XLA compiles once per shape
- B. The TPU host has too few vCPUs; switch to a GPU machine type with more CPU cores so preprocessing keeps up with training
- C. The learning rate is too high; lower it and add warmup steps so that the loss stops diverging during the early epochs
- D. The checkpoints are too frequent; write checkpoints to Cloud Storage only at the end of every epoch rather than per step

**Answer:** A

**Explanation:** XLA compiles a graph per input shape, so dynamic sequence lengths trigger repeated recompilation on TPUs; padding or bucketing to fixed shapes removes it. A CPU-bound input pipeline shows idle TPU time rather than recompilation. Learning-rate problems affect convergence, not compilation. Checkpoint frequency affects I/O pauses, not graph compilation.

### Question 6 of 10

An online fraud model on an Agent Platform endpoint must respond within 50 ms at p99. Traffic ranges from 200 to 5,000 requests per second during the day. Latency spikes appear only during sharp traffic ramps. What should the ML engineer change FIRST?

- A. Raise the minimum replica count so that enough warm nodes exist to absorb ramps while autoscaling adds capacity
- B. Lower the autoscaling CPU target to 10% and set the maximum replica count equal to the minimum replica count
- C. Move the model to a larger GPU machine type with a single replica and disable autoscaling for that endpoint
- D. Switch the endpoint to batch prediction jobs triggered every minute and cache the results in Memorystore

**Answer:** A

**Explanation:** New replicas take time to provision, so spikes during ramps indicate too little warm capacity; increasing min replicas (optionally with a lower utilization target) absorbs the ramp while autoscaling catches up. Batch scoring cannot serve per-transaction fraud checks. Setting max equal to min disables scaling entirely. A single replica creates a single point of failure and cannot follow a 25x traffic range.

### Question 7 of 10

A team has 40 small scikit-learn models for different regions, each receiving little traffic. Deploying each to its own endpoint wastes compute. What should the ML engineer do?

- A. Move all models to batch prediction and precompute every possible request
- B. Use a shared deployment resource pool so several models co-host on the same VMs
- C. Merge all 40 models into one large model and retrain it on the combined data so one endpoint serves it
- D. Deploy each model to its own endpoint and set min replicas to 0 for each one

**Answer:** B

**Explanation:** Agent Platform deployment resource pools let multiple models share the same compute nodes, improving utilization for many low-traffic models. Merging models changes the modeling approach and may hurt regional accuracy. Standard dedicated deployments keep at least one replica running per model. Precomputing every possible request is usually infeasible for real-time inputs.

### Question 8 of 10

A company's ML workflow must wait for an ETL job in an on-premises scheduler, run a Dataproc job, start an Agent Platform pipeline, and then notify several business systems. Which orchestrator is MOST appropriate for the whole workflow?

- A. Cloud Build, with a build configuration that runs each step sequentially as a build step with dependencies between steps
- B. Agent Platform Pipelines alone, with a component that polls the on-premises scheduler every minute
- C. Cloud Scheduler, with one cron job per step spaced far enough apart for each step to finish
- D. Managed Service for Apache Airflow, with operators for Dataproc and Agent Platform and sensors for external dependencies

**Answer:** D

**Explanation:** Managed Service for Apache Airflow (formerly Cloud Composer) is designed for cross-system workflows, with sensors for external dependencies and operators for Dataproc and Agent Platform; the ML pipeline itself can still run in Agent Platform Pipelines. Using Agent Platform Pipelines for polling external schedulers is awkward. Fixed cron offsets do not handle dependencies. Cloud Build is a CI tool with build time limits, not a workflow orchestrator.

### Question 9 of 10

An ML team wants each merge to the main branch to rebuild a training container, run unit tests, compile the KFP pipeline, and submit it to Agent Platform Pipelines. Which service should orchestrate these CI steps with the least custom infrastructure?

- A. A Compute Engine VM running a self-managed Jenkins server whose jobs call the gcloud CLI for every pipeline stage
- B. Agent Platform Workbench scheduled notebook executions that pull the repository and run the build commands on a timer
- C. Cloud Build triggers connected to the repository, with build steps that test, push to Artifact Registry, and submit the pipeline
- D. Managed Service for Apache Airflow with a DAG that polls the repository every five minutes for new commits and runs the build commands on an Airflow worker

**Answer:** C

**Explanation:** Cloud Build is a serverless CI service with repository triggers, container builds, and push to Artifact Registry, so it fits merge-triggered builds and pipeline submission without managing servers. Airflow polling is an orchestration tool misused for CI. Self-managed Jenkins adds VM operations. Scheduled notebooks are not event-driven and are not a CI system.

### Question 10 of 10

A Gemini-powered app sometimes returns blocked responses for harmless medical questions, frustrating users. What should the ML engineer adjust FIRST?

- A. Review the safety settings and tune harm category thresholds for the use case
- B. Switch to a smaller Gemini model, which has fewer safety filters by default
- C. Disable Cloud Logging for the application so that blocked prompts are hidden
- D. Raise the max output tokens so that responses are not cut off by the model in each reply

**Answer:** A

**Explanation:** Agent Platform lets developers configure safety settings per harm category, so overly strict thresholds for a medical use case can be adjusted while keeping protections. Output token limits cause truncation, not blocking. Model size does not remove safety filtering. Hiding logs does nothing for users and harms observability.

Ready for a timed run? Take the free 15-question GME mini exam: https://devopscodelab.com/app/exams/google-ml-engineer/mini/

DevOpsCode Lab is not affiliated with Google Cloud. GME and related names are trademarks of their owners. We write every question ourselves; these are not real exam questions.
