Prepare and test your skills

Prepare and test your skills

Free sample question with answers and detailed explanation below. The Associate Cloud Engineer practice bank has an additional 2,014 practice questions.Try 10 free realistic questions: instant score, no credit card, and no account required.
A backend data processing application runs on a Compute Engine virtual machine and authenticates to Google Cloud services using a dedicated service account. The application only needs to read data objects from Cloud Storage buckets within a production project and does not interact with any other service.
You need to assign an Identity and Access Management (IAM) role to the service account following Google-recommended best practices and the principle of least privilege.
Which role should you assign to the service account?
The basic Editor role (roles/editor) is a highly privileged legacy primitive role. It encompasses all permissions of the Viewer role and adds permissions to create, modify, and delete resources across almost all Google Cloud services in the project.
Assigning Editor is generally never recommended for workload service accounts. It was historically applied as a default convenience setting in early prototypes, but current enterprise standards require replacing it with targeted predefined roles.
Historically, default service accounts (such as the Compute Engine default service account) were automatically granted the Editor role upon API enablement. Modern security best practices recommend disabling this default behavior using organization policies and assigning targeted predefined roles instead.
A custom IAM role is a user-defined collection of specific IAM permissions created within an organization or project. Custom roles are designed for scenarios where no existing predefined role meets the precise security requirements of an organization, such as when every relevant predefined role includes unwanted administrative or destructive permissions.
roles/storage.objectViewer already contains the exact permissions required without excess access, recreating it as a custom role adds unnecessary complexity without any security benefit.Creating a custom role would be appropriate if the application required an obscure, narrow combination of permissions that existing predefined roles bundled alongside unacceptable administrative or write capabilities.
A common misconception among practitioners is believing that strict least privilege mandates writing custom roles for every service account. When a predefined role perfectly matches the application's needed access, using the predefined role represents the recommended best practice.
The basic Viewer role (roles/viewer) is a legacy primitive role in Google Cloud. It provides broad, read-only permissions across virtually every Google Cloud service contained within a project, including Compute Engine, BigQuery, Pub/Sub, Cloud SQL, and Secret Manager.
This role would only be considered in early development or non-sensitive sandbox environments where a user or prototype script requires quick, unrestricted visibility across many different Google Cloud services without the overhead of configuring individual predefined roles.
A common beginner mistake is assuming that "read-only" automatically equals least privilege. While the Viewer role prevents destructive state changes (like deleting instances), project-wide read access exposes confidential data across multiple unrelated services.
In Google Cloud IAM, predefined roles are curated collections of permissions designed for specific job functions or service-specific operational tasks. The Storage Object Viewer role (roles/storage.objectViewer) provides granular read access to Cloud Storage objects and bucket contents without granting administrative access to bucket configurations or data modification rights.
roles/storage.objectViewer restricts permissions to read-only object operations (storage.objects.get and storage.objects.list), perfectly matching the application's functional requirements.Basic roles like Viewer or Editor grant sweeping permissions across hundreds of Google Cloud services within the project, violating least-privilege standards. Creating a custom role is unnecessary because roles/storage.objectViewer already maps precisely to the required permissions without including unneeded capabilities or introducing administrative maintenance burdens.
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