Google Cloud (GCP) interview questions and answers
Google Cloud (GCP) interview questions check that you understand how projects, IAM and service accounts control access, how Google's global VPC differs from other clouds' networks, and when to use Cloud Run, GKE or Compute Engine, Cloud SQL, Spanner or BigQuery. Data roles get more BigQuery and Pub/Sub depth; platform roles get more networking and IAM. Interviewers reward answers that explain the trade-off behind a service choice and the cost it brings.
By Evin JohnPublished 7 min read
Where GCP knowledge gets tested
Google Cloud is common at data-heavy companies, startups that began on its credits, and teams using BigQuery or GKE, so GCP questions come up for data engineers, analytics engineers, ML engineers, cloud and platform engineers and backend developers. A data engineer might spend most of the round on BigQuery table design, Pub/Sub and Dataflow. A platform engineer is more likely to face Shared VPC, organization policies and GKE. Interviewers often ask how GCP compares with another cloud you have used; it is fine to say where your experience comes from, as long as you can map the concepts.
Projects, IAM and service accounts
| Question | What it tests | What a strong answer shows |
|---|---|---|
| How are GCP resources organized? | Hierarchy | An organization node at the top, folders for departments or environments, projects underneath, and resources inside projects. Billing, APIs, quotas and most IAM are managed per project. |
| How is IAM inherited? | Policy model | An allow policy on the organization or a folder applies to everything beneath it, and policies are additive: a grant higher up cannot be removed lower down. Deny policies exist for explicit exceptions. |
| Basic, predefined and custom roles? | Least privilege | Basic roles (Owner, Editor, Viewer) are broad and best avoided in production. Predefined roles cover one service's tasks. Custom roles bundle exact permissions when nothing predefined fits. |
| What is a service account? | Workload identity | An identity for code rather than a person. Attach it to a VM, Cloud Run service or GKE workload, and the code gets short-lived credentials from the metadata server. |
| Why avoid service account keys? | Security | A downloaded JSON key is a long-lived credential that leaks through repositories and laptops. Prefer attached service accounts, impersonation for humans, and Workload Identity Federation for systems outside Google Cloud such as CI runners. |
| What are organization policies? | Guardrails | Constraints set at the organization or folder, such as allowed regions, no external IPs on VMs or no service account key creation. They limit configuration; IAM limits who acts. |
| What does a principal look like in a binding? | Syntax | A prefix plus an identifier: user:, group:, serviceAccount: or domain:. Granting to groups keeps policies short and joiners and leavers easy. |
| How do you audit who changed what? | Audit logs | Cloud Audit Logs: Admin Activity logs are always on; Data Access logs record reads and writes of data and are enabled per service. |
gcloud iam service-accounts create orders-api --display-name="Orders API"
gcloud projects add-iam-policy-binding my-project \
--member="serviceAccount:orders-api@my-project.iam.gserviceaccount.com" \
--role="roles/cloudsql.client"
gcloud secrets add-iam-policy-binding db-password \
--member="serviceAccount:orders-api@my-project.iam.gserviceaccount.com" \
--role="roles/secretmanager.secretAccessor"
gcloud run deploy orders-api \
--image=europe-west1-docker.pkg.dev/my-project/apps/orders-api:1.4.0 \
--region=europe-west1 \
--service-account=orders-api@my-project.iam.gserviceaccount.com \
--no-allow-unauthenticatedVPC and networking questions
- How is a GCP VPC different from a VPC elsewhere? A VPC network is global: one network can hold subnets in many regions, and instances in different regions talk over Google's backbone without extra peering. Subnets are regional.
- How do firewall rules target instances? Rules apply to the whole network and select targets by network tag or service account, with priorities deciding which rule wins. Hierarchical firewall policies set rules at the organization or folder level.
- What is Shared VPC? A host project owns the network and service projects deploy into its subnets. A central network team controls routes, firewalls and connectivity while application teams keep their own projects.
- Shared VPC versus VPC peering? Shared VPC is for one organization centralizing a network. Peering connects two separate networks privately; it is not transitive, and the address ranges must not overlap.
- How do private VMs reach the internet and Google APIs? Cloud NAT for outbound internet without external IPs. Private Google Access lets them call Google APIs from internal addresses.
- What is Private Service Connect? A way to reach Google APIs or a producer's service through an internal IP in your own VPC, so traffic and access stay private.
- Which load balancer would you choose? The global external Application Load Balancer for HTTP(S) users worldwide behind one anycast IP, with Cloud CDN and Cloud Armor if needed. Regional or internal load balancers for traffic that stays in one region or inside the VPC, and network load balancers for TCP or UDP.
- How do you connect an office or datacenter? Cloud VPN (encrypted tunnels over the internet) to start, Cloud Interconnect for dedicated, higher-throughput links, with Cloud Router exchanging routes dynamically.
Compute and storage choices
| Question | What it tests | What a strong answer shows |
|---|---|---|
| Cloud Run, GKE or Compute Engine? | Compute choice | Cloud Run runs stateless containers per request with scale to zero and almost no platform work. GKE suits many services needing Kubernetes features. Compute Engine gives full VMs for legacy software, special OS needs or steady heavy load. |
| GKE Standard versus Autopilot? | Operations | In Standard you manage node pools and pay for nodes. In Autopilot Google manages the nodes and billing mostly follows the resources your pods request, with some restrictions on what pods may do. |
| What does a managed instance group give you? | Scaling | Identical VMs from an instance template, with autoscaling, autohealing from health checks, rolling updates and spread across zones. |
| What are Spot VMs? | Cost | Spare capacity at a discount that Google can reclaim at short notice. Good for batch jobs and fault-tolerant workers, wrong for a single database. |
| Which Cloud Storage class fits which data? | Storage | Standard for frequently read data, Nearline, Coldline and Archive for progressively rarer access with minimum storage durations and retrieval fees. Lifecycle rules move objects as they age. |
| Region, dual-region or multi-region bucket? | Availability | A regional bucket keeps data close to compute in one region. Dual-region and multi-region keep copies apart for availability, at a higher price. |
| How do you give a user temporary access to one private object? | Access | A signed URL that expires, rather than making the bucket public. Uniform bucket-level access keeps permissions in IAM instead of per-object ACLs. |
Databases, BigQuery and messaging
- Cloud SQL, AlloyDB, Spanner, Firestore or Bigtable? Cloud SQL for managed MySQL, PostgreSQL or SQL Server at ordinary scale. AlloyDB for PostgreSQL-compatible workloads needing more performance. Spanner for relational data that must scale horizontally with strong consistency, even across regions. Firestore for document data in mobile and web apps. Bigtable for very large, low-latency key lookups such as time series.
- How does BigQuery differ from a regular database? It is a serverless, columnar analytics warehouse that separates storage from compute. It is built for scanning large tables, not for many small row updates.
- How do you keep BigQuery queries fast and cheap? Partition tables (usually by date) and cluster by common filter columns, select only the columns you need, filter on the partition column, and set a maximum bytes billed on risky queries. Under on-demand pricing you pay for bytes scanned; capacity pricing reserves compute instead.
- Partitioning versus clustering? Partitioning splits a table into segments a query can skip entirely. Clustering sorts data within partitions by chosen columns, so filters on them read fewer blocks.
- What delivery guarantee does Pub/Sub give? At-least-once by default, so subscribers must handle duplicates. Ordering keys keep messages for one key in order, and dead-letter topics catch messages that keep failing.
- Dataflow, Dataproc or Composer? Dataflow runs Apache Beam pipelines for batch and streaming without managing clusters. Dataproc runs Spark and Hadoop clusters when you already have that code. Composer is managed Airflow for scheduling and orchestrating the jobs.
CREATE TABLE analytics.events
PARTITION BY DATE(event_ts)
CLUSTER BY customer_id AS
SELECT event_ts, customer_id, event_name
FROM analytics.events_raw;
SELECT event_name, COUNT(*) AS occurrences
FROM analytics.events
WHERE DATE(event_ts) BETWEEN '2026-11-01' AND '2026-11-07'
AND customer_id = 'cus_42'
GROUP BY event_name
ORDER BY occurrences DESC;Operations, cost and senior scenarios
| Question or scenario | Where to start | What a strong answer adds |
|---|---|---|
| Cloud Run returns 403 to callers after you remove public access. | Callers now need the Cloud Run Invoker role and an identity token for the service URL. | Explains service-to-service calls with the caller's service account, and keeping public access off for internal services. |
| A GKE pod gets permission denied calling Cloud Storage. | Which identity the pod really uses: Workload Identity mapping from the Kubernetes service account to an IAM principal. | Avoids the node's default service account and mounted keys; grants a narrow role at bucket level. |
| The BigQuery bill jumped. | Job history in INFORMATION_SCHEMA by user and bytes processed. | Finds unpartitioned scans or a dashboard refreshing a wide query, then adds partition filters, quotas or reservations. |
| How do you track spend by team? | Labels on resources, billing export to BigQuery, budgets with alerts per project. | Mentions committed use discounts for steady load and sustained use discounts that apply automatically to some VM types. |
| How do you observe a service on GCP? | Cloud Logging, Cloud Monitoring, Trace and Error Reporting. | Defines SLOs in Monitoring, routes logs through sinks for retention and analysis, and alerts on symptoms users feel. |
| Design for a regional failure. | Which data is regional and which is not. | Uses multi-zone or multi-region data stores, a global load balancer in front of regional backends, and practices failover. |
Fictional example
- Interviewer
- Our mobile app emits events. Product wants a dashboard of daily active users and funnels, refreshed within a few minutes. Design it on GCP.
- Candidate
- I would have the app's backend publish events to a Pub/Sub topic, since it absorbs bursts and lets other consumers subscribe later. A Dataflow streaming job reads the subscription, validates and deduplicates by event ID, because Pub/Sub can deliver twice, and writes into a BigQuery table partitioned by event date and clustered by user ID and event name. Bad records go to a dead-letter table so the pipeline keeps running. The dashboard queries small aggregate tables that a scheduled query or materialized view keeps up to date, so each refresh does not rescan raw events. Each component runs as its own service account with narrow roles: the Dataflow worker can write to the dataset, the dashboard can only read the aggregates. I would set a budget alert on the project and a maximum bytes billed on ad hoc queries, and watch Pub/Sub backlog age as the main health signal.
A two-week GCP practice plan
- Set up a sandbox properlyCreate a project with a budget alert first, then a service account, and grant it one predefined role. Try an action it should not be allowed and read the error.
- Deploy something smallPut a container on Cloud Run with its own service account, private access only, and call it from another service with an identity token.
- Build the networkOne VPC with subnets in two regions, firewall rules by service account, Cloud NAT for a private VM, and Private Google Access to reach Cloud Storage.
- Work with BigQueryLoad a public dataset into a partitioned, clustered table and compare the bytes processed with and without a partition filter.
- Rehearse comparisons aloudCloud Run versus GKE, Spanner versus Cloud SQL, Pub/Sub versus a database queue: one minute each, with the trade-off and the cost.
For other platforms and adjacent rounds, see Azure interview questions for Microsoft's cloud, data engineer interview questions for pipeline and warehouse depth, and Linux interview questions for the VMs and containers underneath.
Service comparisons are where GCP answers usually lose points, because it is easy to name the service and forget the trade-off. In practice, Natively, an AI interview assistant for Mac and Windows, transcribes your mock design round so you can review whether each choice came with a reason and a cost. It can read a screenshot of a console error or a query plan while you practice and point to what to check, and with Pro or the free trial it can use the résumé and job description you add. Practice transcripts and notes stay saved for review.
Questions people ask
What GCP questions are asked in interviews?
How organizations, folders and projects work, IAM roles and service accounts, the global VPC and firewall rules, Cloud Run versus GKE versus Compute Engine, storage classes, Cloud SQL versus Spanner, BigQuery design and cost, and Pub/Sub.
What is a service account in Google Cloud?
An identity for workloads rather than people. Attach it to the VM, Cloud Run service or GKE workload so code gets short-lived credentials, and avoid downloading long-lived JSON keys.
How do you reduce BigQuery costs?
Partition and cluster tables, select only needed columns, filter on the partition column, set a maximum bytes billed on ad hoc queries, and consider capacity pricing for steady heavy use.
Is a GCP VPC regional or global?
A VPC network is global and its subnets are regional, so instances in different regions on the same network can talk privately without peering.
Where to go next
Practice with the same assistant you would use on a call: it listens, transcribes and suggests answers from your own resume and the job description.
Facts on this page were last checked on . Product details come from the Natively app itself; if something here is out of date, tell us at hello@heynatively.com.
