Cloud Engineer Associate Cloud Engineer v1.0 4 — Questions and Answers
Question 1: Your GKE pods are being evicted frequently because nodes run out of memory. What should you configure to prevent this?
- Set resource requests and limits in pod specs (Correct answer)
- Increase the number of nodes in the cluster
- Enable Cluster Autoscaler
- Switch to Autopilot mode
Correct answer: Set resource requests and limits in pod specs
Setting memory requests and limits ensures the scheduler places pods on nodes with sufficient capacity and prevents individual pods from consuming all memory.
Question 2: You need to store application secrets like API keys and database passwords securely and access them from Cloud Run. What is the recommended approach?
- Store secrets in Secret Manager and mount them as environment variables or volumes in Cloud Run (Correct answer)
- Hardcode secrets in the container image environment variables
- Store secrets in a Cloud Storage bucket with restricted IAM
- Pass secrets via Cloud Run request headers at deploy time
Correct answer: Store secrets in Secret Manager and mount them as environment variables or volumes in Cloud Run
Secret Manager is GCP's dedicated secrets store and Cloud Run natively integrates with it via environment variable or volume mounts.
Question 3: Which metric should you monitor to detect that a Cloud SQL instance is becoming a bottleneck due to connection exhaustion?
- database/postgresql/num_backends (Correct answer)
- database/cpu/utilization
- database/disk/bytes_used
- database/memory/usage
Correct answer: database/postgresql/num_backends
num_backends tracks the number of active database connections, and exhaustion of the connection limit causes new connections to be refused.
Question 4: A Cloud Run service receives a burst of 10,000 requests per second. What happens if you have not set a maximum instance limit?
- Cloud Run scales out to as many instances as needed to handle the requests (Correct answer)
- Cloud Run queues requests up to 1,000 and returns 429 for the rest
- Cloud Run limits concurrency to 80 requests per instance regardless
- Cloud Run autoscaling is capped at 1,000 instances by default
Correct answer: Cloud Run scales out to as many instances as needed to handle the requests
Without a maximum instance limit, Cloud Run scales out horizontally to handle demand, subject to project quota limits.
Question 5: You need to create a custom VPC with specific subnets and firewall rules using Infrastructure as Code. Which tool is natively supported by Google Cloud?
- Terraform
- Cloud Deployment Manager (Correct answer)
- Ansible
- Pulumi
Correct answer: Cloud Deployment Manager
Cloud Deployment Manager is Google Cloud's native IaC service using YAML/Jinja2/Python templates, though Terraform is also widely used.
Question 6: You need to expose a GKE service to the internet with a stable external IP address. Which Kubernetes service type should you use?
- LoadBalancer (Correct answer)
- NodePort
- ClusterIP
- ExternalName
Correct answer: LoadBalancer
A LoadBalancer service type provisions a Google Cloud external load balancer with a stable external IP for internet-facing traffic.
Question 7: Your Cloud Storage bucket contains objects that must be retained for 7 years for compliance. Which feature enforces this?
- Retention policy with a 7-year retention period (Correct answer)
- Object versioning
- Lifecycle rule to delete after 7 years
- Bucket lock
Correct answer: Retention policy with a 7-year retention period
A retention policy prevents objects from being deleted or overwritten until the specified retention period has elapsed.
Your GKE pods are being evicted frequently because nodes run out of memory.
What should you configure to prevent this?