Intermediate Interview Questions

Cloud Run vs GKE vs Compute Engine?

Cloud RunGKECompute Engine
You managecontainer onlyKubernetes objectswhole VM
Scalingautomatic, to zeropods + nodesinstance groups
Best forstateless APIs and jobscomplex microserviceslegacy or special software

Which database would you choose for...?

  • A typical web app with relations: Cloud SQL (PostgreSQL).
  • Global scale with strong consistency: Spanner.
  • Mobile/web app documents with real-time sync: Firestore.
  • Huge time-series/IoT: Bigtable.
  • Analytics over TBs: BigQuery.
  • Caching: Memorystore.

What are Cloud Storage classes?

Standard (hot data), Nearline (30-day minimum, ~monthly access), Coldline (90-day minimum, ~quarterly), Archive (365-day minimum). Colder classes are cheaper to store but cost more to read; lifecycle rules move objects automatically.

How does Pub/Sub work?

Publishers send messages to a topic; each subscription receives every message and delivers it to its subscribers (pull or push). Delivery is at-least-once, so consumers must be idempotent. It decouples services and absorbs traffic spikes.

How do you store and use secrets on GCP?

In Secret Manager: versioned secrets with IAM access control and audit logs, granted to the workload's service account with secretAccessor, and injected into Cloud Run/GKE as env vars or files. Never in code, images or Git.