skip to main |
skip to sidebar
RSS Feeds
Technical interview questions for software engineers — languages, databases, cloud, DevOps, and CS fundamentals.
Technical interview questions for software engineers — languages, databases, cloud, DevOps, and CS fundamentals.
Technical interview questions for software engineers — languages, databases, web, cloud, DevOps, and fundamentals. Browse all topics.
Posted by Raj
Interviewers ask, "How do IAM Conditions and Tags help control access?" because they want to know: Can you scope access precisely without creating a mess of bindings? This post gives you a ready 30-second answer, the concept in plain English, common mistakes and tips for different roles. It is question 8 of the top 10 GCP resource hierarchy and IAM interview questions.
Short answer (30 seconds): An IAM Condition adds an 'only if' to a role binding. For example, only until Friday, or only on resources with the tag environment equals development. Tags are key-value pairs attached to resources and they are inherited down the hierarchy. Together they let me say: this group gets this role only on development resources. It reduces the number of separate bindings and keeps policy readable.
Can you scope access precisely without creating a mess of bindings?
Easy picture: A condition is a sticky note saying 'only if'. Tags are coloured stickers on rooms. Together: 'this team may enter rooms with a green sticker, until Friday'.
# Condition expression examples
request.time < timestamp('2026-12-31T00:00:00Z')
resource.matchTag('ORG_ID/env', 'dev')
Replace ORG_ID, FOLDER_ID and PROJECT_ID with your own values. Check gcloud help for current flags before you use a command.
| Role | What to emphasise |
|---|---|
| Architect | Use tags to express environment and data sensitivity across projects. |
| Data Engineer | Tag datasets by sensitivity and restrict access by condition. |
| DevOps Engineer | Apply tags in Terraform at project creation. |
| Platform Engineer | Make tagging mandatory in the project factory. |
Always add 'labels vs tags' - it is a classic follow-up trap.
Disclaimer: This blog is independent and not affiliated with or endorsed by Google. Google Cloud features, limits and commands change, so always check the current documentation. Official references: Resource hierarchy, IAM policy types, IAM quotas and limits.