Cloud / Vertex AI Interview questions
Last updated
1. What is Vertex AI?
Vertex AI is Google Cloud's managed platform for building, training, deploying and monitoring machine learning models and generative AI applications. Data prep, training, model registry, serving and MLOps tooling all sit behind one API (aiplatform.googleapis.com) and one console.
It covers classic ML (AutoML, or custom training with TensorFlow, PyTorch, scikit-learn and XGBoost) as well as generative AI through Gemini, Model Garden and agent tooling.
Naming note: since Google Cloud Next in April 2026, Vertex AI has been folded into the Gemini Enterprise Agent Platform. Existing workloads, SDKs and the API endpoint keep working, so interviewers still use both names.
Take quiz
a managed data warehouse for SQL analytics
a container registry for storing model images
a managed Google Cloud platform for building, deploying and monitoring ML and generative AI
Gemini Developer Studio
Agentspace Classic
Cloud AI Platform Next
Gemini Enterprise Agent Platform
2. What are the main components of Vertex AI?
Vertex AI is easiest to remember by lifecycle stage. Each stage has its own managed service, and you can adopt them one at a time.
| Stage | Key components | Purpose |
| Build | Model Garden, Studio, Workbench | Pick models, test prompts, write code |
| Train | AutoML, custom training, hyperparameter tuning | Produce a model from your data |
| Manage | Model Registry, Experiments, Feature Store, Pipelines | Version, track and automate |
| Serve | Endpoints, batch prediction, Vector Search | Run predictions and similarity search |
| Agents | ADK, Agent Runtime, Memory Bank, RAG Engine | Build and host AI agents |
Monitoring and governance features such as Model Monitoring and Model Armor cut across all of these.
Take quiz
Agent Runtime
Batch prediction
Vertex AI Experiments
Model Registry
Vector Search
Agent Garden
Model Registry
Workbench
3. What is Vertex AI Model Garden?
Model Garden is a catalog of more than 200 foundation models that you can explore, test and use from one place. It includes Google's Gemini models, open-weight models such as Gemma, and partner models such as Claude.
Each model has a model card describing what it does. Depending on the model, you can call it as a managed API, deploy it to your own endpoint, tune it, or open a sample notebook.
Think of it as the starting point when you ask, "which model should I use for this job?"
Take quiz
store tabular features for online lookups
schedule recurring notebook runs
discover, test and deploy Google, partner and open models
only models retired from the platform
open-weight models such as Gemma
only models trained with AutoML
4. What is Vertex AI Workbench?
Vertex AI Workbench provides managed JupyterLab notebook instances for data exploration and model development. Google handles the VM, the pre-installed ML frameworks and the JupyterLab setup.
Instances connect directly to BigQuery and Cloud Storage, can attach GPUs, and can be used to schedule notebook runs. You pay for the underlying VM while it runs, so stop idle instances. You choose the machine type and GPU at creation, can change them later, and control access through IAM and a custom service account.
If you want a lighter, Colab-style experience, Colab Enterprise offers notebooks in the same ecosystem without managing a VM yourself.
Take quiz
managed JupyterLab notebook instances
a managed Kafka cluster
a serverless SQL engine
Dataflow templates
Colab Enterprise
Looker Studio
Cloud Shell Editor
5. What are the types of model training in Vertex AI?
Vertex AI offers three practical ways to get a model, ordered from least to most control:
- AutoML: you bring labeled data and Vertex AI picks the architecture and tunes it.
- Foundation model tuning: you adapt a model such as Gemini with your own examples (supervised fine-tuning, and reinforcement-learning tuning on some models).
- Custom training: you bring your own code and run it in a prebuilt or custom container on hardware you choose.
Pick the lowest-effort option that meets your accuracy and control requirements.
Take quiz
Hyperparameter tuning job
Pipeline component
AutoML
Custom training job
supervised fine-tuning of a foundation model
Reduction Server
AutoML object detection
batch prediction
6. What is AutoML in Vertex AI?
AutoML trains models from a labeled dataset without you writing model code. It handles feature engineering, architecture search and hyperparameter tuning, then produces a model you can deploy to an endpoint.
It is a good fit for small teams, quick baselines and standard problems such as tabular classification or regression, or image tasks.
The trade-offs are less control over the architecture and training loop, and billing by node hours, which can add up on large datasets. If you need a custom loss or a specific network, move to custom training.
Take quiz
hand-building features, architectures and tuning
configuring IAM roles
writing the serving HTTP route
a Kubeflow pipeline spec
a Dockerfile
a labeled dataset
7. What is custom training in Vertex AI?
Custom training lets you run your own training code (TensorFlow, PyTorch, scikit-learn, XGBoost or anything else) as a managed job. You choose the machine type, accelerators and number of replicas, and Vertex AI provisions them, runs the job and shuts them down.
You can submit a Python script with a prebuilt container, or package everything in your own custom container.
from google.cloud import aiplatform aiplatform.init(project="my-project", location="us-central1", staging_bucket="gs://my-bucket") job = aiplatform.CustomTrainingJob( display_name="churn-train", script_path="train.py", container_uri="us-docker.pkg.dev/vertex-ai/training/sklearn-cpu.1-0:latest", # use a current image requirements=["pandas"], ) job.run(replica_count=1, machine_type="n1-standard-4")
Write the trained model to the directory given by the AIP_MODEL_DIR environment variable and Vertex AI collects it in Cloud Storage. Run the job under a custom service account so it can read only the data it needs, and consider Spot VMs with checkpointing for long, cost-sensitive runs.
Take quiz
your training script or Python package
only a pre-trained model file
a finished serving endpoint
the Feature view sync schedule
the endpoint traffic split
machine type and accelerators in the worker pool
8. What is the Vertex AI Model Registry?
The Model Registry is a central place to store, version and manage your models, whether they came from AutoML, custom training or an import. Each model can hold multiple versions, and aliases such as default or champion point to the version you want to use.
From the registry you can deploy a version to an endpoint, run batch prediction, view evaluation metrics and track lineage back to the training job.
It replaces the habit of passing model files around in buckets with an auditable record of what was trained and what is live.
Take quiz
encrypt model artifacts
point to a specific model version
limit batch prediction size
deploy it to an endpoint or run a batch job
edit a pipeline schedule
resize a Workbench disk
9. What is a Vertex AI endpoint?
An endpoint is the HTTPS resource that serves online predictions. You deploy one or more models to it with a machine type, a minimum and maximum replica count, and a traffic percentage per model.
Clients send prediction requests to the endpoint and the platform routes them to a replica running your model container. Each deployed model gets its own replicas, so two versions on one endpoint scale independently.
endpoint = model.deploy(machine_type="n1-standard-2", min_replica_count=1, max_replica_count=3) print(endpoint.predict(instances=[[34, 2, 0, 1]]).predictions)
Endpoints can be public or private (through Private Service Connect or VPC peering) when traffic must stay off the internet.
Take quiz
orchestrate pipeline runs
serve online predictions from deployed models
store training datasets
the model versions deployed to it
different training regions
different IAM principals
10. What are the types of prediction in Vertex AI?
There are two main modes.
Online prediction is synchronous and low latency. You deploy a model to an endpoint and call it per request, for example to score a transaction as it happens.
Batch prediction is asynchronous. You point a job at a large input set in Cloud Storage or BigQuery, and it writes results back to Cloud Storage or BigQuery. No endpoint is needed, and compute exists only while the job runs.
Generative AI adds a third flavor: batch requests to Gemini, which run asynchronously at a discount compared with online calls.
Take quiz
a Pub/Sub topic only
Cloud Storage or BigQuery
a live endpoint URL only
online prediction
dataset export
batch prediction
11. What is Vertex AI Pipelines?
Vertex AI Pipelines is a serverless service for running ML workflows defined with the Kubeflow Pipelines (KFP) SDK or TFX. A pipeline is a DAG of steps, such as prepare data, train, evaluate and deploy, and each step is a containerized component.
Inputs and outputs are tracked as artifacts in ML Metadata, so you get lineage for free. Results can be cached when a step's code and inputs haven't changed, and runs can be scheduled or triggered from CI/CD.
Its main value is repeatability: the same pipeline definition produces the same process every time.
Take quiz
Terraform modules only
the KFP SDK or TFX
Apache Beam only
a containerized component
a BigQuery view
a Pub/Sub subscription
12. What is Vertex AI Feature Store?
Feature Store is a managed place to define, store and serve ML features so that training and serving use the same values. It tackles training-serving skew, where a feature is computed one way in the notebook and another way in production.
The current version is built on BigQuery: your feature data stays in BigQuery tables for offline training, and a feature view syncs the latest values to an online store for low-latency lookups. The older standalone version is considered legacy.
Teams also use it to share features across projects instead of rebuilding them.
Take quiz
GPU quota shortages
slow container image pulls
inconsistent features between training and serving
Firestore
Cloud Spanner
Memorystore
BigQuery
13. What is Vertex AI Experiments?
Vertex AI Experiments tracks and compares training runs. For each run you log parameters (learning rate, batch size), metrics (accuracy, loss) and artifacts, then compare runs side by side in the console or in a notebook.
aiplatform.init(project="my-project", location="us-central1", experiment="churn-model") aiplatform.start_run("run-01") aiplatform.log_params({"lr": 0.01, "batch": 64}) aiplatform.log_metrics({"val_accuracy": 0.91}) aiplatform.end_run()
It integrates with Vertex AI TensorBoard for training curves, and the logged runs feed the same metadata store that pipelines use.
A practical convention is one experiment per problem (for example churn-model) and one run per training attempt. Pipelines can log into the same experiment, so manual notebook runs and automated runs end up in one comparison table.
Take quiz
rotate service account keys
autoscale endpoints
track and compare runs, parameters and metrics
batch_predict
log_metrics
deploy
14. What is Vertex AI Vector Search?
Vector Search is a managed service for approximate nearest neighbor (ANN) search over embeddings. You store vectors in an index, deploy the index to an endpoint, and query it to find the most similar items in milliseconds, even across billions of vectors.
It was previously called Matching Engine and is built on Google's ScaNN technology. Typical uses are semantic search, recommendations and the retrieval step of RAG.
Indexes can be updated in batch or with streaming updates, and queries can be filtered by attributes such as category or region.
Take quiz
converting audio to text
exact SQL joins on tables
approximate nearest neighbor search over embeddings
Feature Store
Matching Engine
Reasoning Engine
15. What is Vertex AI Studio?
Vertex AI Studio is the console workspace for experimenting with generative models without writing code. In the new platform it appears as Agent Studio.
You can write and test prompts, adjust parameters such as temperature, compare models side by side, save and share prompts, and start a tuning job. When a prompt works, you can export it as code for the SDK.
It is meant for prototyping and prompt design. Production traffic should go through the API or an agent runtime.
Take quiz
building Docker base images
managing VPC peering
designing and testing prompts in a console UI
rotate CMEK keys
compare models and refine prompts
compile KFP pipelines
16. How do you call Gemini models on Vertex AI?
Use the Google Gen AI SDK (google-genai) and set vertexai=True. Authentication goes through Application Default Credentials and IAM, so there is no API key to manage.
from google import genai client = genai.Client(vertexai=True, project="my-project", location="global") resp = client.models.generate_content( model="MODEL_ID", # pick a current Gemini model from Model Garden contents="Explain feature drift in two lines.", ) print(resp.text)
You can also call the REST API directly or try prompts first in Studio. Choose the region carefully if data residency matters: the global location works for many models, while a regional location keeps processing in that region.
Through the config argument you can add system instructions, temperature, a JSON response schema and safety settings. For multi-turn conversations, client.chats.create() keeps the history for you.
Take quiz
vertexai=True
gcp_mode="vertex"
enterprise=True
a browser session cookie
a password inside the prompt
Application Default Credentials and IAM
17. What is Vertex AI RAG Engine?
RAG Engine is a managed service that handles the plumbing of retrieval-augmented generation. It imports your documents, splits them into chunks, creates embeddings, stores them in a vector database and retrieves the best matches at query time.
The retrieved text is added to the prompt, so Gemini answers from your data rather than only from what it learned in training.
For storage you can use the built-in RagManagedDb or connect Vertex AI Vector Search and other vector stores. A serverless mode is in public preview, and schema-based metadata search lets you filter by document attributes.
Take quiz
manage ingestion, chunking, embedding and retrieval for grounding prompts
train the base model's weights
replace IAM policies
Cloud Storage buckets only
Cloud SQL only
RagManagedDb or Vertex AI Vector Search
18. What is the Agent Development Kit (ADK)?
ADK is an open-source, code-first framework for building AI agents. It is model-agnostic, so although it works well with Gemini you can plug in other models.
You define an agent with instructions and tools (Python functions, MCP servers, other agents), and ADK manages the loop of reasoning, tool calling and state. It supports multi-agent hierarchies and has built-in tooling for evaluation and local testing.
An ADK agent can run locally or be deployed to Agent Runtime for managed hosting. The adk web command starts a local dev UI where you can chat with the agent and trace each tool call.
Take quiz
an open-source, code-first framework for building agents
a GPU scheduling service
a hosted data warehouse
a larger TPU slice
a second billing account
tools such as Python functions or MCP servers
19. What is Agent Runtime in Gemini Enterprise Agent Platform?
Agent Runtime is the fully managed environment for hosting and scaling agents. It was previously named Agent Engine (and before that, Reasoning Engine).
You deploy agent code built with ADK or other frameworks, and the service handles scaling, IAM-based access and integration with Sessions and Memory Bank. The revamped runtime advertises sub-second cold starts and support for agents that run for long periods. Agents written with other frameworks, such as LangGraph, can be packaged for the runtime too.
The point is that you ship agent code and skip building the serving infrastructure yourself.
Take quiz
Agent Engine (and earlier Reasoning Engine)
Matching Engine
Model Garden
manual rack provisioning
on-premises only installs
sub-second cold starts
20. How do you control access in Vertex AI?
Access is controlled with IAM. Grant predefined roles such as Vertex AI User for day-to-day use, Vertex AI Viewer for read-only access and Vertex AI Administrator only for those who manage resources.
Training jobs and endpoints run as a service account. Use a dedicated one with only the permissions the job needs (for example, read one bucket) instead of the default or an owner-level account.
For stricter environments, add VPC Service Controls, private endpoints and customer-managed encryption keys on top of IAM.
Take quiz
a shared personal user account
a dedicated service account with least-privilege roles
the project Owner for speed
Vertex AI User
Vertex AI Administrator
Project Owner
21. What is the difference between the Gemini Developer API and Vertex AI?
Both expose Gemini through the same google-genai SDK. The difference is the surrounding platform: the Developer API is built for fast prototyping with an API key, while Vertex AI is built for production on Google Cloud with enterprise controls.
| Aspect | Gemini Developer API | Vertex AI |
| Auth | API key | IAM and Application Default Credentials |
| Governance | Basic project settings | VPC Service Controls, CMEK, data residency options |
| Capacity | Shared quotas | Provisioned Throughput available |
| Ecosystem | Models and tuning in AI Studio | Model Garden, pipelines, monitoring, agents |
A common path is to prototype on the Developer API, then switch to vertexai=True with almost no code change when the app needs compliance and scale.
Take quiz
API-key-only authentication
IAM-based auth with VPC Service Controls and CMEK
no regional choice at all
create the client with vertexai=True plus project and location
install a different Python package for each
rewrite every prompt in a new format
22. When should you choose AutoML over custom training?
Choose AutoML when you have clean labeled data, a standard problem type and little time or ML expertise, and a solid baseline is more valuable than the last point of accuracy.
Choose custom training when you need a specific architecture, custom loss, special preprocessing, distributed training, or an exact framework version.
| Factor | AutoML | Custom training |
| Team skills | Light ML experience is enough | Needs ML engineers |
| Control | Limited | Full |
| Time to first model | Fast | Slower |
| Unusual data or loss | Poor fit | Good fit |
Many teams run AutoML first as a benchmark, then only invest in custom code if it clearly beats it.
Take quiz
Model Garden only
custom training
batch prediction
AutoML
it gives a quick baseline to beat
it is always the most accurate option
it removes the need for labeled data
23. Which is better for your workload, online or batch prediction?
Neither is better in general. The deciding question is how quickly a user or system needs the answer.
| Factor | Online prediction | Batch prediction |
| Latency | Milliseconds to seconds | Minutes to hours |
| Cost shape | Endpoint replicas billed while deployed | Billed only while the job runs |
| Input | Single or small requests | Large files or BigQuery tables |
| Typical use | Fraud checks, chat, recommendations at click time | Nightly churn scores, catalog tagging |
If predictions can be a few hours old, batch is usually much cheaper. A hybrid is common: score everyone nightly in batch, write results to BigQuery or Bigtable, and use online prediction only for the cases that need fresh data.
Take quiz
a Workbench notebook running manually
batch prediction
online prediction on a single replica
scoring a payment while the customer waits
weekly report generation
monthly archive tagging
24. Why was Vertex AI renamed Gemini Enterprise Agent Platform?
Google announced the change at Cloud Next in April 2026 to reflect a shift from a model-first platform to an agent-first one. The aim is to cover the whole agent lifecycle: build, scale, govern and optimize.
Vertex AI and Agent Builder were consolidated into one platform. New pieces include Agent Runtime, Memory Bank, Agent Registry for approved tools and agents, Agent Identity and Agent Gateway for governance, and agent observability.
For existing users the change is mostly branding and console navigation. Workloads continue to run, and the API endpoint is still aiplatform.googleapis.com. Check individual deprecation notices, since some modules (for example Vertex AI Extensions and Vertex Explainable AI) are being retired on their own schedules.
Take quiz
from open models to closed models only
from cloud to on-premises
from model-first to agent-first
they had to be migrated by hand within a week
they keep running, mostly with new branding
they were deleted
25. Explain how distributed training works on Vertex AI?
In a custom job you describe the cluster as a list of worker pools. Each pool has its own machine type, accelerator and replica count, and Vertex AI starts the replicas and injects the cluster configuration (such as TF_CONFIG or CLUSTER_SPEC) so your framework knows who is who.
| Pool | Role | Notes |
| Pool 0 | Primary replica (chief) | Exactly one replica; coordinates the job |
| Pool 1 | Workers | Do the training compute |
| Pool 2 | Parameter servers | Only for parameter-server strategies |
| Pool 3 | Evaluators | Optional; run evaluation |
Your code chooses the strategy: data parallelism (MirroredStrategy or MultiWorkerMirroredStrategy in TensorFlow, DistributedDataParallel in PyTorch), or model parallelism for very large networks.
For multi-node GPU training, Reduction Server can speed up gradient all-reduce by offloading it to dedicated CPU nodes. Use Spot VMs with regular checkpoints to cut cost, since preempted workers can resume from the last checkpoint.
The job succeeds when the primary replica exits cleanly, so make sure only the chief writes the final model.
Take quiz
Pool 1, the workers
Pool 3, the evaluators
Pool 0, the primary replica
container image downloads
gradient all-reduce in multi-node GPU training
BigQuery table scans
26. When would you choose a custom container over a prebuilt one?
Prebuilt containers cover TensorFlow, PyTorch, scikit-learn and XGBoost, for both training and serving. Start there: you supply a script or a saved model and skip building and maintaining an image.
Switch to a custom container when you need something they cannot provide:
- a framework or version that has no prebuilt image
- system libraries or native dependencies (for example OpenCV or a C++ extension)
- a custom serving stack, such as Triton or vLLM, or special pre and post-processing logic
- full control over the entrypoint and startup behavior
For serving, a custom container must run an HTTP server that answers the health and predict routes. If you only need light pre or post-processing, a custom prediction routine may be enough without writing the whole server.
Take quiz
training a scikit-learn model on CSV
storing model aliases
serving with vLLM or Triton and custom routes
an SSH daemon
an HTTP server with health and predict routes
a Jupyter kernel
27. How does hyperparameter tuning work in Vertex AI?
A HyperparameterTuningJob runs your training code many times with different hyperparameter values and searches for the best result. By default it uses Bayesian optimization, powered by Vertex AI Vizier, so later trials learn from earlier ones. Grid and random search are also available.
from google.cloud.aiplatform import hyperparameter_tuning as hpt tuning = aiplatform.HyperparameterTuningJob( display_name="lr-search", custom_job=custom_job, metric_spec={"val_accuracy": "maximize"}, parameter_spec={ "lr": hpt.DoubleParameterSpec(min=1e-4, max=1e-1, scale="log"), "batch": hpt.DiscreteParameterSpec(values=[32, 64, 128], scale="linear"), }, max_trial_count=20, parallel_trial_count=4, ) tuning.run()
Your training code must report the metric after each run, using the hypertune helper library. Note the trade-off in parallel_trial_count: more parallelism finishes sooner but gives Bayesian search less history to learn from.
Define the search space on a sensible scale: learning rates on a log scale, batch sizes as a few discrete values. Set a realistic max_trial_count for the size of the space, and use the best trial's parameters from the console to retrain the final model.
Take quiz
exhaustive grid search
manual trial-and-error by the engineer
Bayesian optimization via Vizier
makes every trial more accurate
finishes sooner but gives the search less history to learn from
disables the metric_spec
28. How does autoscaling work for Vertex AI endpoints?
Every deployed model has a minimum and maximum replica count. The platform adds replicas when average utilization stays above a target and removes them when load drops, never going outside those bounds.
The default signal is CPU utilization (target around 60%). For GPU deployments you can scale on accelerator duty cycle instead, using a setting such as autoscaling_target_accelerator_duty_cycle.
Two practical points come up in interviews. First, new replicas take time to pull the image and load the model, so sudden spikes can see higher latency; raise the minimum replica count if that matters. Second, a standard endpoint keeps at least one replica running, so you pay for it even when idle.
Take quiz
CPU utilization against a target
model file size
number of IAM principals
disable the health route
lower the maximum replica count
raise the minimum replica count
29. How can you roll out a new model version without downtime?
Deploy the new version to the same endpoint as the current one and give it a small slice of traffic. The old model keeps serving the rest, so users never see an outage.
model_v2.deploy(endpoint=endpoint, machine_type="n1-standard-2", min_replica_count=1, traffic_percentage=10) # v1 keeps the other 90%
- Watch latency, error rate and business metrics for the 10% slice.
- Increase the split step by step (10, 50, 100).
- Undeploy the old version once the new one is stable.
Rollback is just moving the traffic percentage back to the old model. Keep both deployed during the test so that switching is instant.
Use the same machine type for both versions during the test so latency comparisons are fair, and agree in advance what "good" means (for example, error rate and p95 latency thresholds) so the promote-or-rollback call is not a matter of opinion.
Take quiz
deploy it to the same endpoint with traffic_percentage=10
delete the old endpoint first
retrain the old model on 10% of the data
restoring a BigQuery snapshot
rebuilding the container image
both versions stay deployed and you shift the traffic split
30. Explain the execution flow of a Vertex AI Pipeline run?
You write components and a pipeline function with the KFP SDK, compile it to a pipeline spec, and submit it as a PipelineJob. Vertex AI then walks the DAG, launching each ready step as a containerized job.
from kfp import dsl, compiler from google.cloud import aiplatform @dsl.component def clean(n: int) -> int: return n - 1 @dsl.component def train(n: int) -> str: return f"trained on {n} rows" @dsl.pipeline(name="demo", pipeline_root="gs://my-bucket/root") def demo(n: int = 100): c = clean(n=n) train(n=c.output) compiler.Compiler().compile(demo, "demo.json") aiplatform.PipelineJob(display_name="demo-run", template_path="demo.json").run()
flowchart LR
A["Compile pipeline to spec"] --> B["Submit PipelineJob"]
B --> C["Resolve DAG order"]
C --> D{Cached result for this step?}
D -- Yes --> F["Reuse outputs"]
D -- No --> E["Run component container"]
E --> G["Write artifacts to pipeline root in GCS"]
F --> H["Record lineage in ML Metadata"]
G --> H
H --> I["Next step or run complete"]
Before running a step, the service checks whether the same component with the same inputs already ran. If so, it reuses the earlier outputs instead of recomputing. You can turn this off with enable_caching=False.
Artifacts land in the pipeline root bucket and their lineage is recorded in ML Metadata, which is how you later trace a deployed model back to its data and code.
Conditional logic and parallel loops in the KFP SDK let a pipeline branch, for example deploying only when an evaluation metric passes a threshold. Each step runs as its own Vertex AI job, so it can request its own machine type or GPU.
Take quiz
caching, when the component and inputs are unchanged
manual approval in the console
Model Registry aliases
the endpoint's replicas
the Workbench disk
the pipeline root in Cloud Storage
31. How does Vertex AI Model Monitoring detect skew and drift?
Model Monitoring compares statistics of the data your model sees against a reference, and raises an alert when the distance crosses a threshold you set per feature.
| Check | Compares | Catches |
| Training-serving skew | Serving data vs the training baseline | A feature computed differently in production |
| Prediction drift | Serving data now vs earlier serving data | The world changing over time |
For numerical features it measures distribution distance with Jensen-Shannon divergence, and for categorical features it uses L-infinity distance. Alerts can go to email or Cloud Monitoring.
It needs request data to be logged, usually with a sampling rate to control cost. Drift tells you something changed, not that accuracy has fallen, so pair it with ground-truth evaluation when labels arrive.
Take quiz
serving data against the training baseline
two Workbench notebooks
two IAM policies
Levenshtein distance
Hamming distance
Jensen-Shannon divergence
32. Which is better for orchestration, Vertex AI Pipelines or Cloud Composer?
They solve different problems and often work together.
| Aspect | Vertex AI Pipelines | Cloud Composer |
| Built on | KFP / TFX, serverless | Managed Apache Airflow |
| Focus | ML steps with artifact lineage and caching | General data and workflow orchestration |
| Strength | Tracking models, datasets and metrics | Hundreds of operators across systems |
| Infrastructure | No cluster to manage | Environment with ongoing cost |
Choose Pipelines when the workflow is mostly ML: prepare, train, evaluate, register. Choose Composer when it spans many systems, such as loading from several sources, running Dataflow jobs and sending notifications.
A common pattern is Composer scheduling the business workflow and triggering a Vertex AI pipeline for the ML part.
Take quiz
Cloud Composer
Vertex AI Pipelines
Cloud Scheduler
the workflow spans many non-ML systems
you only need to track a single model's metrics
you want no scheduling at all
33. What happens when a prediction request reaches a Vertex AI endpoint?
The request is authenticated through IAM, then the endpoint applies its traffic split to choose a deployed model. A load balancer sends it to a healthy replica, where your model container's HTTP server runs inference and returns the result.
sequenceDiagram participant C as Client participant E as Endpoint participant R as Replica (model container) C->>E: POST :predict with instances E->>E: Check IAM, apply traffic split E->>R: Route to a healthy replica R->>R: Preprocess, run model, postprocess R-->>E: predictions E-->>C: JSON response
If request-response logging is enabled, a sample is written to BigQuery for monitoring. Latency has two parts you can inspect separately in Cloud Monitoring: time inside the model container and overhead added by the platform and network.
Custom containers read the AIP_PREDICT_ROUTE and AIP_HEALTH_ROUTE environment variables to learn which paths to serve. The endpoint only sends traffic to replicas whose health route succeeds, which is why a slow model load shows up as a not-ready period right after deployment.
Take quiz
the model is retrained
IAM check and traffic split selection
the container image is rebuilt
BigQuery
Cloud DNS
Secret Manager
34. Explain the internal working of Vertex AI Vector Search?
Vector Search is built on ScaNN, Google's approximate nearest neighbor algorithm. The idea is to avoid comparing a query against every vector by narrowing the search in stages.
- Partition: vectors are grouped into clusters (a tree structure). A query first picks the closest few clusters.
- Compress and score: inside those clusters, vectors are stored in a compressed form (asymmetric hashing) so scoring is very fast.
- Re-rank: the best candidates are re-scored using the full-precision vectors, and the top results are returned.
This trade accuracy for speed, and you tune it. Settings such as leaf_node_embedding_count and the percentage of leaf nodes searched control recall versus latency. The distance measure (dot product, cosine or squared L2) must match how the embeddings were trained.
Operationally, you create an index, deploy it to an index endpoint, and send queries. Updates arrive as batch rebuilds or streaming upserts, and token or numeric restricts filter results. For queries that need exact words as well as meaning, hybrid search combines dense and sparse signals.
Take quiz
B-tree indexing
ScaNN
MapReduce
full-precision vectors for the best candidates
a SQL ORDER BY on the text
only the compressed vectors
35. When should you fine-tune a Gemini model instead of improving the prompt?
Try the cheaper options first: better instructions, few-shot examples, then RAG or grounding. Fine-tune when those still fall short.
| Situation | Best first move |
| Model ignores your output format | Clearer prompt or controlled generation; tune if inconsistent |
| Needs company facts or fresh data | RAG or grounding, not tuning |
| Consistent tone, labels or style at scale | Supervised fine-tuning |
| Long prompts are too costly or slow | Tune a smaller model to behave like the large one |
Tuning teaches behavior, not new facts, and it needs a few hundred clean, representative examples. If your data is thin or changes weekly, prompting plus retrieval is usually the safer route.
Take quiz
supervised fine-tuning
RAG or grounding
longer training epochs
consistent behavior, style or task format
live facts from the internet
how to authenticate users
36. How does supervised fine-tuning work for Gemini on Vertex AI?
You give the model examples of the input and the exact output you want, and Vertex AI adjusts a small set of extra weights so the model reproduces that behavior. The base model weights stay frozen, which makes tuning faster and cheaper than full training (an adapter-based approach, similar in spirit to LoRA).
- Prepare a JSONL file where each line is one conversation example, with a user turn and the ideal model turn.
- Upload the training file (and a separate validation file) to Cloud Storage.
- Start a tuning job with the source model, datasets and settings such as epochs and learning-rate multiplier.
- Review training and validation loss in the console to spot overfitting.
- Use the tuned model through its own endpoint, and compare it against the base model on a held-out set.
{"contents": [ {"role": "user", "parts": [{"text": "Classify: 'Refund still not received'"}]}, {"role": "model", "parts": [{"text": "billing_issue"}]} ]}
Quality beats quantity. A few hundred clean, varied examples usually outperform thousands of noisy ones. Watch the validation curve: if it rises while training loss keeps falling, reduce epochs.
Some newer models also support reinforcement-learning tuning, where a reward signal replaces fixed target answers.
Take quiz
the validation file
the training dataset
the base model weights
the endpoint needs more replicas
overfitting, so reduce epochs
the JSONL file is too small to upload
37. When should you use context caching with Gemini?
Use it when many requests start with the same large block of content, such as a long document, a codebase, a video or a big system prompt, and only the final question changes.
There are two flavors. Implicit caching is automatic: repeated prefixes may get a discount without any code. Explicit caching is something you create, with a time-to-live, so you get a predictable discount on the cached tokens.
from google.genai import types cache = client.caches.create( model="MODEL_ID", config=types.CreateCachedContentConfig( contents=[big_document], system_instruction="Answer only from the document.", ttl="3600s", ), ) resp = client.models.generate_content( model="MODEL_ID", contents="Summarize section 4.", config=types.GenerateContentConfig(cached_content=cache.name), )
It is not worth it for one-off prompts or small contexts, because cached content adds a storage charge for as long as the cache lives and there is a minimum size.
Take quiz
every prompt is short and unique
you only call the model once a month
many requests share the same large prefix
free storage forever
a cache you control with a TTL and a predictable discount
a larger output limit
38. How does grounding reduce hallucinations in Gemini?
Grounding connects the model to a source of truth at request time, so answers are built from retrieved evidence instead of only from training memory. The response includes grounding metadata that shows which sources supported which parts.
The main grounding sources are:
- Google Search for fresh public information
- Vertex AI Search or RAG Engine for your own documents
- Google Maps for place and location data
Because the citations come back with the answer, users and reviewers can verify claims. Grounding lowers the hallucination rate but doesn't eliminate it, so keep instructions like "answer only from the provided sources" and test with questions that have no answer in the data.
Take quiz
the model's training dataset
a guarantee of zero errors
the sources that support parts of the answer
public web Search only
Vertex AI Search or RAG Engine
Google Maps
39. Explain the execution flow of RAG with Vertex AI RAG Engine?
RAG has two phases: an offline ingestion phase that prepares your documents, and an online query phase that retrieves and answers.
sequenceDiagram participant U as User participant A as App participant R as RAG Engine participant V as Vector store participant G as Gemini Note over R,V: Ingestion (offline): import files, chunk, embed, store U->>A: Question A->>R: Retrieve for question R->>V: Embed query, similarity search V-->>R: Top matching chunks R-->>A: Chunks with sources A->>G: Prompt + chunks G-->>A: Grounded answer A-->>U: Answer with citations
- Ingest: import from Cloud Storage, Drive or other sources into a corpus; files are split into chunks and each chunk is embedded.
- Store: vectors go into the corpus's vector database, with optional metadata for filtering.
- Retrieve: the user's query is embedded and compared with stored vectors, returning the top-k chunks, optionally re-ranked.
- Generate: the chunks are added to the prompt and Gemini answers from them, returning sources.
Most quality problems come from chunk size, retrieval filters and top-k. Tune those before blaming the model.
Retrieval can be filtered by metadata such as department or document date, and the chunk sources become your citations. If nothing relevant is retrieved, instruct the model to say it does not know rather than guess.
Take quiz
compiling a KFP pipeline
tuning the base model
embedding the query and running similarity search
the VPC peering range
chunk size, top-k and filters
the endpoint's machine type
40. How does function calling work with Gemini on Vertex AI?
The model never runs your code. You describe your functions, the model decides when one is needed and returns the function name with arguments, and your application executes it.
- Declare functions with a name, description and parameter schema.
- Send the user's prompt along with those declarations.
- If the model chooses a function, it returns a call with arguments.
- Your code runs the function and sends the result back as a function response.
- The model uses the result to write the final answer.
from google.genai import types get_weather = types.FunctionDeclaration( name="get_weather", description="Get current weather for a city", parameters={"type": "OBJECT", "properties": {"city": {"type": "STRING"}}, "required": ["city"]}, ) resp = client.models.generate_content( model="MODEL_ID", contents="Weather in Pune?", config=types.GenerateContentConfig( tools=[types.Tool(function_declarations=[get_weather])]), ) call = resp.function_calls[0] # name and args; you execute it
A good description matters more than most people expect, because it is what the model uses to choose the tool. Validate arguments before running anything with side effects.
Take quiz
your application code
the Gemini model itself
the Model Registry
the endpoint's replica count
the training dataset labels
the function names and descriptions you declare
41. How do you evaluate generative AI models on Vertex AI?
Use the Gen AI evaluation service. You build an evaluation dataset of prompts (and reference answers where you have them), generate responses from one or more models or prompts, and score them.
- Computation-based metrics such as exact match, BLEU and ROUGE, which need reference answers.
- Model-based metrics where a judge model scores quality, either pointwise (rate one response) or pairwise (pick the better of two).
- Custom metrics for criteria specific to your product, like tone or policy compliance.
It can also evaluate partner models such as Claude, so you can compare across providers on the same set. Judge models have biases, so spot-check their scores with human review, especially for high-stakes use.
Take quiz
asks a judge to pick the better of two responses
measures GPU utilization
scores one response against a fixed number
they always cost more than humans
they cannot read text
judge models can be biased
42. How does Provisioned Throughput differ from pay-as-you-go for Gemini?
Pay-as-you-go charges per token with shared capacity. It is flexible and cheap at low volume, but capacity is not reserved, so heavy shared demand can lead to throttling.
Provisioned Throughput reserves dedicated capacity for a specific model and region for a committed term. You pay a fixed fee, measured in generative AI scale units, and get predictable throughput and latency.
| Aspect | Pay-as-you-go | Provisioned Throughput |
| Billing | Per token used | Fixed fee for reserved capacity |
| Capacity | Shared | Reserved for you |
| Best for | Spiky or low traffic | Steady, high-volume, latency-sensitive apps |
Requests above your reserved capacity can spill over to pay-as-you-go by default, or you can configure them to fail. Commit only after you have measured your steady-state load.
Take quiz
steady high-volume traffic that needs predictable latency
occasional experiments
one-time batch jobs
it is permanently deleted
it forces a re-purchase of the term
it can spill over to pay-as-you-go
43. How can you optimize cost when running Gemini and ML workloads on Vertex AI?
Cost control differs a little for generative AI and for classic ML, but the habit is the same: match the resource to the actual need.
For Gemini:
- Use a smaller model (Flash or Flash-Lite class) for simple tasks and reserve Pro-class models for hard ones.
- Send non-urgent work through batch requests, which are discounted versus online calls.
- Use context caching for repeated long prefixes, and keep prompts and
max_output_tokenstight.
For ML:
- Train on Spot VMs with checkpointing, and right-size machine types.
- Set sensible minimum replicas, undeploy unused endpoints, and stop idle Workbench instances.
- Prefer batch prediction when latency doesn't matter, and add billing labels to every job for attribution.
Take quiz
batch requests
Provisioned Throughput with extra units
larger max_output_tokens
disabling checkpoints
using the largest GPU always
Spot VMs with regular checkpoints
44. How do you secure Vertex AI with VPC Service Controls, private endpoints and CMEK?
Security is layered, and each layer covers a different risk.
| Control | What it protects against | How it helps |
| IAM + service accounts | Over-broad access | Least-privilege roles per user and per job |
| VPC Service Controls | Data exfiltration | A perimeter that blocks API calls leaving the protected projects |
| Private endpoints (Private Service Connect or VPC peering) | Traffic on the public internet | Predictions are served only inside your network |
| CMEK | Key control requirements | Datasets, models and endpoints encrypted with your Cloud KMS key |
| Regions / data residency | Compliance limits | Keep data and processing in approved locations |
VPC Service Controls are often the piece people forget: IAM says who may call the API, while the perimeter says from where and to what, so a stolen credential cannot copy a dataset to an outside project.
CMEK has limits. For example, Memory Bank and Sessions instances that use the global endpoint cannot use CMEK, so pick a regional endpoint if you need your own keys.
Add audit logging so access to models and data is traceable, and use Model Armor for prompt-level threats.
Take quiz
model aliases
VPC Service Controls perimeter
a larger machine type
a private endpoint through Private Service Connect or VPC peering
a public endpoint with more replicas
an unrestricted default network
45. How does Model Armor protect Vertex AI applications from prompt injection?
Model Armor screens the prompts going into a model and the responses coming out, based on a template of policies you configure. It does not rely on the model to police itself.
It can detect prompt injection and jailbreak attempts, sensitive data such as personal information (using Sensitive Data Protection), malicious URLs and harmful content, each with its own confidence threshold.
- The app sends the user prompt to Model Armor before the model call.
- Model Armor returns a verdict: allow, or block with the reason.
- The app calls Gemini only if the prompt is clean.
- The response is screened the same way before it reaches the user.
It also works with Agent Gateway so agent traffic is covered. Treat it as one layer: still limit tool permissions, since a screened prompt can slip through.
Take quiz
only IAM policy changes
both prompts going in and responses coming out
only training data
screening can miss attacks, so least privilege limits the damage
Model Armor cannot be used with agents
tools are always blocked by default
46. Explain how Agent Runtime, Sessions and Memory Bank work together?
They split an agent's needs into three jobs: where it runs, what it remembers within one conversation, and what it remembers about a user over time.
- Agent Runtime hosts and scales the agent code.
- Sessions store the events of a single conversation (messages, tool calls, state). This is short-term context.
- Memory Bank stores long-term facts about a user across sessions, such as preferences or past decisions.
sequenceDiagram participant U as User participant A as Agent on Runtime participant S as Sessions participant M as Memory Bank U->>A: New message A->>S: Load session events A->>M: Retrieve relevant memories for user M-->>A: Matching memories A->>A: Reason with Gemini and tools A->>S: Append new events A-->>U: Response S-->>M: Trigger memory generation (event count or idle time)
Memory Bank doesn't save everything. It uses a model to extract the facts worth keeping, and generation can be triggered by criteria such as number of events or idle time. Retrieval is by relevance, and it keeps a version history of memories.
Keep memories scoped per user, so one person's facts never surface in another person's session.
Take quiz
Sessions
Memory Bank
Agent Garden
event count or idle time criteria
an endpoint redeploy
a nightly Model Registry export
47. What is the difference between managed API models and self-deployed models in Model Garden?
Model Garden offers two ways to run non-Gemini models, and they differ in who runs the infrastructure.
| Aspect | Managed API (serverless) | Self-deployed |
| Who runs servers | You, on your own endpoint | |
| Billing | Per token or request | Per node hour for the machines |
| Setup | Enable and call | Choose machine type, GPUs, scaling |
| Control | Limited to API settings | Full control over serving and weights handling |
| Examples | Partner models such as Claude | Open-weight models such as Gemma |
Use the managed API for speed and low operational load. Self-deploy when you need an open model fine-tuned on your own data, specific hardware, strict network isolation, or steady high volume where dedicated machines are cheaper.
Take quiz
a third-party CDN
your team
node hours for the machines
a flat yearly fee
tokens only
48. How do you troubleshoot a failed custom training job on Vertex AI?
Work from the outside in: first confirm the job started, then check resources, then the code.
- Open the job in the console and read the error state, then check Cloud Logging for the job's logs.
- If it never started, check the image URI, the entrypoint and whether the service account can pull from Artifact Registry and read Cloud Storage.
- Check quotas for the region (CPU, GPU, TPU). A job waiting or failing at provisioning is often a quota issue.
- If it dies mid-run with exit code 137, the container ran out of memory. Use a bigger machine or a smaller batch size.
- Reproduce locally with
docker runon a small sample of data, and use the job's interactive shell for a live look.
Typical culprits are wrong bucket paths, missing dependencies in the container, version mismatches between training and the prebuilt image, and writing outputs to the wrong location (use AIP_MODEL_DIR).
Take quiz
the endpoint traffic split is wrong
the model alias is missing
the container ran out of memory
tweak the learning rate
image URI, permissions and regional quota
enable batch prediction
49. How do you troubleshoot high latency on a Vertex AI endpoint?
First split the latency into model latency (time inside your container) and overhead latency (platform and network), which Cloud Monitoring reports separately. The answer decides where to look.
- High model latency: profile the model and its preprocessing, move to a GPU, quantize or use an optimized runtime, and batch requests inside the server.
- High overhead: check payload size, client region versus endpoint region, and consider a dedicated or private endpoint.
- Spikes under load: look at replica CPU or GPU utilization, and raise
max_replica_countor lower the autoscaling target. - Slow after idle periods: cold starts from replica scale-up, so raise the minimum replica count.
Also check whether heavy preprocessing runs per request that could be precomputed, such as tokenization or feature joins.
Take quiz
training latency and storage latency
IAM latency and billing latency
model latency and overhead latency
shrink the request payload to zero
raise the minimum replica count to avoid cold starts
delete the model alias
50. How would you design an end-to-end MLOps workflow on Vertex AI?
The goal is a loop where new data triggers training, bad models are blocked automatically and good ones are released gradually.
flowchart LR
A["Data in BigQuery / GCS"] --> B["Feature Store"]
B --> C["Pipeline: validate, train, evaluate"]
C --> D{Beats current model?}
D -- No --> X["Stop and alert"]
D -- Yes --> E["Model Registry new version"]
E --> F["Canary deploy to endpoint"]
F --> G["Model Monitoring"]
G -- Drift or quality drop --> C
G -- Healthy --> H["Promote to 100%"]
| Stage | Vertex AI service | Key practice |
| Data and features | BigQuery, Feature Store | One definition for training and serving |
| Training | Pipelines, custom training, Experiments | Everything versioned and reproducible |
| Release gate | Evaluation step in the pipeline | Block deployment if metrics regress |
| Registry | Model Registry with aliases | Promote by moving an alias |
| Serving | Endpoints with traffic split | Canary, then full rollout |
| Operations | Model Monitoring, Cloud Monitoring | Alerts that trigger retraining |
Wrap the whole thing in CI/CD (for example Cloud Build): a code change compiles and runs the pipeline in a test project, and a merge to main promotes it. Keep dev, staging and production in separate projects with separate service accounts.
Finally, log metadata so any live prediction can be traced back to the exact data, code and parameters that produced the model.