Google Cloud Engineer interview question · Most asked
How does IAM work in Google Cloud, and why should you avoid basic roles?
How it works Asked in Cloud Engineer interviews
Summary
An IAM allow policy on a resource binds principals (users, groups, service accounts, workload identities) to roles, which are collections of permissions. Basic roles (Owner, Editor, Viewer) grant thousands of permissions across every service, so use predefined roles for specific services, or custom roles when even those are too broad.
Longer Answer
- Grant roles to groups, not individual users, so access follows team membership.
- Grant at the lowest level that works (a bucket or a project rather than a folder).
- IAM Conditions limit a grant by resource name, tag or time (temporary access).
- Deny policies block specific permissions regardless of allows, useful as organisation guardrails.
- IAM Recommender suggests removing permissions a principal hasn't used in 90 days.
- Editor can, for example, create service account keys and change most resources: far too much for day-to-day use.
Key Points
- Principals get roles on resources.
- Basic roles are far too broad.
- Predefined or custom roles, granted to groups.
- Lowest level; conditions for temporary access.
- Recommender trims unused permissions.
Explanation
What interviewers look for
Least privilege in Google Cloud's terms and practical habits (groups, conditions, recommender).
More Google Cloud Engineer questions
- How do you design a Google Cloud landing zone for a company with several teams?
- How do you run Terraform for Google Cloud safely in a team?
- Explain Google Cloud's resource hierarchy: organisation, folders, projects and resources.
- What are service accounts, and how should workloads authenticate without service account keys?
- Compare Google Cloud's database options: Cloud SQL, AlloyDB, Spanner, Firestore and Bigtable.
- How is networking in a Google Cloud VPC different from AWS?
- When would you choose Cloud Run, GKE or Compute Engine?
- Design a highly available web application on Google Cloud.