Prepare and test your skills

Prepare and test your skills

Free sample question with answers and detailed explanation below. The Professional Cloud Developer practice bank has an additional 608 practice questions.Try 10 free realistic questions: instant score, no credit card, and no account required.
A development team is deploying a new order-processing application on Compute Engine VMs in a production Google Cloud project. Existing VMs in the project currently run using the Compute Engine default service account, which holds the Editor (roles/editor) basic role.
The team needs to configure identity and access for the new application to meet these requirements:
gs://orders-data-prod), without permission to delete objects.orders-events).Which configuration should the team implement?
The Compute Engine default service account is an automatically provisioned account that typically holds the Editor (roles/editor) basic role across the entire project. Access scopes are legacy, VM-level configuration settings that restrict which Google Cloud API surfaces an instance's metadata server tokens can reach.
orders-data-prod) or a specific Pub/Sub topic (orders-events).There is no production scenario where relying on the Editor default service account and access scopes is recommended for least privilege; access scopes should only be set to cloud-platform alongside a dedicated user-managed service account.
To harden environments against accidental over-privileging, organizations enforce the Disable Automatic IAM Grants for Default Service Accounts constraint (constraints/iam.automaticIamGrantsForDefaultServiceAccounts).
The Editor (roles/editor) basic role grants thousands of permissions to read and modify nearly all resources across a Google Cloud project. User-managed service account keys are static, long-lived RSA private key files used to authenticate outside Google Cloud or when attached identities are unavailable.
iam.serviceAccountKeys.create, an attacker compromising the VM could mint new keys for other service accounts in the project to escalate privileges.Service account keys should only be used as a last resort when running workloads outside Google Cloud in an environment that does not support Workload Identity Federation, and even then, the service account must use minimal IAM roles rather than Editor.
When running on Compute Engine, attaching a service account directly to the VM eliminates the need to store, rotate, or protect private key files on disk.
Predefined roles such as Storage Object Admin (roles/storage.objectAdmin) and Pub/Sub Editor (roles/pubsub.editor) bundle permissions for managing data and resources within a specific service. When bound at the project level, those permissions are inherited by every bucket and topic inside that project.
storage.objects.delete, which violates the requirement to prevent object deletion.roles/pubsub.publisher).This configuration would only be appropriate if the application genuinely needed full administrative control over objects (including deletion) across all buckets and broad management access across all Pub/Sub resources in the project.
Even after avoiding basic roles and service account keys, developers must evaluate both the permission granularity of predefined roles and the resource hierarchy level at which roles are bound.
A user-managed service account is a dedicated non-human identity created specifically for an individual workload or application component. When paired with resource-level predefined roles and custom IAM roles, it establishes a strict trust boundary that grants only the exact permissions required for the workload to function.
roles/pubsub.publisher) role directly on the orders-events topic limits messaging access exclusively to that resource.roles/editor), preventing lateral movement across other project resources.cloud-platform access scope delegates all authorization enforcement to fine-grained IAM allow policies rather than coarse VM scopes.Unlike basic roles or project-wide predefined roles, combining a single-purpose user-managed service account with resource-scoped bindings and a custom role enforces true least privilege across both identity and resource boundaries.
Answer them yourself and get your score the moment you finish. No account needed.
Full access includes
Keep the momentum going with these hand-picked practice scenarios
Last updated Validated