Google Cloud Platform interview questions

25 questions from the Google Cloud Platform course, each with the correct answer and an explanation. Try to answer before you open the answer.

Google Cloud Foundations

1. Which of these is a global resource in Google Cloud?

  1. A VPC network
  2. A Compute Engine VM
  3. A zonal persistent disk
  4. A single zone
Show answer

Answer: A VPC network

VPC networks are global; their subnets are regional and VMs are zonal.

Lesson: Regions, Zones and the Global Network

2. Where do you enable an API such as Cloud Run and attach a billing account?

  1. On a label
  2. On a zone
  3. On a VPC subnet
  4. On the project
Show answer

Answer: On the project

Projects are the unit for enabled APIs, quotas and billing linkage.

Lesson: Organization, Folders, Projects and Billing

3. What do client libraries running on Cloud Run use to authenticate by default?

  1. A JSON key file checked into the repository
  2. The developer's personal password
  3. Application Default Credentials from the attached service account
  4. The billing account ID
Show answer

Answer: Application Default Credentials from the attached service account

ADC picks up the service account attached to the Cloud Run service, so no key file is needed.

Lesson: Console, gcloud, Cloud Shell and Infrastructure as Code

Identity and Access Management

4. Which role type should normally be avoided for production workloads because it is too broad?

  1. Predefined roles
  2. Custom roles
  3. Basic roles such as Editor
  4. Conditional bindings
Show answer

Answer: Basic roles such as Editor

Basic roles span almost every service in the project; predefined roles are scoped to one service.

Lesson: How IAM Works

5. What is the safest way for a Cloud Run service to call other Google Cloud APIs?

  1. Embed a service account JSON key in the image
  2. Attach a dedicated service account with narrowly scoped roles
  3. Use the project Owner's personal credentials
  4. Make the target API public
Show answer

Answer: Attach a dedicated service account with narrowly scoped roles

An attached, dedicated service account gets short-lived tokens automatically and limits the blast radius.

Lesson: Service Accounts

6. What does Workload Identity Federation remove the need for?

  1. Long-lived service account keys for external workloads
  2. IAM roles
  3. Projects
  4. Audit logs
Show answer

Answer: Long-lived service account keys for external workloads

External tokens are exchanged for short-lived Google credentials, so no key file is stored.

Lesson: Workload Identity Federation

Compute Choices

7. What does a managed instance group do when a VM fails its health check?

  1. Recreates the VM from the instance template
  2. Sends an email and waits
  3. Deletes the whole group
  4. Converts it to a Spot VM
Show answer

Answer: Recreates the VM from the instance template

Autohealing recreates unhealthy instances from the template.

Lesson: Compute Engine and Managed Instance Groups

8. A Cloud Run service has noticeable cold starts after quiet periods. What is the simplest fix?

  1. Lower concurrency to 1
  2. Switch to a zonal disk
  3. Make the service public
  4. Set minimum instances to 1 or more
Show answer

Answer: Set minimum instances to 1 or more

Minimum instances keep warm containers ready, at the cost of paying for them while idle.

Lesson: Cloud Run

9. In GKE Autopilot, what are you primarily billed for?

  1. The control plane only
  2. Each kubectl command
  3. The resources your pods request
  4. Node pools you create manually
Show answer

Answer: The resources your pods request

Autopilot manages nodes and bills by pod resource requests.

Lesson: Google Kubernetes Engine and App Engine

Events, Messaging and Serverless Integration

10. Why must event-triggered functions be idempotent?

  1. Because they are always public
  2. Because Eventarc deletes duplicates
  3. Because events can be delivered more than once when retries happen
  4. Because functions cannot write to databases
Show answer

Answer: Because events can be delivered more than once when retries happen

At-least-once delivery and retries mean the same event may arrive twice.

Lesson: Cloud Run Functions and Eventarc

11. Two independent services must each receive every order event. How do you configure Pub/Sub?

  1. One topic with one shared subscription
  2. One topic with a separate subscription per service
  3. Two topics with no subscriptions
  4. One subscription with an ordering key
Show answer

Answer: One topic with a separate subscription per service

Each subscription gets every message; services sharing one subscription would split the messages.

Lesson: Pub/Sub

12. You must call a partner API for each signup but never exceed 5 calls per second. Which service fits best?

  1. Cloud Tasks
  2. Cloud Scheduler
  3. Pub/Sub with many subscriptions
  4. Cloud Storage
Show answer

Answer: Cloud Tasks

Cloud Tasks queues individual tasks to an endpoint with configurable dispatch rate limits.

Lesson: Cloud Tasks, Cloud Scheduler and Workflows

Storage and Databases

13. How quickly can you read an object stored in the Archive class?

  1. Within milliseconds, at a higher per-read cost
  2. After a restore job that takes hours
  3. Only after copying it to Standard manually
  4. Never; Archive is write-only
Show answer

Answer: Within milliseconds, at a higher per-read cost

All Cloud Storage classes offer millisecond access; colder classes cost more per read and have minimum durations.

Lesson: Cloud Storage

14. Which option gives Cloud SQL automatic failover to another zone?

  1. A read replica in the same zone
  2. Larger storage
  3. Public IP
  4. Availability type REGIONAL (high availability)
Show answer

Answer: Availability type REGIONAL (high availability)

A regional (HA) instance keeps a standby in another zone and fails over automatically.

Lesson: Cloud SQL, AlloyDB and Spanner

15. Which service suits petabyte-scale time-series data read by key ranges?

  1. Firestore
  2. Memorystore
  3. Bigtable
  4. Cloud Tasks
Show answer

Answer: Bigtable

Bigtable is designed for huge, high-throughput workloads organised around sorted row keys.

Lesson: Firestore, Bigtable and Memorystore

BigQuery and Data Processing

16. Which change reduces bytes scanned by an on-demand BigQuery query on a large unpartitioned table?

  1. Adding LIMIT 10
  2. Ordering the results
  3. Selecting only the needed columns instead of SELECT *
  4. Running it twice
Show answer

Answer: Selecting only the needed columns instead of SELECT *

BigQuery is columnar; fewer columns means fewer bytes read. LIMIT does not reduce the scan.

Lesson: BigQuery Essentials

17. You have existing Spark jobs to move to Google Cloud with minimal rewriting. Which service fits?

  1. Dataflow
  2. Dataproc
  3. Cloud Tasks
  4. Firestore
Show answer

Answer: Dataproc

Dataproc runs managed Spark and Hadoop, so existing Spark code moves with little change.

Lesson: Dataflow, Dataproc and Pipelines

18. An analyst wants to train a simple model without moving data out of the warehouse. What should they use?

  1. BigQuery ML
  2. Cloud Tasks
  3. Memorystore
  4. Cloud NAT
Show answer

Answer: BigQuery ML

BigQuery ML trains and runs models with SQL inside BigQuery.

Lesson: Vertex AI and BigQuery ML

Networking

19. VMs in `asia-south1` and `europe-west1` subnets of the same VPC need to talk privately. What extra setup is required?

  1. Nothing beyond firewall rules, because the VPC is global
  2. VPC peering between regions
  3. A VPN tunnel
  4. A second VPC
Show answer

Answer: Nothing beyond firewall rules, because the VPC is global

Subnets of one global VPC route to each other internally; you only need firewall rules allowing the traffic.

Lesson: VPC Networks, Subnets and Firewall Rules

20. Which load balancer gives a single global anycast IP for HTTPS traffic routed by URL path?

  1. Passthrough network load balancer
  2. Internal TCP load balancer
  3. Cloud NAT
  4. Global external Application Load Balancer
Show answer

Answer: Global external Application Load Balancer

The global external Application Load Balancer is layer 7, global and anycast.

Lesson: Cloud Load Balancing, Cloud CDN and Cloud Armor

21. VPC A peers with B, and B peers with C. Can A reach C through B?

  1. Yes, peering is transitive
  2. Only for Cloud Run
  3. No, VPC peering is not transitive
  4. Only if all are auto-mode networks
Show answer

Answer: No, VPC peering is not transitive

VPC Network Peering is non-transitive; A needs its own peering or another connectivity design.

Lesson: Private Connectivity and DNS

Operations, Security, Cost and Revision

22. Which service records who changed an IAM policy and when?

  1. Cloud Profiler
  2. Cloud CDN
  3. Cloud Audit Logs
  4. Memorystore
Show answer

Answer: Cloud Audit Logs

Admin Activity audit logs record configuration changes such as IAM policy updates.

Lesson: Delivery and Observability

23. Which control restricts where resources can be created, for example only in Indian regions?

  1. A Cloud Armor rule
  2. An organization policy on resource locations
  3. A BigQuery partition
  4. A Pub/Sub ordering key
Show answer

Answer: An organization policy on resource locations

The resource-locations organization policy constraint limits allowed regions across the hierarchy.

Lesson: Secret Manager, Organization Policies and Security Command Center

24. Which discount applies automatically, with no commitment, to eligible Compute Engine VMs that run most of the month?

  1. Sustained use discount
  2. Committed use discount
  3. Spot pricing
  4. Free tier
Show answer

Answer: Sustained use discount

Sustained use discounts are applied automatically to eligible machine series based on monthly usage.

Lesson: Cost Management and Discounts

25. A BigQuery query uses SELECT * with LIMIT 10 on a 2 TB unpartitioned table. Roughly how much data does an on-demand query scan?

  1. Only 10 rows
  2. Nothing, because results are cached by default
  3. Exactly 10 MB
  4. About the full size of the referenced columns, close to 2 TB
Show answer

Answer: About the full size of the referenced columns, close to 2 TB

LIMIT does not reduce bytes scanned for such queries; SELECT * reads every column of the table.

Lesson: Google Cloud Revision and Interview Questions

← Back to the course