Skip to content
Bill Liao
Go back

100 Google Cloud Platform interview Questions and Answers

Edit page

100 Most Frequently Asked Google Cloud Platform (GCP) Interview Questions & Answers

Below is a practical GCP interview guide, organized from fundamentals to architecture and scenario-based questions. It is especially useful for Senior Java / Full-Stack / Cloud / Solution Architect interviews.


1. GCP Fundamentals

1. What is Google Cloud Platform (GCP)?

Answer: Google Cloud Platform is Google’s public cloud platform providing infrastructure, platform, data, AI, networking, security, and application services. Major services include Compute Engine, GKE, Cloud Run, Cloud Storage, BigQuery, Cloud SQL, Pub/Sub, and Vertex AI.


2. What are the major GCP service categories?

Answer:


3. What is a GCP Project?

Answer: A project is the fundamental organizational unit for creating and managing GCP resources. It provides:

For example, an organization might have separate projects for development, staging, and production.


4. What is the GCP resource hierarchy?

Answer:

Organization
    │
    ├── Folder
    │     ├── Project
    │     │     ├── Resources
    │     │     └── Services
    │     └── Project
    │
    └── Folder

IAM policies can be inherited down this hierarchy.


5. What is a GCP Region?

Answer: A region is a geographic area containing multiple availability zones.

Examples:

Region: europe-west2
    ├── Zone A
    ├── Zone B
    └── Zone C

Regions are used for geographic placement and regional services.


6. What is a GCP Zone?

Answer: A zone is an isolated deployment area within a region. Compute resources such as VM instances can be deployed across multiple zones to improve availability.


7. Region vs Zone?

Answer:

RegionZone
Geographic areaIsolated location within region
Contains multiple zonesBelongs to a region
Used for regional architectureUsed for workload deployment

For high availability, applications should generally avoid depending on a single zone.


8. What is Google Cloud Console?

Answer: Google Cloud Console is the web-based management interface for creating, configuring, monitoring, and managing GCP resources.


9. What is gcloud?

Answer: gcloud is the command-line interface for managing GCP resources.

Example:

Bash

gcloud compute instances list

It can be used for automation, administration, deployment, and troubleshooting.


10. What is Cloud Shell?

Answer: Cloud Shell is a browser-accessible command-line environment provided by Google Cloud. It includes tools such as:

It is useful when you don’t want to configure a local environment.


2. Compute

11. What is Compute Engine?

Answer: Compute Engine provides configurable virtual machines running on Google’s infrastructure.

You can configure:

It is appropriate when you need significant control over the underlying infrastructure.


12. Compute Engine vs Cloud Run?

Answer:

Compute EngineCloud Run
VM-basedContainer-based
More infrastructure controlServerless
You manage OSGoogle manages infrastructure
Suitable for legacy applicationsExcellent for stateless APIs
Can run arbitrary workloadsContainerized workloads

13. What are Managed Instance Groups?

Answer: A Managed Instance Group (MIG) manages a group of Compute Engine VM instances.

It supports:


14. What is an Instance Template?

Answer: An instance template defines the configuration used to create VM instances.

It can specify:

MIGs commonly use instance templates.


15. What is Compute Engine autoscaling?

Answer: Autoscaling automatically adjusts the number of VM instances according to workload demand.

For example:

Low traffic  → 2 VMs
Medium       → 5 VMs
High traffic → 10 VMs

Autoscaling can use metrics such as CPU utilization.


16. What is a preemptible VM?

Answer: A preemptible VM is a lower-cost VM designed for workloads that can tolerate interruption. Google may reclaim the capacity.

Typical use cases include:

Google Cloud now also provides Spot VMs, which are the newer mechanism for discounted interruptible compute.


17. What is Cloud Run?

Answer: Cloud Run is a fully managed serverless platform for running containers.

You deploy a container:

Container
   ↓
Cloud Run
   ↓
HTTPS endpoint

Google handles infrastructure provisioning and scaling.


18. What are the advantages of Cloud Run?

Answer:

It is particularly useful for stateless HTTP services and APIs.


19. What is Cloud Functions?

Answer: Cloud Functions is a serverless event-driven compute platform.

Example:

Cloud Storage upload
        ↓
Cloud Function
        ↓
Process file

It is useful for small event-driven workloads.


20. Cloud Run vs Cloud Functions?

Answer:

Cloud Functions

Cloud Run


3. Google Kubernetes Engine

21. What is GKE?

Answer: Google Kubernetes Engine (GKE) is Google’s managed Kubernetes service.

It provides Kubernetes clusters for deploying:


22. What is the difference between GKE Autopilot and Standard?

Answer:

GKE Standard

GKE Autopilot


23. What is a Kubernetes Pod?

Answer: A Pod is the smallest deployable unit in Kubernetes.

A Pod can contain one or more containers sharing:


24. What is a Kubernetes Deployment?

Answer: A Deployment manages the desired state of Pods.

For example:

YAML

replicas: 5

Kubernetes attempts to maintain five replicas.

Deployments support rolling updates and rollbacks.


25. What is a Kubernetes Service?

Answer: A Service provides stable networking to a set of Pods.

Common types include:


26. How would you deploy a Spring Boot application to GKE?

Answer:

Typical architecture:

Spring Boot
     ↓
Docker Image
     ↓
Artifact Registry
     ↓
GKE
     ↓
Kubernetes Deployment
     ↓
Service
     ↓
Load Balancer

CI/CD can automate the entire pipeline.


27. How do you scale applications in GKE?

Answer:

At the Pod level:

Horizontal Pod Autoscaler

At the node level:

Cluster Autoscaler

For more advanced workloads:

Vertical Pod Autoscaler

28. What is GKE Ingress?

Answer: GKE Ingress provides HTTP/HTTPS routing into Kubernetes services and can integrate with Google’s external Application Load Balancing infrastructure.


29. How do you secure GKE?

Answer:

Use:


30. What is Workload Identity Federation for GKE?

Answer: It allows Kubernetes workloads to access Google Cloud resources using IAM identities without distributing long-lived service-account keys.

This is significantly safer than storing JSON service-account keys inside containers.


4. Cloud Storage

31. What is Google Cloud Storage?

Answer: Cloud Storage is an object storage service designed to store unstructured data such as:


32. What is a GCS bucket?

Answer: A bucket is a container for objects in Cloud Storage.

Example:

gs://company-documents/
    ├── invoices/
    ├── contracts/
    └── reports/

33. What are Cloud Storage storage classes?

Answer:

Common classes include:

The choice depends primarily on access frequency and retention requirements.


34. What is Cloud Storage lifecycle management?

Answer: Lifecycle rules automatically transition or delete objects.

Example:

Day 0      → Standard
Day 30     → Nearline
Day 90     → Coldline
Day 365    → Delete

This can reduce storage costs and simplify retention management.


35. What is object versioning?

Answer: Cloud Storage Object Versioning preserves older versions of objects when they are replaced or deleted.

It can help recover accidentally overwritten data.


36. How do you secure Cloud Storage?

Answer:

Use:


5. Databases

37. What is Cloud SQL?

Answer: Cloud SQL is Google’s managed relational database service supporting engines such as:

Google manages much of the infrastructure, patching, backups, and availability capabilities.


38. Cloud SQL vs Compute Engine database?

Answer:

Cloud SQL provides:

A self-managed database on Compute Engine gives more control but creates significantly more operational responsibility.


39. What is Cloud Spanner?

Answer: Cloud Spanner is a globally distributed relational database designed for:

It combines relational semantics with distributed scalability.


40. Cloud SQL vs Spanner?

Answer:

Cloud SQL

Spanner


41. What is Firestore?

Answer: Firestore is a serverless NoSQL document database.

Data is organized as:

Collection
   ↓
Document
   ↓
Fields

It is commonly used for web/mobile applications.


42. What is Bigtable?

Answer: Cloud Bigtable is a wide-column NoSQL database designed for very large-scale, low-latency workloads.

Typical use cases include:


43. BigQuery vs Cloud SQL?

Answer:

BigQueryCloud SQL
Data warehouseOLTP database
AnalyticsTransactions
Massive datasetsApplication data
SQL analyticsApplication queries
Columnar architectureRelational database

44. How would you migrate PostgreSQL to GCP?

Answer:

A common approach is:

Existing PostgreSQL
       ↓
Assessment
       ↓
Database Migration Service
       ↓
Cloud SQL PostgreSQL
       ↓
Validation
       ↓
Application cutover

For larger or more complex environments, migration architecture depends on downtime, data volume, compatibility, and target platform.


6. BigQuery

45. What is BigQuery?

Answer: BigQuery is Google’s fully managed, serverless data warehouse designed for large-scale analytical workloads.

It supports SQL and can analyze very large datasets without managing database servers.


46. Why is BigQuery fast?

Answer: BigQuery uses a distributed analytical architecture with:


47. What is BigQuery partitioning?

Answer: Partitioning divides a table into partitions, commonly based on:

Queries can scan only relevant partitions, reducing processing and improving performance.


48. What is BigQuery clustering?

Answer: Clustering organizes table data based on selected columns.

For example:

customer_id
region
product_id

It can improve query performance and reduce the amount of data scanned for suitable queries.


49. How do you optimize BigQuery costs?

Answer:


50. What is BigQuery ML?

Answer: BigQuery ML allows users to create and use certain machine-learning models directly using SQL, reducing the need to move data into a separate ML environment.


7. Networking

51. What is a VPC?

Answer: A Virtual Private Cloud (VPC) provides a logically isolated network for GCP resources.

It includes:


52. What is a subnet?

Answer: A subnet is a regional IP address range within a VPC.

Example:

VPC
 ├── europe-west2 subnet
 ├── europe-west1 subnet
 └── us-central1 subnet

53. What is a firewall rule in GCP?

Answer: Firewall rules control network traffic to and from resources.

Rules can define:


54. What is Cloud Load Balancing?

Answer: Cloud Load Balancing distributes traffic across application instances or backends.

It supports various traffic patterns including:


55. What is Cloud CDN?

Answer: Cloud CDN caches content at Google’s edge locations closer to users.

It can reduce:

It is particularly useful for static and cacheable content.


56. What is Cloud DNS?

Answer: Cloud DNS is Google’s managed DNS service.

It provides authoritative DNS hosting for domains and integrates with Google Cloud networking.


57. What is Cloud NAT?

Answer: Cloud NAT allows private resources without external IP addresses to initiate outbound connections to the internet.

For example:

Private VM
   ↓
Cloud NAT
   ↓
Internet

It does not by itself provide unsolicited inbound connectivity to those VMs.


58. What is VPC Peering?

Answer: VPC Network Peering allows networks to communicate using internal IP addresses.

It is useful for connecting workloads in separate VPC networks.


59. VPC Peering vs Shared VPC?

Answer:

VPC Peering

Shared VPC


60. What is Cloud Interconnect?

Answer: Cloud Interconnect provides dedicated or partner connectivity between on-premises networks and Google Cloud.

It provides more predictable performance than internet-based connectivity.


8. IAM and Security

61. What is IAM?

Answer: Identity and Access Management controls who can access which resources and what actions they can perform.

The basic model is:

Principal
   +
Role
   +
Resource
   =
Permission

62. What is the principle of least privilege?

Answer: Users and services should receive only the permissions they actually need.

For example, instead of:

Project Owner

give a service:

Specific storage read permission

when that’s all it requires.


63. What are IAM roles?

Answer: IAM roles are collections of permissions.

Common categories:

Predefined roles are generally preferred over broad basic roles for production systems.


64. What is a service account?

Answer: A service account is an identity intended for applications, workloads, or automation rather than human users.

Example:

Spring Boot
    ↓
Service Account
    ↓
Cloud Storage

65. What is Secret Manager?

Answer: Secret Manager securely stores sensitive information such as:

Applications can retrieve secrets at runtime rather than embedding them in source code.


66. What is Cloud KMS?

Answer: Cloud Key Management Service allows organizations to create and manage cryptographic keys.

It can be used for:


67. What is VPC Service Controls?

Answer: VPC Service Controls creates security perimeters around supported Google Cloud services to reduce the risk of data exfiltration.

It is particularly useful for sensitive enterprise data.


68. How would you secure a GCP production environment?

Answer:

I would use:

  1. Organization policies
  2. Separate projects/environments
  3. Least-privilege IAM
  4. Workload Identity
  5. Secret Manager
  6. KMS
  7. Private networking
  8. Firewall controls
  9. VPC Service Controls where appropriate
  10. Audit logging
  11. Security monitoring
  12. Vulnerability management
  13. Backup and disaster recovery

9. Messaging and Integration

69. What is Google Cloud Pub/Sub?

Answer: Pub/Sub is a globally distributed messaging service based on the publish-subscribe pattern.

Producer
   ↓
Topic
   ↓
Subscription
   ↓
Consumer

70. Topic vs Subscription?

Answer:

Topic: Where publishers send messages.

Subscription: Represents a consumer’s stream of messages from a topic.

Multiple subscriptions can consume messages independently from the same topic.


71. What is Pub/Sub acknowledgment?

Answer: A consumer acknowledges a message after successfully processing it.

If it isn’t acknowledged within the relevant acknowledgment window, Pub/Sub can redeliver it.

Therefore, consumers should generally be designed to be idempotent.


72. How would you implement asynchronous communication between microservices?

Answer:

Order Service
     ↓
Pub/Sub Topic
     ↓
Subscription
     ↓
Payment Service

This reduces coupling and allows services to process messages asynchronously.


73. Pub/Sub vs Kafka?

Answer:

Pub/Sub

Kafka

The choice depends on ordering, replay, ecosystem, operational requirements, throughput, and existing platform standards.


10. Data Engineering

74. What is Dataflow?

Answer: Google Cloud Dataflow is a managed service for batch and stream processing based on Apache Beam.

Example:

Pub/Sub
   ↓
Dataflow
   ↓
BigQuery

75. Batch vs streaming processing?

Answer:

Batch:

Large dataset
     ↓
Periodic processing

Streaming:

Events
  ↓
Continuous processing

Streaming is useful for real-time analytics and event processing.


76. What is Dataproc?

Answer: Dataproc is a managed service for running open-source data processing frameworks such as:

It is useful when you need compatibility with those ecosystems.


77. Dataflow vs Dataproc?

Answer:

Dataflow

Dataproc


11. DevOps and CI/CD

78. What is Cloud Build?

Answer: Cloud Build is Google’s managed CI/CD build service.

A typical pipeline might be:

Git
 ↓
Cloud Build
 ↓
Test
 ↓
Build
 ↓
Container Image
 ↓
Artifact Registry
 ↓
GKE / Cloud Run

79. What is Artifact Registry?

Answer: Artifact Registry stores software artifacts such as:

For Java applications, Maven artifacts can be stored in Artifact Registry.


80. How would you build a CI/CD pipeline for Spring Boot on GCP?

Answer:

Git Push
   ↓
Cloud Build
   ↓
Maven Test
   ↓
Security Scan
   ↓
Docker Build
   ↓
Artifact Registry
   ↓
Deploy to GKE/Cloud Run
   ↓
Smoke Tests

For production, I would also include approval gates, automated rollback, observability, and deployment strategies such as canary or blue/green where appropriate.


81. What is Infrastructure as Code?

Answer: Infrastructure as Code defines infrastructure using declarative configuration.

Terraform is commonly used with GCP.

Example:

Terraform
    ↓
VPC
    ↓
GKE
    ↓
Cloud SQL
    ↓
IAM

This provides repeatability and version control.


82. Why use Terraform with GCP?

Answer:

Terraform provides:


12. Monitoring and Operations

83. What is Cloud Monitoring?

Answer: Cloud Monitoring collects and visualizes metrics from infrastructure and applications.

Examples:


84. What is Cloud Logging?

Answer: Cloud Logging collects and manages logs from GCP resources and applications.

Applications can write structured logs that can then be searched, analyzed, and routed.


85. What is Cloud Trace?

Answer: Cloud Trace helps analyze request latency and distributed application performance.

For microservices, tracing can show:

API Gateway
   ↓ 20ms
Service A
   ↓ 100ms
Service B
   ↓ 500ms
Database

This helps identify bottlenecks.


86. What is Cloud Profiler?

Answer: Cloud Profiler helps identify performance issues in applications by analyzing resource consumption such as CPU and memory.


87. What is Error Reporting?

Answer: Error Reporting aggregates and analyzes application errors and exceptions.

It helps developers identify recurring application failures.


88. What metrics would you monitor for a production API?

Answer:

I would monitor:

For microservices, I’d also monitor distributed traces and service-level indicators.


13. Architecture and System Design

89. How would you design a highly available application on GCP?

Answer:

A typical architecture:

                    Internet
                       │
                Cloud Load Balancer
                       │
             ┌─────────┴─────────┐
             │                   │
          GKE/Run             GKE/Run
             │                   │
             └─────────┬─────────┘
                       │
                    Pub/Sub
                       │
                 Data Services
                       │
              Cloud SQL/Spanner

Key principles:


90. How would you design a scalable microservices architecture on GCP?

Answer:

I would typically use:

                  Load Balancer
                       ↓
                 API Gateway
                       ↓
              ┌───────────────┐
              │ Microservices │
              └───────────────┘
                 ↓         ↓
              Pub/Sub    Databases
                 ↓
              Dataflow
                 ↓
              BigQuery

Services could run on GKE or Cloud Run depending on operational and workload requirements.


91. How would you design a serverless architecture?

Answer:

Client
  ↓
API Gateway
  ↓
Cloud Run
  ↓
Firestore / Cloud SQL
  ↓
Pub/Sub
  ↓
Cloud Run / Functions

Cloud Storage can be used for object storage, while Cloud Monitoring and Logging provide observability.


92. How would you design a highly scalable file-processing system?

Answer:

User
 ↓
Cloud Storage
 ↓
Event
 ↓
Pub/Sub
 ↓
Cloud Run / Dataflow
 ↓
Processing
 ↓
Cloud Storage
 ↓
BigQuery

This architecture decouples file ingestion from processing and allows workers to scale independently.


93. How would you design a real-time analytics platform?

Answer:

Applications
     ↓
Pub/Sub
     ↓
Dataflow
     ↓
BigQuery
     ↓
BI / Analytics

For high-volume environments, partitioning and clustering should be considered carefully in BigQuery.


94. How would you design disaster recovery on GCP?

Answer:

I would first define:

Then implement appropriate mechanisms such as:

The architecture should be driven by business RTO/RPO rather than simply choosing “multi-region” everywhere.


14. Advanced Scenario Questions

95. Your GCP application suddenly has 10× traffic. What do you do?

Answer:

First, I would determine whether the bottleneck is:

Then:

  1. Check monitoring and traces.
  2. Verify autoscaling.
  3. Check load balancer health.
  4. Check database connections and latency.
  5. Scale stateless services.
  6. Introduce or increase asynchronous processing.
  7. Cache frequently accessed data.
  8. Protect downstream systems with rate limiting/circuit breakers.
  9. Review capacity and quotas.
  10. Continue monitoring after stabilization.

96. A GKE application has intermittent latency spikes. How would you troubleshoot it?

Answer:

I would investigate from the outside in:

Load Balancer
     ↓
Ingress
     ↓
Service
     ↓
Pod
     ↓
Application
     ↓
Database

I would examine:

For a Java application, I would also inspect JVM heap, GC pauses, thread contention, and connection-pool saturation.


97. Your Cloud SQL database becomes the bottleneck. What would you do?

Answer:

I would first identify whether the problem is:

Then consider:


98. How would you secure secrets in a Spring Boot application running on GCP?

Answer:

I would avoid putting credentials in:

application.properties
Git
Docker images
Kubernetes manifests

Instead:

Spring Boot
     ↓
Workload Identity
     ↓
Secret Manager
     ↓
Secret

The application retrieves secrets securely at runtime.

I would also use least-privilege IAM and audit access to sensitive secrets.


99. How would you migrate a monolithic Java application to GCP?

Answer:

I would avoid blindly rewriting the entire application.

A pragmatic approach is:

Phase 1 — Assessment

Identify:

Phase 2 — Containerization

Package the existing Spring Boot application into a container.

Phase 3 — Deploy

Initially deploy to:

Cloud Run or GKE

Phase 4 — Modernize

Gradually extract suitable bounded contexts into microservices.

Phase 5 — Decouple

Introduce:

Pub/Sub
API Gateway
Caching
Managed databases

Phase 6 — Optimize

Add:

This reduces migration risk compared with a big-bang rewrite.


100. Design an enterprise-grade GCP architecture for a Java microservices platform.

Answer:

A strong architecture could look like:

                         Users
                           │
                           ▼
                  Cloud Load Balancer
                           │
                           ▼
                     API Gateway
                           │
             ┌─────────────┴─────────────┐
             │                           │
             ▼                           ▼
        GKE / Cloud Run             Static Web
             │
     ┌───────┼────────┐
     │       │        │
     ▼       ▼        ▼
 Service A Service B Service C
     │       │        │
     └───────┼────────┘
             ▼
          Pub/Sub
             │
       ┌─────┴─────┐
       ▼           ▼
   Dataflow     Event Consumers
       │
       ▼
    BigQuery

Databases:
Cloud SQL / Spanner / Firestore / Bigtable

Security:
IAM + Workload Identity + Secret Manager + KMS

Observability:
Cloud Monitoring + Logging + Trace

CI/CD:
Git → Cloud Build → Artifact Registry → GKE/Cloud Run

Infrastructure:
Terraform

Key architectural principles

1. Stateless services Make application services horizontally scalable.

2. Asynchronous communication Use Pub/Sub where synchronous communication would create excessive coupling.

3. Managed services Prefer managed GCP services when they reduce operational complexity.

4. Zero-trust security Use IAM, workload identities, private networking, and least privilege.

5. Observability by design Implement metrics, structured logs, traces, and meaningful alerts from the beginning.

6. Infrastructure as Code Use Terraform to make environments reproducible.

7. Resilience Use timeouts, retries with backoff, circuit breakers, idempotency, health checks, and graceful degradation.

8. Cost awareness Design for appropriate autoscaling, storage lifecycle policies, BigQuery optimization, and workload-specific compute choices.


Edit page
Share this post:

Previous Post
100 Kafka interview Questions and Answers
Next Post
100 Angular interview Questions and Answers