Skip to content

Professional Machine Learning Engineer · Domain 2: Collaborating within and across teams to manage data and models · 16% of the exam

Task 2.2: Model prototyping using notebooks (e.g., Gemini Enterprise Agent Platform Workbench and Colab Enterprise).

Securing and sharing Agent Platform Workbench and Colab Enterprise notebooks, developing with PyTorch, scikit-learn and JAX, and prototyping with foundation and open models from Model Garden.

Study it

  • Securing and sharing Workbench instances and Colab Enterprise runtimes

    Lesson coming

  • Prototyping with foundation and open models from a notebook

    Partly covered by: Temperature and Sampling, What Is an LLM

Sample questions

Try each one before opening the answer. Every option is explained, with the Google Cloud documentation page that proves it.

Question 1 · choose 1

A team turned on automatic environment upgrades for its Agent Platform Workbench instances to get framework and GPU driver fixes. After the first upgrade, the notebooks in /home/jupyter are intact, but the extra pip packages the data scientists installed are gone, and so is a folder one of them kept under /home/analyst. The team wants to keep automatic upgrades. What should the data scientists do from now on?

  1. AInstall extra packages with pip install --user and keep working files under /home/jupyter
  2. BTurn off automatic upgrades and run the same upgrade by hand each month instead
  3. CStop the instances during the upgrade window so that the upgrade waits for the next start
  4. DInstall the extra packages into a new conda environment instead of the default one
Show the answer and why
  • AInstall extra packages with pip install --user and keep working files under /home/jupyter

    Correct

    The --user flag installs packages in /home/jupyter on the data disk, which an upgrade preserves together with the local files there.

  • BTurn off automatic upgrades and run the same upgrade by hand each month instead

    Incorrect

    A manual upgrade also replaces the boot disk, so the packages and the other folder would still be lost.

  • CStop the instances during the upgrade window so that the upgrade waits for the next start

    Incorrect

    A stopped instance is not upgraded automatically at all, so the fixes are missed rather than applied safely.

  • DInstall the extra packages into a new conda environment instead of the default one

    Incorrect

    Pip and conda libraries are stored on the boot disk by default, and the upgrade replaces that disk.

Upgradable Workbench instances have a boot disk and a data disk. An upgrade moves the boot disk to a new image and keeps the data disk: notebooks and files in /home/jupyter are preserved, while files in other /home/ directories and user-installed operating system packages are not. Pip and conda libraries live on the boot disk by default; installing pip libraries with the --user flag puts them in /home/jupyter/, where they survive. Automatic upgrades run only on instances that are running.

Question 2 · choose 1

A project that holds sensitive training data is inside a VPC Service Controls perimeter. The security team finds that a new Agent Platform Workbench instance in the project can still upload files to arbitrary internet hosts. Which instance setting most likely needs to change?

  1. ACreate the instance without a public IP address
  2. BTurn on idle shutdown for the instance
  3. CEncrypt the boot and data disks with a customer-managed key
  4. DChange the JupyterLab access mode to single user
Show the answer and why
  • ACreate the instance without a public IP address

    Correct

    A public IP allows egress to the internet, which bypasses the service perimeter; instances in a perimeter should not have one.

  • BTurn on idle shutdown for the instance

    Incorrect

    Idle shutdown stops an unused instance to save cost; it does not control network egress.

  • CEncrypt the boot and data disks with a customer-managed key

    Incorrect

    CMEK controls the key for data at rest, not where the instance can send data.

  • DChange the JupyterLab access mode to single user

    Incorrect

    The access mode decides who can open JupyterLab, not which network paths the VM has.

To use a Workbench instance within a service perimeter, the instance must not have a public IP address, because a public IP allows egress to the internet that bypasses the perimeter. Google APIs are reached through restricted.googleapis.com and the matching DNS and routes.

Question 3 · choose 1

A contractor's IAM access to an Agent Platform Workbench instance was removed this morning, but the security team finds that the contractor's browser session can still open the instance's JupyterLab. Access must end immediately. What should the ML engineer do?

  1. AChange the instance's JupyterLab access mode to a single other user
  2. BRotate the keys of the service account that the instance runs as
  3. CStop or reset the instance
  4. DRemove the contractor from the project's Google group and wait for it to apply
Show the answer and why
  • AChange the instance's JupyterLab access mode to a single other user

    Incorrect

    The access mode is set when the instance is created and cannot be changed afterwards.

  • BRotate the keys of the service account that the instance runs as

    Incorrect

    The open browser session does not depend on service account keys, so rotating them leaves it working.

  • CStop or reset the instance

    Correct

    A revoked user can keep using an existing JupyterLab session for up to five days; stopping or resetting the instance ends it.

  • DRemove the contractor from the project's Google group and wait for it to apply

    Incorrect

    The IAM change is already made; the cached session, not the group membership, is what still works.

Access to a Workbench instance's JupyterLab is governed by IAM and the access mode chosen at creation, which cannot be changed later. After revoking a user's permissions, an existing browser session can keep working for up to five days; to prevent access immediately, stop or reset the instance.

Question 4 · choose 1

A data scientist has a notebook in an Agent Platform Workbench instance that refreshes a report from BigQuery. It must run every night at 1 a.m. without anyone opening JupyterLab, and the team does not want to build a pipeline for it. What should the data scientist use?

  1. AA cron job inside the Workbench instance's operating system
  2. BAn Agent Platform pipeline wrapping the notebook's code
  3. CA scheduled notebook run with the Workbench executor
  4. DIdle shutdown set to wake the instance at 1 a.m.
Show the answer and why
  • AA cron job inside the Workbench instance's operating system

    Incorrect

    A cron job depends on the instance staying up and is not managed by Workbench.

  • BAn Agent Platform pipeline wrapping the notebook's code

    Incorrect

    A pipeline works, but building one is exactly what the team wants to avoid for a single notebook.

  • CA scheduled notebook run with the Workbench executor

    Correct

    The executor runs a notebook file on a schedule and stores the results without an interactive session.

  • DIdle shutdown set to wake the instance at 1 a.m.

    Incorrect

    Idle shutdown only stops an inactive instance; it does not start or run anything.

The Agent Platform Workbench executor runs notebook files on demand or on a schedule, such as hourly or nightly, without an open JupyterLab session. Colab Enterprise offers scheduled notebook runs as well.

Question 5 · choose 1

Ten data scientists need identical Python packages, system libraries and JupyterLab extensions in their Agent Platform Workbench instances, and they keep drifting apart when people install packages by hand. What should the ML engineer do?

  1. ABuild a custom container from a Google-provided base container and create the instances from it
  2. BShare a requirements.txt file in the repository and ask each person to install it in their instance
  3. CGive everyone one shared instance in service account access mode
  4. DTurn on automatic upgrades for all the instances
Show the answer and why
  • ABuild a custom container from a Google-provided base container and create the instances from it

    Correct

    Workbench supports custom containers derived from the base containers, so every instance starts from the same image.

  • BShare a requirements.txt file in the repository and ask each person to install it in their instance

    Incorrect

    A shared file still relies on manual installs, which is how the environments drift.

  • CGive everyone one shared instance in service account access mode

    Incorrect

    One shared VM avoids drift but forces everyone onto the same machine and sessions.

  • DTurn on automatic upgrades for all the instances

    Incorrect

    Upgrades move the base image forward; they do not install the team's own packages.

Agent Platform Workbench instances can be created from a custom container derived from one of the Google-provided base containers. Packages and extensions baked into the image are the same on every instance created from it.

Question 6 · choose 1

A data scientist prototypes PySpark feature code against a large dataset and wants to run it from a notebook on Spark, without moving to a separate cluster console or copying data to the notebook VM. What should the ML engineer set up?

  1. AA larger Workbench machine type that runs Spark in local mode on the notebook VM
  2. BA Colab Enterprise notebook with pandas instead of Spark
  3. CA Dataflow pipeline launched from the notebook
  4. DA Workbench instance with the Managed Service for Apache Spark JupyterLab extension
Show the answer and why
  • AA larger Workbench machine type that runs Spark in local mode on the notebook VM

    Incorrect

    Local mode is limited to one VM, so the large dataset still has to fit on it.

  • BA Colab Enterprise notebook with pandas instead of Spark

    Incorrect

    pandas runs in memory on the runtime and rewrites the team's Spark code.

  • CA Dataflow pipeline launched from the notebook

    Incorrect

    Dataflow runs Apache Beam, not the data scientist's PySpark code.

  • DA Workbench instance with the Managed Service for Apache Spark JupyterLab extension

    Correct

    The preinstalled extension lets notebooks use Managed Service for Apache Spark, serverless or on clusters, as their kernel.

Agent Platform Workbench instances have the Managed Service for Apache Spark JupyterLab extension preinstalled (version M113 and later), which lets notebooks run Spark workloads on Managed Service for Apache Spark, serverless or on Compute Engine clusters.

Question 7 · choose 1

A team wants to try an open model from Model Garden on its own data before deciding whether to tune and deploy it, and it wants working sample code rather than starting from a blank notebook. What is the quickest start?

  1. AWrite the loading and tuning code from scratch in a Workbench notebook
  2. BOpen the notebook linked from the model's card in Model Garden
  3. CDeploy the Model Garden model to an endpoint and test it with curl requests
  4. DCall the model through the Translation API's model selector
Show the answer and why
  • AWrite the loading and tuning code from scratch in a Workbench notebook

    Incorrect

    This works but is the slow start the team wants to avoid.

  • BOpen the notebook linked from the model's card in Model Garden

    Correct

    Model cards for most open and fine-tunable models offer an Open notebook option with working code for tuning the model.

  • CDeploy the Model Garden model to an endpoint and test it with curl requests

    Incorrect

    Deployment comes after prototyping and gives no code for tuning.

  • DCall the model through the Translation API's model selector

    Incorrect

    The Translation API serves translation models, not Model Garden's open models.

In Model Garden, the model cards of most open source foundation models and fine-tunable models support tuning in a notebook: Open notebook on the model card gives a working starting point for prototypes, and model cards also offer code samples.

Practice domain 2 →Practice all domains →