MyInternships.in
40 QUESTIONS · JUNIOR TO SENIOR · WITH ANSWERS

GCP Cloud IAM Interview Questions and Answers

IAM is the topic interviewers use to separate people who have configured GCP from people who have only deployed to it. Roles, inheritance, service accounts, impersonation, conditions, deny policies and the practical route to least privilege.

4 junior7 mid-level29 senior

How to use this set

Every question below is written the way an interviewer actually phrases it, followed by a model answer you could say out loud in 30–60 seconds, and — where it helps — the reason the question is asked and the trap most candidates fall into. Questions are tagged Junior, Mid or Senior so you can skip to your level.

This is one of 25 topic sets in the complete GCP interview questions guide. Work through the fundamentals first, then the services your target role actually uses.

1
Junior level

What is Cloud IAM and what are its three core elements?

Answer: Cloud IAM controls who can do what on which resource. The three elements are the principal (a user, group, service account, or domain), the role (a collection of permissions), and the resource the binding applies to. A policy is the set of bindings attached to a resource, and it is evaluated together with everything inherited from above in the hierarchy.

Why interviewers ask this: The phrase interviewers want is "you never grant permissions directly — you grant roles, which are bundles of permissions". Permissions follow the service.resource.verb format such as compute.instances.delete, and knowing that format lets you reason about custom roles.

2
Junior level

What are the three types of IAM roles?

Answer: Basic roles — Owner, Editor, Viewer — are the legacy, extremely broad roles that predate fine-grained IAM. Predefined roles are service-specific bundles curated and maintained by Google, such as roles/storage.objectViewer. Custom roles are ones you define yourself from an explicit list of permissions when no predefined role fits.

Why interviewers ask this: The recommendation to state clearly is: never use basic roles in production. Editor alone grants tens of thousands of permissions across every service, including the ability to modify most resources, and it is the single most common finding in a GCP security review.

3
Mid level

How does IAM inheritance work in the resource hierarchy?

Answer: Policies set at the organisation, folder or project level are inherited by all descendants, and the effective policy on a resource is the union of its own bindings and every inherited binding. Inheritance is additive only — a policy lower in the hierarchy cannot remove a permission granted higher up.

Why interviewers ask this: That "additive only, cannot subtract" rule is the most-asked IAM fact in GCP interviews. The consequence is that a wide grant at the organisation level cannot be walked back project by project, which is why organisation-level bindings should be extremely rare. IAM deny policies, added later, are the only mechanism that can actually subtract.

4
Senior level

What is an IAM deny policy?

Answer: A deny policy explicitly blocks a set of principals from using specified permissions on a resource and its descendants, and it is evaluated *before* allow policies. It is the only way to override an inherited grant, so it is used for hard guardrails — for example denying everyone except a break-glass group the ability to delete production log buckets.

Why interviewers ask this: The evaluation order is the whole point: deny wins over allow regardless of where the allow came from. Before deny policies existed, the only way to prevent an inherited permission was to not grant it in the first place, which was a real gap in the model.

5
Mid level

What is a service account and what are the ways a workload can use one?

Answer: A service account is a non-human identity for an application or workload. A workload can use it by attachment — a VM, Cloud Run service or Cloud Function runs *as* it and gets tokens from the metadata server; by impersonation — a principal with the Service Account Token Creator role mints short-lived credentials for it; by Workload Identity on GKE; by Workload Identity Federation for external workloads; or, worst, by an exported JSON key file.

Why interviewers ask this: The ranking is the answer: attachment and federation are best because credentials are short-lived and never stored; exported keys are worst because they are long-lived, copyable and frequently leaked to source control. Being able to give that ordering with reasons is exactly what a security-aware interviewer is testing.

6
Senior level

Why should you avoid downloading service-account keys, and what do you do instead?

Answer: A downloaded JSON key is a long-lived, non-expiring credential that can be copied anywhere, committed to a repository, or exfiltrated, and rotating it requires touching every consumer. Instead, attach a service account to the GCP resource, use Workload Identity on GKE, use Workload Identity Federation for workloads outside GCP, or use impersonation for human access.

Why interviewers ask this: The organisational control to name is the constraint constraints/iam.disableServiceAccountKeyCreation, which blocks key creation across the estate. Saying "we would prevent it with an org policy rather than trusting people to follow a guideline" is a materially stronger answer than "we would avoid it".

7
Senior level

What is Workload Identity Federation?

Answer: Workload Identity Federation lets workloads running outside Google Cloud — on AWS, Azure, GitHub Actions, or any OIDC-compliant system — exchange their native identity token for a short-lived Google credential, with no service-account key involved. You configure a workload identity pool and a provider that trusts the external issuer, and map external attributes to Google principals.

Why interviewers ask this: The most common concrete use is GitHub Actions deploying to GCP: instead of storing a service-account JSON key as a repository secret, the workflow presents its GitHub OIDC token and receives a short-lived GCP token. Naming that example immediately demonstrates you have implemented it.

8
Senior level

What is service account impersonation and when do you use it?

Answer: Impersonation lets a principal who holds roles/iam.serviceAccountTokenCreator on a service account generate short-lived access tokens, ID tokens or signed blobs as that service account. It is used so humans and CI systems can act with a workload's permissions without ever holding a permanent credential for it.

Why interviewers ask this: The audit benefit is what makes it valuable: the logs record that a specific human impersonated the service account, so you keep attribution. With a shared exported key you only see the service account, and you cannot tell who used it. That accountability point is the strongest part of the answer.

gcloud
gcloud storage ls gs://prod-data \
  --impersonate-service-account=data-reader@my-proj.iam.gserviceaccount.com
9
Senior level

What is the difference between roles/iam.serviceAccountUser and roles/iam.serviceAccountTokenCreator?

Answer: Service Account User allows a principal to attach a service account to a resource — to deploy a VM or Cloud Run service that *runs as* that service account. Service Account Token Creator allows a principal to mint credentials and act as the service account directly, right now, without deploying anything.

Why interviewers ask this: Both are privilege-escalation paths and interviewers probe this deliberately: if a user has Service Account User on a highly privileged service account, they can deploy code that runs with those privileges, effectively inheriting them. Auditing who holds these two roles is a standard part of a GCP security review.

10
Senior level

What are IAM conditions?

Answer: IAM conditions attach a CEL expression to a role binding so it only applies when the condition is true — based on request time (for temporary access), the resource name or type, or request attributes such as the access level in Access Context Manager. For example, granting Compute Admin only on instances whose name starts with dev-.

Why interviewers ask this: The most valuable practical use is time-bound access: grant an elevated role that automatically expires at a timestamp, which removes the "we forgot to revoke it" failure mode entirely. Not every service supports conditions on every attribute, which is the limitation worth acknowledging.

gcloud
gcloud projects add-iam-policy-binding my-proj \
  --member=user:oncall@example.com --role=roles/compute.admin \
  --condition='expression=request.time < timestamp("2026-09-01T00:00:00Z"),title=temp-access'
11
Senior level

How do you implement least privilege in an existing GCP environment?

Answer: Start by replacing basic roles with predefined roles. Use IAM Recommender, which analyses 90 days of actual permission usage, to identify over-granted bindings and suggest tighter roles. Grant at the narrowest resource scope that works — a bucket rather than a project. Grant to groups rather than individuals. Use conditions for time-bound elevation, and add deny policies for hard guardrails.

Why interviewers ask this: The caution to include: recommendations come from observed usage, so a quarterly job may not appear in the 90-day window and blindly applying every recommendation can break things. Describing a review-then-apply process rather than automatic enforcement is what makes this a realistic answer.

12
Mid level

Why should you grant IAM roles to groups rather than to individual users?

Answer: Because access then follows group membership, which is managed in your identity system alongside joining, moving and leaving. Onboarding and offboarding become a single membership change rather than an audit of every project. It also makes the policy far smaller and easier to review.

Why interviewers ask this: The failure this prevents is the classic one where a departing employee's individual bindings are scattered across dozens of projects and nobody finds them all. Adding "and we review group membership rather than IAM policies" shows you understand where the control actually lives.

Preparing for a GCP role?

Browse live GCP cloud internships and fresher jobs hiring across India right now.

Cloud Engineer Jobs
13
Mid level

What is the Policy Troubleshooter?

Answer: Policy Troubleshooter tells you whether a specific principal has a specific permission on a specific resource, and explains exactly which binding grants or fails to grant it — including inherited bindings and any conditions that were not satisfied. It answers "why can this user not access this bucket?" definitively.

Why interviewers ask this: It is the right answer to any troubleshooting question about access, because manually reconstructing the effective policy across organisation, folder and project levels with conditions is genuinely error-prone. Naming it instead of describing manual inspection is a practical signal.

14
Junior level

What is the difference between authentication and authorisation in GCP?

Answer: Authentication establishes who the caller is — validating an OAuth token, an ID token or a federated credential. Authorisation decides whether that authenticated identity may perform the requested action, which is what IAM evaluates. A request must pass both, and a valid token with no matching role gives a 403, not a 401.

Why interviewers ask this: The diagnostic value is real: a 401 means the credential is missing, expired or malformed, while a 403 means the identity is known but lacks the permission. Being able to route a debugging effort correctly from the status code alone is a small but telling competence signal.

15
Senior level

What are custom roles and what are their limitations?

Answer: Custom roles let you define a role from an explicit list of permissions at the organisation or project level, for cases where predefined roles are too broad or too narrow. Limitations: you must maintain them yourself as Google adds permissions, some permissions cannot be included in custom roles, and permissions in alpha or beta stages can change or be removed.

Why interviewers ask this: The maintenance burden is the honest downside and interviewers respect hearing it. The recommendation is to prefer a predefined role at a narrow resource scope over a custom role at a broad one, because Google maintains the predefined role for you as services evolve.

16
Mid level

How long does an IAM change take to become effective?

Answer: IAM changes are eventually consistent and typically take effect within seconds, but Google documents that propagation can take up to seven minutes to be fully consistent everywhere. Automation that grants a role and immediately uses it should retry with backoff rather than assume immediate availability.

Why interviewers ask this: This is the cause of intermittently failing Terraform runs and deployment scripts, where a resource is created, a binding is added, and the very next API call fails with 403. The fix is a retry loop, not a fixed sleep — that distinction is what makes the answer practical.

17
Senior level

What is the default service account and why is it a risk?

Answer: Compute Engine and App Engine create a default service account in each project, and unless you change it, VMs run as it. Historically it was granted the project Editor role, which means any workload on those VMs can modify almost anything in the project. It is a broad, shared identity with no separation between workloads.

Why interviewers ask this: The fix to describe: create a dedicated, minimally-privileged service account per workload, and enforce the organisation policy constraint constraints/iam.automaticIamGrantsForDefaultServiceAccounts to stop the automatic Editor grant on new projects. This is one of the highest-value hardening steps in a GCP estate.

18
Senior level

What is Access Context Manager and what is an access level?

Answer: Access Context Manager defines access levels — named conditions based on attributes such as source IP range, device policy, geography or identity — that can be used by VPC Service Controls and by IAM conditions. An access level might be "corporate IP ranges and a company-managed, encrypted device".

Why interviewers ask this: It is the building block for context-aware access, which is Google's BeyondCorp zero-trust model applied to cloud resources: instead of "on the VPN, therefore trusted", access depends on identity plus device and network context evaluated per request.

19
Senior level

What is Identity-Aware Proxy?

Answer: IAP enforces identity and context based access at the application layer, in front of App Engine, Cloud Run, GKE or Compute Engine backends behind a load balancer, and also for TCP forwarding to SSH and RDP. Users authenticate with Google identities and are authorised by IAM, so the application needs no VPN and no public exposure of the SSH port.

Why interviewers ask this: The BeyondCorp framing is what to name: access decisions are per request based on identity and context, not on network location. The practical detail is that the application should verify the signed IAP JWT header rather than trusting a plain header, otherwise it can be bypassed if it is ever reachable directly.

20
Senior level

How do you audit who has access to what across a GCP organisation?

Answer: Use Cloud Asset Inventory to export all IAM policies to BigQuery and query them — that is the only practical way to answer questions like "which principals have storage.objects.get anywhere?" across hundreds of projects. Policy Analyzer answers targeted questions directly, and Security Command Center surfaces over-privileged and public grants as findings.

Why interviewers ask this: The reason a manual approach fails is inheritance plus scale: effective access is the union of bindings at four levels across every project, and no console view shows that. Answering with "export to BigQuery and query it" is the answer of someone who has actually had to produce an access report for an auditor.

21
Senior level

What are Cloud Audit Logs and how do they relate to IAM?

Answer: Admin Activity audit logs record every IAM policy change and every configuration change, are always enabled and cannot be disabled, and are retained for 400 days by default. Data Access logs record reads and writes of user data and are disabled by default outside BigQuery because of their volume. Together they answer who granted access and who used it.

Why interviewers ask this: The compliance pattern to name: sink audit logs to a separate project with restricted IAM and a locked retention policy, so that a compromised project owner cannot delete the evidence of their own actions. Log sinks with an aggregated organisation-level export are the mechanism.

22
Junior level

What is the difference between a Google account, a service account, a group and a domain as IAM principals?

Answer: A Google account represents a person and authenticates interactively. A service account represents a workload and authenticates with tokens. A Google group is a named collection of accounts used to grant roles collectively — groups can contain other groups. A domain or Cloud Identity domain grants to everyone in an organisation, and allUsers/allAuthenticatedUsers are the public special cases.

Why interviewers ask this: The nested-groups point is worth adding because effective access through group nesting is a frequent audit surprise. And clarifying that allAuthenticatedUsers means any Google account anywhere, not "our employees", is a mistake worth pre-empting.

23
Senior level

How do you grant a user access to only one BigQuery dataset?

Answer: Grant the role at the dataset resource rather than the project — roles/bigquery.dataViewer on the dataset itself — and grant roles/bigquery.jobUser at the project level so they can run queries and be billed. Without the job-level role they can see the dataset but cannot query it.

Why interviewers ask this: The two-part nature of this is exactly what the question tests: BigQuery separates *data* access from *compute* (job) access, so the naive single grant does not work. Being able to explain that split is a reliable marker of real BigQuery use.

24
Senior level

What is the principle behind separation of duties in GCP, and how would you implement it?

Answer: No single person should be able to both perform a sensitive action and conceal it. Implement it by splitting roles — the team that deploys does not administer logging; the security team owns the log sink project and the KMS keys; production changes go through CI with a service account rather than through human console access; and break-glass accounts are separate, monitored and time-bound with IAM conditions.

Why interviewers ask this: The concrete GCP mechanisms are the answer: a separate logging project with its own IAM, CMEK keys owned by a security project, deny policies preventing log deletion, and approval gates in Cloud Deploy. Abstract statements about "separating duties" without naming mechanisms do not score.

Preparing for a GCP role?

Browse live GCP cloud internships and fresher jobs hiring across India right now.

Cloud Engineer Jobs
25
Senior level

What happens to a resource when the service account it runs as is deleted?

Answer: The workload immediately loses its ability to authenticate and all API calls fail. Service accounts can be undeleted within 30 days, but if a service account with the same name is recreated instead, it gets a new unique ID, so existing IAM bindings that reference the old ID become invalid and show as deleted principals in the policy.

Why interviewers ask this: The unique-ID detail is what makes this a good question: recreating "the same" service account does not restore access, which surprises people who assume the email address is the identity. Cleaning up those orphaned deleted: bindings is a standard hygiene task.

26
Senior level

What are IAM permissions for creating projects and who should have them?

Answer: Project creation requires resourcemanager.projects.create, granted through roles/resourcemanager.projectCreator at the organisation or folder level, plus billing.resourceAssociations.create on the billing account to link billing. It should be restricted to a platform team or, better, to an automation service account so projects are created through a vetted pipeline with standard labels, policies and networking.

Why interviewers ask this: The governance argument is the substance: ungoverned project creation produces an estate with no consistent labelling, no log sinks and no network attachment, which is unmanageable later. A project-vending pipeline is the pattern to name.

27
Senior level

How would you give a contractor read-only access to production for two weeks?

Answer: Add them to a dedicated group, grant that group a narrow predefined viewer role at the smallest scope that covers what they need, and attach an IAM condition with an expiry timestamp so the binding stops working automatically. Enable Data Access audit logs for the resources involved, and confirm the group membership is removed at the end as a second control.

Why interviewers ask this: The interviewer is testing whether you reach for time-bound conditions rather than a calendar reminder. Adding the audit-logging step shows you are thinking about verification, not just access, which is what a regulated environment requires.

28
Mid level

What is the difference between IAM and Cloud Identity?

Answer: Cloud Identity manages the identities themselves — user accounts, groups, devices, authentication, SSO and multi-factor policy. IAM controls what those identities may do with GCP resources. Cloud Identity answers "who exists and how do they prove it"; IAM answers "what may they do".

Why interviewers ask this: The integration point worth naming is federation with an existing identity provider such as Okta, Azure AD or ADFS via SAML, so GCP access follows the corporate directory. Almost every enterprise does this rather than managing accounts separately in Google.

29
Senior level

What is an organisation policy constraint and give three you would always apply?

Answer: A constraint is a restriction on resource configuration enforced regardless of IAM. Three high-value ones: constraints/compute.vmExternalIpAccess to prevent public IPs on VMs; constraints/iam.disableServiceAccountKeyCreation to prevent long-lived exported keys; and constraints/storage.publicAccessPrevention to prevent public buckets. Also worth naming is constraints/gcp.resourceLocations to keep data in permitted regions.

Why interviewers ask this: The reason to lead with these three is that they each close an entire class of incident — internet-exposed VMs, leaked credentials and public data — and none of them can be closed with IAM alone. Naming specific constraint IDs rather than describing them generally is what proves familiarity.

30
Senior level

How do IAM policies interact with resource-level ACLs, for example on Cloud Storage?

Answer: Cloud Storage historically supported both IAM at the bucket level and per-object ACLs, and access was granted if *either* allowed it. Uniform bucket-level access disables ACLs entirely so IAM is the single source of truth, which is what makes access auditable.

Why interviewers ask this: The reason interviewers ask is that dual systems produce unanswerable questions: with ACLs enabled, "who can read this bucket?" requires inspecting every object. Recommending uniform bucket-level access, and explaining the 90-day window before it becomes permanent, is the complete answer.

31
Mid level

What is a short-lived credential and why does it matter?

Answer: A short-lived credential is an OAuth access token or ID token with a lifetime typically measured in an hour, minted on demand from an underlying identity. It matters because a leaked short-lived token expires on its own, drastically reducing the window of exposure compared with a static key that remains valid until someone notices and revokes it.

Why interviewers ask this: The concrete link to make is that every GCP-native credential path — metadata server, Workload Identity, impersonation, federation — produces short-lived credentials, and the only path that does not is an exported key file. Framing the whole IAM security story around credential lifetime is a coherent, senior-sounding position.

32
Senior level

A developer says they cannot access a Cloud Storage bucket despite having Storage Admin. What could be wrong?

Answer: Several possibilities: the role was granted on a different project or resource; a VPC Service Controls perimeter is blocking access from their location; an IAM condition on the binding is not satisfied; an org policy or deny policy is overriding it; the bucket uses CMEK and they lack the KMS key permission; or the change simply has not propagated yet.

Why interviewers ask this: The CMEK case is the one that separates strong candidates — with a customer-managed key, Storage Admin alone is not enough; the principal also needs roles/cloudkms.cryptoKeyEncrypterDecrypter on the key. Listing several hypotheses and then naming Policy Troubleshooter to decide between them is the ideal structure.

33
Senior level

What is the recommended way for a CI/CD pipeline to authenticate to GCP?

Answer: Workload Identity Federation from the CI provider — GitHub Actions, GitLab, Bitbucket — exchanging the pipeline's OIDC token for a short-lived GCP credential, with the pool provider restricted by attribute conditions so only the intended repository and branch can assume the identity. If the pipeline runs on GCP (Cloud Build), simply attach a dedicated service account.

Why interviewers ask this: The attribute condition is the security-critical detail: without restricting on repository and ref, any repository in the organisation — or in some misconfigurations, any repository at all — could obtain the credential. That specific misconfiguration has caused real breaches, which is why it is asked.

34
Senior level

What is the difference between roles/owner and roles/resourcemanager.projectIamAdmin?

Answer: Owner is a basic role granting virtually every permission in the project plus the ability to manage IAM policies and delete the project. Project IAM Admin grants only the ability to manage IAM policies on the project — it cannot create or modify resources. Separating them is a core separation-of-duties control.

Why interviewers ask this: The subtlety worth raising is that Project IAM Admin is itself a privilege-escalation path: someone who can edit the IAM policy can grant themselves Owner. Any answer that presents it as harmless misses the point; it should be tightly held and monitored with alerts on policy changes.

35
Senior level

How do you monitor for suspicious IAM changes?

Answer: Create a log-based alert on Admin Activity audit logs for SetIamPolicy events matching sensitive conditions — grants of Owner or Editor, grants to allUsers or allAuthenticatedUsers, service-account key creation, or changes to the audit-log configuration itself. Route these to a security channel and to Security Command Center.

Why interviewers ask this: Naming the changes to the *logging configuration* as a signal is what marks a mature answer, because disabling logging is a standard early step in an intrusion. An alert that fires when someone alters the audit sink is one of the highest-value detections you can build.

Logging query
resource.type="project" AND protoPayload.methodName="SetIamPolicy"
AND protoPayload.serviceData.policyDelta.bindingDeltas.role="roles/owner"
36
Senior level

What is the "iam.serviceAccounts.actAs" permission and why does it matter?

Answer: It is the permission that allows a principal to deploy a resource that runs as a given service account, and it is contained in roles/iam.serviceAccountUser. It matters because it is a privilege-escalation boundary: a user with limited direct permissions can deploy a Cloud Function running as a highly-privileged service account and thereby execute arbitrary code with those privileges.

Why interviewers ask this: This is one of the most important and least-known IAM facts on GCP. It means auditing "who can act as which service account" is as important as auditing direct role grants, and it is exactly the sort of question a cloud-security interviewer uses to find genuine depth.

Preparing for a GCP role?

Browse live GCP cloud internships and fresher jobs hiring across India right now.

Cloud Engineer Jobs
37
Senior level

How does IAM apply to BigQuery, and what are dataset and table level controls?

Answer: BigQuery supports IAM at project, dataset, table and even column and row level. Project-level roles govern job execution and administration; dataset-level roles govern data access to everything in the dataset; table-level bindings narrow it further; policy tags with Data Catalog implement column-level security; and row-level access policies filter rows by a condition on the querying identity.

Why interviewers ask this: Column-level security through policy tags is the feature to name for any question about protecting PII, because it lets one table serve both restricted and unrestricted consumers without duplicating data. Authorised views are the older pattern and still relevant to mention.

38
Senior level

What is an authorised view in BigQuery and how does it relate to IAM?

Answer: An authorised view is a view in one dataset that is granted access to a source dataset, so consumers can be given access to the *view* without any access to the underlying tables. The view's identity, not the user's, reads the source data, which lets you expose a filtered or aggregated slice safely.

Why interviewers ask this: The value is enforcing a data contract: analysts see only the columns and rows the view exposes and physically cannot query around it. Authorised datasets and routines extend the same idea, and row-level security is the newer alternative for filtering by user.

39
Senior level

What is the recommended IAM structure for a company with 200 engineers across 15 teams?

Answer: Groups mirroring team and function, synced from the corporate identity provider; folders per business unit and environment; predefined roles granted to groups at the folder level for broad access and at the project or resource level for specific access; no basic roles anywhere; separate deployment service accounts per environment used by CI with Workload Identity Federation; deny policies and organisation policy constraints as guardrails; time-bound conditions for elevated access; and audit-log export plus IAM Recommender running continuously.

Why interviewers ask this: This is the closing design question. The signals are granting to groups rather than users, applying at folder level to avoid per-project sprawl, and treating org policy as the enforcement layer rather than relying on IAM alone. Mentioning that you would keep a documented break-glass procedure completes it.

40
Senior level

What is Security Command Center and how does it help with IAM?

Answer: Security Command Center is GCP's centralised security posture and threat-detection service. For IAM it surfaces findings such as public buckets and datasets, over-privileged service accounts, primitive-role usage, service-account keys that have not been rotated, and anomalous IAM grants, and it can also detect active threats through Event Threat Detection on audit logs.

Why interviewers ask this: The tiering matters in practice — the Standard tier gives basic findings while Premium and Enterprise add Event Threat Detection, Security Health Analytics at full breadth and compliance reporting. Knowing that some capabilities are paid tiers avoids promising things a Standard-tier customer will not see.

Continue your GCP interview prep

See all 25 GCP topics →

Ready to apply for GCP roles?

Cloud internships and fresher jobs across India — filtered to roles that actually name GCP in the requirements.

Cloud Engineer Jobs

Canonical: https://myinternships.in/gcp-interview-questions/cloud-iam