Careeroza
Advanced Interview Questions
Design a highly available web app on GCP.
- Global external Application Load Balancer with managed TLS, Cloud Armor and Cloud CDN for static assets.
- Cloud Run services (or GKE) in two regions behind the load balancer.
- Cloud SQL with regional HA (standby in another zone), automated backups and point-in-time recovery; cross-region read replica for DR.
- Memorystore for caching and sessions.
- Pub/Sub for asynchronous work, Cloud Storage for media.
- Monitoring dashboards, SLO-based alerts, structured logs and tracing.
How do you deploy safely to Cloud Run?
- CI builds an immutable image tagged with the commit SHA.
- Deploy with
--no-traffic --tag canary, run smoke tests on the tagged URL. - Shift traffic gradually (10% → 50% → 100%) while watching error rate and latency.
- Roll back instantly by routing traffic to the previous revision.
How do you reduce GCP costs?
- Budgets and alerts; billing export to BigQuery with labels.
- Delete idle resources; scale to zero with serverless.
- Right-size with Recommender; committed use discounts and Spot VMs.
- Storage lifecycle rules; reduce egress with CDN and region choice.
- BigQuery: partition/cluster tables and avoid SELECT *.
What is Workload Identity Federation?
A way for external workloads (GitHub Actions, AWS, Azure, on-prem) to get short-lived Google credentials by exchanging their own identity tokens, so you never create or store service account keys.
Why use Terraform instead of the console?
Infrastructure as code is repeatable across environments, reviewed in pull requests (terraform plan), versioned in Git, and recoverable. Remote state in a GCS bucket with locking lets a team work safely together.