Google Professional Cloud Developer Exam Practice Questions (P. 2)
- Full Access (361 questions)
- Six months of Premium Access
- Access to one million comments
- Seamless ChatGPT Integration
- Ability to download PDF files
- Anki Flashcard files for revision
- No Captcha & No AdSense
- Advanced Exam Configuration
Question #11
You need to migrate an internal file upload API with an enforced 500-MB file size limit to App Engine.
What should you do?
What should you do?
- AUse FTP to upload files.
- BUse CPanel to upload files.
- CUse signed URLs to upload files.Most Voted
- DChange the API to be a multipart file upload API.
Correct Answer:
C
Reference:
https://wiki.christophchamp.com/index.php?title=Google_Cloud_Platform
C
Reference:
https://wiki.christophchamp.com/index.php?title=Google_Cloud_Platform
send
light_mode
delete
Question #12
You are planning to deploy your application in a Google Kubernetes Engine (GKE) cluster. The application exposes an HTTP-based health check at /healthz. You want to use this health check endpoint to determine whether traffic should be routed to the pod by the load balancer.
Which code snippet should you include in your Pod configuration?
A.

B.

C.

D.

Which code snippet should you include in your Pod configuration?
A.

B.

C.

D.

Correct Answer:
B
For the GKE ingress controller to use your readinessProbes as health checks, the Pods for an Ingress must exist at the time of Ingress creation. If your replicas are scaled to 0, the default health check will apply.
B
For the GKE ingress controller to use your readinessProbes as health checks, the Pods for an Ingress must exist at the time of Ingress creation. If your replicas are scaled to 0, the default health check will apply.
send
light_mode
delete
Question #13
Your teammate has asked you to review the code below. Its purpose is to efficiently add a large number of small rows to a BigQuery table.

Which improvement should you suggest your teammate make?

Which improvement should you suggest your teammate make?
- AInclude multiple rows with each request.Most Voted
- BPerform the inserts in parallel by creating multiple threads.
- CWrite each row to a Cloud Storage object, then load into BigQuery.
- DWrite each row to a Cloud Storage object in parallel, then load into BigQuery.
Correct Answer:
B
B
send
light_mode
delete
Question #14
You are developing a JPEG image-resizing API hosted on Google Kubernetes Engine (GKE). Callers of the service will exist within the same GKE cluster. You want clients to be able to get the IP address of the service.
What should you do?
What should you do?
- ADefine a GKE Service. Clients should use the name of the A record in Cloud DNS to find the service's cluster IP address.
- BDefine a GKE Service. Clients should use the service name in the URL to connect to the service.Most Voted
- CDefine a GKE Endpoint. Clients should get the endpoint name from the appropriate environment variable in the client container.
- DDefine a GKE Endpoint. Clients should get the endpoint name from Cloud DNS.
Correct Answer:
C
C

The correct approach in this scenario is indeed, as mentioned in several comments, option B. By defining a GKE Service, the service discovery within the cluster utilizes Kubernetes' native feature where a DNS entry for the service is automatically created. Pods within the cluster can use the service’s DNS name to communicate, following the pattern ..svc.cluster.local. This is explicitly supported by Kubernetes standard service discovery mechanisms, simplifying the process and adhering to best practices for internal communications in a GKE cluster.
send
light_mode
delete
Question #15
You are using Cloud Build to build and test application source code stored in Cloud Source Repositories. The build process requires a build tool not available in the Cloud Build environment.
What should you do?
What should you do?
- ADownload the binary from the internet during the build process.
- BBuild a custom cloud builder image and reference the image in your build steps.Most Voted
- CInclude the binary in your Cloud Source Repositories repository and reference it in your build scripts.
- DAsk to have the binary added to the Cloud Build environment by filing a feature request against the Cloud Build public Issue Tracker.
Correct Answer:
B
B

When Cloud Build doesn't natively support a tool you need, creating a custom builder image is the way to go. This method allows for additional flexibility as you can reuse this custom image across different projects, ensuring consistency and control of build environments. This approach not only tailors Cloud Build to meet unique requirements but also enhances reproducibility in your build processes.
send
light_mode
delete
Question #16
You are deploying your application to a Compute Engine virtual machine instance. Your application is configured to write its log files to disk. You want to view the logs in Stackdriver Logging without changing the application code.
What should you do?
What should you do?
- AInstall the Stackdriver Logging Agent and configure it to send the application logs.Most Voted
- BUse a Stackdriver Logging Library to log directly from the application to Stackdriver Logging.
- CProvide the log file folder path in the metadata of the instance to configure it to send the application logs.
- DChange the application to log to /var/log so that its logs are automatically sent to Stackdriver Logging.
Correct Answer:
A
A

To view your app's logs in Stackdriver Logging without modifying the application code, you should install the Stackdriver Logging Agent on your Compute Engine instance. This agent is designed to automatically collect and send logs from the virtual machine to Stackdriver Logging. You can configure it to include custom log paths, making it a seamless solution that does not require any changes to your existing application setup. This method ensures that your application's logging practices continue uninterrupted while enabling centralized log management via Stackdriver.
send
light_mode
delete
Question #17
Your service adds text to images that it reads from Cloud Storage. During busy times of the year, requests to Cloud Storage fail with an HTTP 429 "Too Many
Requests" status code.
How should you handle this error?
Requests" status code.
How should you handle this error?
- AAdd a cache-control header to the objects.
- BRequest a quota increase from the GCP Console.
- CRetry the request with a truncated exponential backoff strategy.Most Voted
- DChange the storage class of the Cloud Storage bucket to Multi-regional.
Correct Answer:
C
Reference:
https://developers.google.com/gmail/api/v1/reference/quota
C
Reference:
https://developers.google.com/gmail/api/v1/reference/quota
send
light_mode
delete
Question #18
You are building an API that will be used by Android and iOS apps. The API must:
* Support HTTPs
* Minimize bandwidth cost
* Integrate easily with mobile apps
Which API architecture should you use?
* Support HTTPs
* Minimize bandwidth cost
* Integrate easily with mobile apps
Which API architecture should you use?
- ARESTful APIs
- BMQTT for APIs
- CgRPC-based APIsMost Voted
- DSOAP-based APIs
Correct Answer:
A
Reference:
https://www.devteam.space/blog/how-to-build-restful-api-for-your-mobile-app/
A
Reference:
https://www.devteam.space/blog/how-to-build-restful-api-for-your-mobile-app/
send
light_mode
delete
Question #19
Your application takes an input from a user and publishes it to the user's contacts. This input is stored in a table in Cloud Spanner. Your application is more sensitive to latency and less sensitive to consistency.
How should you perform reads from Cloud Spanner for this application?
How should you perform reads from Cloud Spanner for this application?
- APerform Read-Only transactions.
- BPerform stale reads using single-read methods.Most Voted
- CPerform strong reads using single-read methods.
- DPerform stale reads using read-write transactions.
Correct Answer:
D
Reference:
https://cloud.google.com/solutions/best-practices-cloud-spanner-gaming-database
D
Reference:
https://cloud.google.com/solutions/best-practices-cloud-spanner-gaming-database
send
light_mode
delete
Question #20
Your application is deployed in a Google Kubernetes Engine (GKE) cluster. When a new version of your application is released, your CI/CD tool updates the spec.template.spec.containers[0].image value to reference the Docker image of your new application version. When the Deployment object applies the change, you want to deploy at least 1 replica of the new version and maintain the previous replicas until the new replica is healthy.
Which change should you make to the GKE Deployment object shown below?

Which change should you make to the GKE Deployment object shown below?

- ASet the Deployment strategy to RollingUpdate with maxSurge set to 0, maxUnavailable set to 1.
- BSet the Deployment strategy to RollingUpdate with maxSurge set to 1, maxUnavailable set to 0.Most Voted
- CSet the Deployment strategy to Recreate with maxSurge set to 0, maxUnavailable set to 1.
- DSet the Deployment strategy to Recreate with maxSurge set to 1, maxUnavailable set to 0.
Correct Answer:
D
D
send
light_mode
delete
All Pages