nerdexam
Google

PROFESSIONAL-MACHINE-LEARNING-ENGINEER · Question #174

You are an ML engineer at a retail company. You have built a model that predicts a coupon to offer an ecommerce customer at checkout based on the items in their cart. When a customer goes to checkout,

The correct answer is B. Use a low latency database for the customers' historic purchase behavior.. To speed up slow coupon prediction times caused by joining customer cart data with historic purchase behavior from BigQuery, you should use a low-latency database for the historic purchase behavior data.

Submitted by luis.pe· Apr 18, 2026Monitoring, optimizing, and maintaining ML solutions

Question

You are an ML engineer at a retail company. You have built a model that predicts a coupon to offer an ecommerce customer at checkout based on the items in their cart. When a customer goes to checkout, your serving pipeline, which is hosted on Google Cloud, joins the customer's existing cart with a row in a BigQuery table that contains the customers' historic purchase behavior and uses that as the model's input. The web team is reporting that your model is returning predictions too slowly to load the coupon offer with the rest of the web page. How should you speed up your model's predictions?

Options

  • AAttach an NVIDIA P100 GPU to your deployed model's instance.
  • BUse a low latency database for the customers' historic purchase behavior.
  • CDeploy your model to more instances behind a load balancer to distribute traffic.
  • DCreate a materialized view in BigQuery with the necessary data for predictions.

How the community answered

(64 responses)
  • A
    6% (4)
  • B
    73% (47)
  • C
    5% (3)
  • D
    16% (10)

Why each option

To speed up slow coupon prediction times caused by joining customer cart data with historic purchase behavior from BigQuery, you should use a low-latency database for the historic purchase behavior data.

AAttach an NVIDIA P100 GPU to your deployed model's instance.

Attaching a GPU accelerates deep learning inference but does not address data retrieval, which is identified as the bottleneck in this scenario.

BUse a low latency database for the customers' historic purchase behavior.Correct

The primary bottleneck is the real-time join operation with a BigQuery table for customer historic data, which is not optimized for low-latency, row-level lookups required for online predictions. Moving this data to a low-latency database like Cloud Spanner, Firestore, or Memorystore would significantly speed up data retrieval for inference, thereby reducing overall prediction latency.

CDeploy your model to more instances behind a load balancer to distribute traffic.

Deploying to more instances behind a load balancer improves throughput by handling more concurrent requests but does not reduce the latency of individual prediction requests if the data retrieval from BigQuery remains slow.

DCreate a materialized view in BigQuery with the necessary data for predictions.

While a materialized view can speed up queries within BigQuery, BigQuery itself is an analytical data warehouse, and retrieving single rows for real-time inference from it would still be slower than using a dedicated low-latency online serving database.

Concept tested: Optimizing online prediction latency; low-latency data sources

Source: https://cloud.google.com/architecture/architectures-for-ml-inference-on-gcp

Topics

#ML serving latency#Real-time prediction#Feature serving#Low-latency data store

Community Discussion

No community discussion yet for this question.

Full PROFESSIONAL-MACHINE-LEARNING-ENGINEER Practice