Exams GCP Developer - Group Flashcards

1
Q

You need to copy directory local-scripts and all of its contents from your local workstation to a Compute Engine virtual machine instance.

Which command should you use?
A.gsutil cp –project “my-gcp-project” -r ~/local-scripts/ gcp-instance-name:~/server-scripts/ –zone “us-east1-b”
B.gsutil cp –project “my-gcp-project” -R ~/local-scripts/ gcp-instance-name:~/server-scripts/ –zone “us-east1-b”
C.gcloud compute scp –project “my-gcp-project” –recurse ~/local-scripts/ gcp-instance-name:~/server-scripts/ –zone“us-east1-b”
D.gcloud compute mv –project “my-gcp-project” –recurse ~/local-scripts/ gcp-instance-name:~/server-scripts/ –zone“us-east1-b”

A

C.gcloud compute scp –project “my-gcp-project” –recurse ~/local-scripts/ gcp-instance-name:~/server-scripts/ –zone“us-east1-b”

NOTES:
gsutil only is valid to google cloud storage - https://cloud.google.com/storage/docs/gsutil
gcloud compute scp - https://cloud.google.com/sdk/gcloud/reference/compute/scp

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

You are deploying your application to a Compute Engine virtual machine instance with the Stackdriver Monitoring Agent installed. Your application is a unix processon the instance. You want to be alerted if the unix process has not run for at least 5 minutes. You are not able to change the application to generate metrics or logs.

Which alert condition should you configure?
A.  Uptime check
B.  Process health
C.  Metric absence
D.  Metric threshold
A

B. Process health

NOTES:
https://cloud.google.com/monitoring/alerts/ui-conditions-ga
Metric absence AND Metric threshold are types of alerting not conditions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

You have two tables in an ANSI-SQL compliant database with identical columns that you need to quickly combine into a single table, removing duplicate rows fromthe result set.

What should you do?
A. Use the JOIN operator in SQL to combine the tables.
B. Use nested WITH statements to combine the tables.
C. Use the UNION operator in SQL to combine the tables.
D. Use the UNION ALL operator in SQL to combine the tables.

A

C. Use the UNION operator in SQL to combine the tables.

NOTES:
https://www.w3schools.com/sql/sql_union.asp

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

You have an application deployed in production. When a new version is deployed, some issues don’t arise until the application receives traffic from users inproduction. You want to reduce both the impact and the number of users affected.

Which deployment strategy should you use?
A.  Blue/green deployment
B.  Canary deployment
C.  Rolling deployment
D.  Recreate deployment
A

B. Canary deployment

NOTES:
https://dev.to/mostlyjason/intro-to-deployment-strategies-blue-green-canary-and-more-3a3

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

You need to migrate an internal file upload API with an enforced 500-MB file size limit to App Engine.

What should you do?
A.  Use FTP to upload files.
B.  Use CPanel to upload files.
C.  Use signed URLs to upload files.
D.  Change the API to be a multipart file upload API.
A

C. Use signed URLs to upload files.

NOTES:
https://cloud.google.com/appengine/docs/standard/python/blobstore?hl=es-419

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

You are planning to deploy your application in a Google Kubernetes Engine (GKE) cluster The application exposes an HTTP-based health check at /healthz. Youwant 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. 
livenesssProve:
    httpGet:
        path: /healthz
        port: 80
B.
readinessProbe:
    httpGet:
        path: /healthz
        port: 80
C.
loadbalancerHealthCheck:
    httpGet:
        path: /healthz
        port:80
D.
healthCheck:
    httpGet:
        path: /healthz
        port: 80
A
B.
readinessProbe:
    httpGet:
        path: /healthz
        port: 80

NOTES:
https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/
The kubelet uses liveness probes to know when to restart a container. For example, liveness probes could catch a deadlock, where an application is running, but unable to make progress. Restarting a container in such a state can help to make the application more available despite bugs.

The kubelet uses readiness probes to know when a container is ready to start accepting traffic. A Pod is considered ready when all of its containers are ready. One use of this signal is to control which Pods are used as backends for Services. When a Pod is not ready, it is removed from Service load balancers.

The kubelet uses startup probes to know when a container application has started. If such a probe is configured, it disables liveness and readiness checks until it succeeds, making sure those probes don’t interfere with the application startup. This can be used to adopt liveness checks on slow starting containers, avoiding them getting killed by the kubelet before they are up and running.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

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.

BigQuery service = BigQueryOptions.newBuilder().build().getService();
public void writeToBigQuery (Collection> rows) {
    for (Map row: rows) {
        InsertAllRequest insertRequest = InsertAllRequest.newBuilder("datasetId", "tableId", InsertAllRequest.RowToInsert.of(row)).build();
        service.insertAll(insertRequest);
    }
}

Which improvement should you suggest your teammate make?
A. Include multiple rows with each request.
B. Perform the inserts in parallel by creating multiple threads.
C. Write each row to a Cloud Storage object, then load into BigQuery.
D. Write each row to a Cloud Storage object in parallel, then load into BigQuery.

A

B. Perform the inserts in parallel by creating multiple threads.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

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?
A.  RESTful APIs
B.  MQTT for APIs
C.  gRPC-based APIs
D.  SOAP-based APIs
A

A. RESTful APIs

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

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?
A. Perform Read-Only transactions.
B. Perform stale reads using single-read methods.
C. Perform strong reads using single-read methods.
D. Perform stale reads using read-write transactions.

A

D. Perform stale reads using read-write transactions.

NOTES:
A stale read is read at a timestamp in the past. If your application is latency sensitive but tolerant of stale data, then stale reads can provide performance benefits.
https://cloud.google.com/spanner/docs/reads

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

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?

apiVersion: apps/v1 
kind: Deployment
metadata:
    name: ecommerce-frontend-deployment
spec:
    replicas: 3
    selector:
        matchLabels:
            app: ecommerce-frontend
    template:
        metadata:
            labels:
                app: ecommerce-frontend
        spec:
            containers:
                -name: ecommerce-frontend-webapp
                image: ecommerce-frontend-webapp: 1.7.9
                ports:
                     - containerPort: 80

A. Set the Deployment strategy to RollingUpdate with maxSurge set to 0, maxUnavailable set to 1.
B. Set the Deployment strategy to RollingUpdate with maxSurge set to 1, maxUnavailable set to 0.
C. Set the Deployment strategy to Recreate with maxSurge set to 0, maxUnavailable set to 1.
D.Set the Deployment strategy to Recreate with maxSurge set to 1, maxUnavailable set to 0.

A

B. Set the Deployment strategy to RollingUpdate with maxSurge set to 1, maxUnavailable set to 0.

NOTES:

  • maxUnavailable: the maximum number of pods that can be unavailable during the update process. This can be an absolute number or percentage of the replicas count; the default is 25%.
  • maxSurge: the maximum number of pods that can be created over the desired number of pods. Again this can be an absolute number or a percentage of the replicas count; the default is 25%.

https://kubernetes.io/blog/2018/04/30/zero-downtime-deployment-kubernetes-jenkins/

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

You plan to make a simple HTML application available on the internet. This site keeps information about FAQs for your application. The application is static andcontains images, HTML, CSS, and Javascript. You want to make this application available on the internet with as few steps as possible.

What should you do?
A. Upload your application to Cloud Storage.
B. Upload your application to an App Engine environment.
C. Create a Compute Engine instance with Apache web server installed. Configure Apache web server to host the application.
D. Containerize your application first. Deploy this container to Google Kubernetes Engine (GKE) and assign an external IP address to the GKE pod hosting theapplication.

A

A. Upload your application to Cloud Storage.

NOTES:
https://cloud.google.com/storage/docs/hosting-static-website

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Your company has deployed a new API to App Engine Standard environment. During testing, the API is not behaving as expected. You want to monitor the application over time to diagnose the problem within the application code without redeploying the application.

Which tool should you use?
A.  Stackdriver Trace
B.  Stackdriver Monitoring
C.  Stackdriver Debug Snapshots
D.  Stackdriver Debug Logpoints
A

B. Stackdriver Monitoring

NOTES:
https://cloud.google.com/monitoring/docs

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

You want to use the Stackdriver Logging Agent to send an application’s log file to Stackdriver from a Compute Engine virtual machine instance. After installing the Stackdriver Logging Agent,

what should you do first?
A. Enable the Error Reporting API on the project.
B. Grant the instance full access to all Cloud APIs.
C. Configure the application log file as a custom source.
D. Create a Stackdriver Logs Export Sink with a filter that matches the application’s log entries.

A

C. Configure the application log file as a custom source.

NOTES:

https: //cloud.google.com/logging/docs/agent/logging/configuration#third-party_application_log_input_configuration
https: //medium.com/cloudadventure/streaming-custom-application-logs-on-compute-engine-with-stackdriver-agent-cdc1fee529f0

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Your company has a BigQuery dataset named “Master” that keeps information about employee travel and expenses. This information is organized by employee department. That means employees should only be able to view information for their department. You want to apply a security framework to enforce this requirement with the minimum number of steps.

What should you do?
A. Create a separate dataset for each department. Create a view with an appropriate WHERE clause to select records from a particular dataset for the specific department. Authorize this view to access records from your Master dataset. Give employees the permission to this department-specific dataset.
B. Create a separate dataset for each department. Create a data pipeline for each department to copy appropriate information from the Master dataset to the specific dataset for the department. Give employees the permission to this department-specific dataset.
C. Create a dataset named Master dataset. Create a separate view for each department in the Master dataset. Give employees access to the specific view for their department.
D. Create a dataset named Master dataset. Create a separate table for each department in the Master dataset. Give employees access to the specific table fortheir department.

A

B. Create a separate dataset for each department. Create a data pipeline for each department to copy appropriate information from the Master dataset to the specific dataset for the department. Give employees the permission to this department-specific dataset.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

You have an application in production. It is deployed on Compute Engine virtual machine instances controlled by a managed instance group. Traffic is routed to the instances via a HTTP(s) load balancer. Your users are unable to access your application. You want to implement a monitoring technique to alert you when the application is unavailable.

Which technique should you choose?
A.  Smoke tests
B.  Stackdriver uptime checks
C.  Cloud Load Balancing - heath checks
D.  Managed instance group - heath checks
A

B. Stackdriver uptime checks

NOTES:
Stackdriver uptime checks =>
https://cloud.google.com/monitoring/uptime-checks

Managed instance group = > https://cloud.google.com/compute/docs/instance-groups/autohealing-instances-in-migs

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

You are load testing your server application. During the first 30 seconds, you observe that a previously inactive Cloud Storage bucket is now servicing 2000 write requests per second and 7500 read requests per second. Your application is now receiving intermittent 5xx and 429 HTTP responses from the Cloud Storage JSON API as the demand escalates. You want to decrease the failed responses from the Cloud Storage API.

What should you do?
A. Distribute the uploads across a large number of individual storage buckets.
B.Use the XML API instead of the JSON API for interfacing with Cloud Storage.
C.Pass the HTTP response codes back to clients that are invoking the uploads from your application.
D. Limit the upload rate from your application clients so that the dormant bucket’s peak request rate is reached more gradually.

A

A. Distribute the uploads across a large number of individual storage buckets

NOTES:
https://cloud.google.com/storage/docs/request-rate

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Your application is controlled by a managed instance group. You want to share a large read-only data set between all the instances in the managed instance group. You want to ensure that each instance can start quickly and can access the data set via its filesystem with very low latency. You also want to minimize the total cost of the solution.

What should you do?
A. Move the data to a Cloud Storage bucket, and mount the bucket on the filesystem using Cloud Storage FUSE.
B. Move the data to a Cloud Storage bucket, and copy the data to the boot disk of the instance via a startup script.
C. Move the data to a Compute Engine persistent disk, and attach the disk in read-only mode to multiple Compute Engine virtual machine instances.
D. Move the data to a Compute Engine persistent disk, take a snapshot, create multiple disks from the snapshot, and attach each disk to its own instance.

A

C. Move the data to a Compute Engine persistent disk, and attach the disk in read-only mode to multiple Compute Engine virtual machine instances.

NOTES:
https://cloud.google.com/compute/docs/disks/gcs-buckets

https://cloud.google.com/compute/docs/disks/snapshot-best-practices

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

You are developing an HTTP API hosted on a Compute Engine virtual machine instance that needs to be invoked by multiple clients within the same Virtual PrivateCloud (VPC). You want clients to be able to get the IP address of the service.

What should you do?
A. Reserve a static external IP address and assign it to an HTTP(S) load balancing service’s forwarding rule. Clients should use this IP address to connect to theservice.
B. Reserve a static external IP address and assign it to an HTTP(S) load balancing service’s forwarding rule. Then, define an A record in Cloud DNS. Clientsshould use the name of the A record to connect to the service.
C. Ensure that clients use Compute Engine internal DNS by connecting to the instance name with the url https://[INSTANCE_NAME].[ZONE].c.[PROJECT_ID].internal/.
D. Ensure that clients use Compute Engine internal DNS by connecting to the instance name with the url https://[API_NAME]/[API_VERSION]/.

A

C. Ensure that clients use Compute Engine internal DNS by connecting to the instance name with the url https://[INSTANCE_NAME].[ZONE].c.[PROJECT_ID].internal/.

NOTES:

https://cloud.google.com/compute/docs/internal-dns#instance-fully-qualified-domain-names

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

You are planning to deploy your application in a Google Kubernetes Engine (GKE) cluster. Your application can scale horizontally, and each instance of your application needs to have a stable network identity and its own persistent disk.

Which GKE object should you use?
A.  Deployment
B.  StatefulSet
C.  ReplicaSet
D.  ReplicaController
A

B. StatefulSet

NOTES:
https://kubernetes.io/es/docs/concepts/workloads/controllers/statefulset/#usar-statefulsets

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

You are using Cloud Build to build a Docker image. You need to modify the build to execute unit and run integration tests. When there is a failure, you want the build history to clearly display the stage at which the build failed.

What should you do?
A. Add RUN commands in the Dockerfile to execute unit and integration tests.
B. Create a Cloud Build build config file with a single build step to compile unit and integration tests.
C. Create a Cloud Build build config file that will spawn a separate cloud build pipeline for unit and integration tests.
D.Create a Cloud Build build config file with separate cloud builder steps to compile and execute unit and integration tests.

A

D.Create a Cloud Build build config file with separate cloud builder steps to compile and execute unit and integration tests.

NOTES:
https://cloud.google.com/build/docs/building-leaner-containers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

Your code is running on Cloud Functions in project A. It is supposed to write an object in a Cloud Storage bucket owned by project B. However, the write call is failing with the error “403 Forbidden”.

What should you do to correct the problem?
A. Grant your user account the roles/storage.objectCreator role for the Cloud Storage bucket.
B. Grant your user account the roles/iam.serviceAccountUser role for the service-PROJECTA@gcf-admin-robot.iam.gserviceaccount.com service account.
C. Grant the service-PROJECTA@gcf-admin-robot.iam.gserviceaccount.com service account the roles/storage.objectCreator role for the Cloud Storage bucket.
D. Enable the Cloud Storage API in project B.

A

C. Grant the service-PROJECTA@gcf-admin-robot.iam.gserviceaccount.com service account the roles/storage.objectCreator role for the Cloud Storage bucket.

NOTES:

https://cloud.google.com/storage/docs/access-control/iam-roles#standard-roles

22
Q

HipLocal’s APIs are showing occasional failures, but they cannot find a pattern. They want to collect some metrics to help them troubleshoot.

What should they do?
A. Take frequent snapshots of all of the VMs.
B. Install the Stackdriver Logging agent on the VMs.
C. Install the Stackdriver Monitoring agent on the VMs.
D. Use Stackdriver Trace to look for performance bottlenecks.

A

C. Install the Stackdriver Monitoring agent on the VMs.

NOTES:

https: //cloud.google.com/monitoring/agent/monitoring/installation#configure-agent
https: //cloud.google.com/logging/docs/agent/logging/installation#before_you_begin

23
Q

HipLocal has connected their Hadoop infrastructure to GCP using Cloud Interconnect in order to query data stored on persistent disks.

Which IP strategy should they use?
A.  Create manual subnets.
B.  Create an auto mode subnet.
C.  Create multiple peered VPCs.
D.  Provision a single instance for NAT.
A

A. Create manual subnets.

24
Q

You want to upload files from an on-premises virtual machine to Google Cloud Storage as part of a data migration. These files will be consumed by Cloud DataProc Hadoop cluster in a GCP environment.

Which command should you use?
A.gsutil cp [LOCAL_OBJECT] gs://[DESTINATION_BUCKET_NAME]/
B.gcloud cp [LOCAL_OBJECT] gs://[DESTINATION_BUCKET_NAME]/
C.hadoop fs cp [LOCAL_OBJECT] gs://[DESTINATION_BUCKET_NAME]/
D.gcloud dataproc cp [LOCAL_OBJECT] gs://[DESTINATION_BUCKET_NAME]/

A

A.gsutil cp [LOCAL_OBJECT] gs://[DESTINATION_BUCKET_NAME]/

25
Q

You migrated your applications to Google Cloud Platform and kept your existing monitoring platform. You now find that your notification system is too slow for time critical problems.

What should you do?
A.Replace your entire monitoring platform with Stackdriver.
B.Install the Stackdriver agents on your Compute Engine instances.
C.Use Stackdriver to capture and alert on logs, then ship them to your existing platform.
D.Migrate some traffic back to your old platform and perform AB testing on the two platforms concurrently.

A

B.Install the Stackdriver agents on your Compute Engine instances.

NOTES:
https://cloud.google.com/logging/docs/agent/logging/installation#before_you_begin

26
Q

You are planning to migrate a MySQL database to the managed Cloud SQL database for Google Cloud. You have Compute Engine virtual machine instances that will connect with this Cloud SQL instance. You do not want to whitelist IPs for the Compute Engine instances to be able to access Cloud SQL.

What should you do?
A.Enable private IP for the Cloud SQL instance.
B.Whitelist a project to access Cloud SQL, and add Compute Engine instances in the whitelisted project.
C.Create a role in Cloud SQL that allows access to the database from external instances, and assign the Compute Engine instances to that role.
D.Create a CloudSQL instance on one project. Create Compute engine instances in a different project. Create a VPN between thesetwo projects to allow internal access to CloudSQL.

A

C.Create a role in Cloud SQL that allows access to the database from external instances, and assign the Compute Engine instances to that role.

NOTES:
https://cloud.google.com/sql/docs/mysql/connect-compute-engine?hl=es-419#prereq

27
Q

You have deployed an HTTP(s) Load Balancer with the gcloud commands shown below.

export NAME-load-balancer

# create network
gcloud compute networks create $ (NAME}
# add instance
gcloud compute instances create $ (NAME)-backend-instance-1 --subnet $(NAME) --no address
# create the instance group
gcloud compute instance groups unmanaged create $(NAME)-i

gcloud compute instance-groups unmanaged set-named-ports $(NAME)-i-named-ports http:80 gcloud compute instance-groups unmanaged add-instances $(NAME)-i-instances $(NAME)-instance-1

# configure health checks
gcloud compute health-checks create http $ (NAME)-http-hc-port 80
#create backend service
gcloud compute backend-services create $(NAME)-http-bes --health-checks $(NAME)-http-hc protocol HTTP port-name http--global

gcloud compute backend-services add-backend $(NAME)-http-bes instance-group $(NAME)-i –balancing mode RATE –max-rate 100000 –capacity-scaler 1.0 –global–instance-group-zone us-east-d

#create urls maps and forwarding rule
gcloud compute url-maps create $(NAME)-http-urlmap--default-service $(NAME)-http-bes

gcloud compute target-http-proxies create $(NAME)-http-proxy-ur-map $[NAME]-http-urlmap geloud compute forwarding-rules create $(NAME)-http-fw-global-ip-protocol ICP –target-http-proxy $(NAME)-http-proxy –ports 80

Health checks to port 80 on the Compute Engine virtual machine instance are failing and no traffic is sent to your instances.You want to resolve the problem.

Which commands should you run?

A. gcloud compute instances add-access-config ${NAME}-backend-instance-1

B. gcloud compute instances add-tags ${NAME}-backend-instance-1 –tags http-server

C. gcloud compute firewall-rules create allow-lb –network load-balancer –allow tcp –source-ranges 130.211.0.0/22,35.191.0.0/16 –direction INGRESS

D. gcloud compute firewall-rules create allow-lb –network load-balancer –allow tcp –destination-ranges 130.211.0.0/22,35.191.0.0/16 –direction EGRESS

A

C.gcloud compute firewall-rules create allow-lb –network load-balancer –allow tcp –source-ranges 130.211.0.0/22,35.191.0.0/16 –direction INGRESS

NOTES:
https://cloud.google.com/sdk/gcloud/reference/compute/firewall-rules/create

28
Q

Your website is deployed on Compute Engine. Your marketing team wants to test conversion rates between 3 different website designs.

Which approach should you use?
A.Deploy the website on App Engine and use traffic splitting.
B.Deploy the website on App Engine as three separate services.
C.Deploy the website on Cloud Functions and use traffic splitting
D.Deploy the website on Cloud Functions as three separate functions.

A

A.Deploy the website on App Engine and use traffic splitting.

NOTES:

https://cloud.google.com/appengine/docs/standard/java/splitting-traffic

29
Q

Your company wants to expand their users outside the United States for their popular application. The company wants to ensure 99.999% availability of the database for their application and also wants to minimize the read latency for their users across the globe.

Which two actions should they take? (Choose two.)
A.Create a multi-regional Cloud Spanner instance with “nam-asia-eur1” configuration.
B.Create a multi-regional Cloud Spanner instance with “nam3” configuration.
C.Create a cluster with at least 3 Spanner nodes.
D.Create a cluster with at least 1 Spanner node.
E.Create a minimum of two Cloud Spanner instances in separate regions with at least one node.
F.Create a Cloud Dataflow pipeline to replicate data across different databases.

A

B.Create a multi-regional Cloud Spanner instance with “nam3” configuration.
F.Create a Cloud Dataflow pipeline to replicate data across different databases.

NOTES:
https://cloud.google.com/spanner/docs/replication?hl=es

https://cloud.google.com/spanner/docs/instances?hl=es#multi-region-best-practices

In my opinion
A.Create a multi-regional Cloud Spanner instance with “nam-asia-eur1” configuration.
C.Create a cluster with at least 3 Spanner nodes.

30
Q

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?
A.Define a GKE Service. Clients should use the name of the A record in Cloud DNS to find the service’s cluster IP address.
B.Define a GKE Service. Clients should use the service name in the URL to connect to the service.
C.Define a GKE Endpoint. Clients should get the endpoint name from the appropriate environment variable in the client container.
D.Define a GKE Endpoint. Clients should get the endpoint name from Cloud DNS.

A

C.Define a GKE Endpoint. Clients should get the endpoint name from the appropriate environment variable in the client container.

NOTES:

https://cloud.google.com/endpoints/docs/openapi/get-started-kubernetes-engine?hl=es-419

31
Q

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?
A. Download the binary from the internet during the build process.
B. Build a custom cloud builder image and reference the image in your build steps.
C. Include the binary in your Cloud Source Repositories repository and reference it in your build scripts.
D. Ask to have the binary added to the Cloud Build environment by filing a feature request against the Cloud Build public Issue Tracker.

A

B.Build a custom cloud builder image and reference the image in your build steps.

NOTES:
https://cloud.google.com/build/docs/speeding-up-builds?hl=es

32
Q

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?
A. Install the Stackdriver Logging Agent and configure it to send the application logs.
B. Use a Stackdriver Logging Library to log directly from the application to Stackdriver Logging.
C. Provide the log file folder path in the metadata of the instance to configure it to send the application logs.
D. Change the application to log to /var/log so that its logs are automatically sent to Stackdriver Logging.

A

A.Install the Stackdriver Logging Agent and configure it to send the application logs.

NOTES:

https://cloud.google.com/logging/docs/agent/logging/configuration#third-party_application_log_input_configuration

33
Q

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?
A. Add a cache-control header to the objects.
B. Request a quota increase from the GCP Console.
C. Retry the request with a truncated exponential backoff strategy.
D. Change the storage class of the Cloud Storage bucket to Multi-regional.

A

C. Retry the request with a truncated exponential backoff strategy.

NOTES:

https://cloud.google.com/storage/docs/retry-strategy#overview

34
Q

Your company has a BigQuery data mart that provides analytics information to hundreds of employees. One user of wants to run jobs without interrupting important workloads. This user isn’t concerned about the time it takes to run these jobs. You want to fulfill this request while minimizing cost to the company and the effort required on your part.

What should you do?
A. Ask the user to run the jobs as batch jobs.
B. Create a separate project for the user to run jobs.
C. Add the user as a job.user role in the existing project.
D. Allow the user to run jobs when important workloads are not running.

A

B. Create a separate project for the user to run jobs.

35
Q

You want to notify on-call engineers about a service degradation in production while minimizing development time.

What should you do?
A. Use Cloud Function to monitor resources and raise alerts.
B. Use Cloud Pub/Sub to monitor resources and raise alerts.
C. Use Stackdriver Error Reporting to capture errors and raise alerts.
D. Use Stackdriver Monitoring to monitor resources and raise alerts

A

C. Use Stackdriver Error Reporting to capture errors and raise alerts.

NOTES:

https://cloud.google.com/error-reporting/docs/notifications

36
Q

You are writing a single-page web application with a user-interface that communicates with a third-party API for content using XMLHttpRequest. The data displayed on the UI by the API results is less critical than other data displayed on the same web page, so it is acceptable for some requests to not have the API data displayed in the UI. However, calls made to the API should not delay rendering of other parts of the user interface. You want your application to perform well when the API response is an error or a timeout.

What should you do?
A. Set the asynchronous option for your requests to the API to false and omit the widget displaying the API results when a timeout or error is encountered.
B. Set the asynchronous option for your request to the API to true and omit the widget displaying the API results when a timeout or error is encountered.
C. Catch timeout or error exceptions from the API call and keep trying with exponential backoff until the API response is successful.
D. Catch timeout or error exceptions from the API call and display the error response in the UI widget.

A

B. Set the asynchronous option for your request to the API to true and omit the widget displaying the API results when a timeout or error is encountered.

NOTES:

https://developer.mozilla.org/es/docs/Web/API/XMLHttpRequest/Using_XMLHttpRequest#ejemplo_solicitudes_as%C3%ADncronas

37
Q

You are creating an App Engine application that writes a file to any user’s Google Drive.

How should the application authenticate to the Google Drive API?
A. With an OAuth Client ID that uses the https://www.googleapis.com/auth/drive. file scope to obtain an access token for each user.
B. With an OAuth Client ID with delegated domain-wide authority.
C. With the App Engine service account and https://www.googleapis.com/auth/drive. file scope that generates a signed JWT.
D. With the App Engine service account with delegated domain-wide authority.

A

B. With an OAuth Client ID with delegated domain-wide authority.

NOTES:

https://cloud.google.com/appengine/docs/standard/go/access-control#domain-wide_delegation_of_authority

38
Q

You are creating a Google Kubernetes Engine (GKE) cluster and run this command:

gcloud container clusters create large-cluster –num-nodes 200

The command fails with the error:

insufficient regional quota to satisfy request: resource “CPUS”: request requieres ‘200.0’ and is short ‘176.0’. project has a quota of ‘24.0’ with ‘24.0’ available

You want to resolve the issue.

What should you do?
A. Request additional GKE quota is the GCP Console.
B. Request additional Compute Engine quota in the GCP Console.
C. Open a support case to request additional GKE quota.
D. Decouple services in the cluster, and rewrite new clusters to function with fewercores.

A

A. Request additional GKE quota is the GCP Console.

39
Q

You are parsing a log file that contains three columns: a timestamp, an account number (a string), and a transaction amount (a number). You want to calculate the sum of all transaction amounts for each unique account number efficiently.

Which data structure should you use?
A. A linked list
B. A hash table
C. A two-dimensional array
D. A comma-delimited string
A

B. A hash table

40
Q

Your application is logging to Stackdriver. You want to get the count of all requests on all /api/alpha/* endpoints.

What should you do?
A. Add a Stackdriver counter metric for path:/api/alpha/.
B. Add a Stackdriver counter metric for endpoint:/api/alpha/*.
C. Export the logs to Cloud Storage and count lines matching /api/alpha.
D. Export the logs to Cloud Pub/Sub and count lines matching /api/alpha.

A

A. Add a Stackdriver counter metric for path:/api/alpha/.

NOTES:

https://cloud.google.com/logging/docs/logs-based-metrics/counter-metrics#command-line

41
Q

You want to re-architect a monolithic application so that it follows a microservices model. You want to accomplish this efficiently while minimizing the impact of this change to the business.

Which approach should you take?
A. Deploy the application to Compute Engine and turn on autoscaling.
B. Replace the application’s features with appropriate microservices in phases.
C. Refactor the monolithic application with appropriate microservices in a single effort and deploy it.
D. Build a new application with the appropriate microservices separate from the monolith and replace it when it is complete.

A

B. Replace the application’s features with appropriate microservices in phases.

NOTES:

https://cloud.google.com/architecture/migrating-a-monolithic-app-to-microservices-gke?hl=es-419

42
Q

Your existing application keeps user state information in a single MySQL database. This state information is very user-specific and depends heavily on how long a user has been using an application. The MySQL database is causing challenges to maintain and enhance the schema for various users.

Which storage option should you choose?
A. Cloud SQL
B. Cloud Storage
C. Cloud Spanner
D. Cloud Datastore/Firestore
A

A.Cloud SQL

43
Q

You are building a new API. You want to minimize the cost of storing and reduce the latency of serving images.

Which architecture should you use?
A. App Engine backed by Cloud Storage
B. Compute Engine backed by Persistent Disk
C. Transfer Appliance backed by Cloud Filestore
D. Cloud Content Delivery Network (CDN) backed by Cloud Storage

A

D. Cloud Content Delivery Network (CDN) backed by Cloud Storage

NOTES:
https://cloud.google.com/cdn/docs

44
Q

Your company’s development teams want to use Cloud Build in their projects to build and push Docker images to Container Registry. The operations team requires all Docker images to be published to a centralized, securely managed Docker registry that the operations team manages.

What should you do?
A. Use Container Registry to create a registry in each development team’s project. Configure the Cloud Build build to push the Docker image to the project’s registry. Grant the operations team access to each development team’s registry.
B. Create a separate project for the operations team that has Container Registry configured. Assign appropriate permissions to the Cloud Build service account in each developer team’s project to allow access to the operation team’s registry.
C. Create a separate project for the operations team that has Container Registry configured. Create a Service Account for each development team and assign the appropriate permissions to allow it access to the operations team’s registry. Store the service account key file in the source code repository and use it to authenticate against the operations team’s registry.
D. Create a separate project for the operations team that has the open source Docker Registry deployed on a Compute Engine virtual machine instance. Create a username and password for each development team. Store the usernameand password in the source code repository and use it to authenticate against the operations team’s Docker registry.

A

A. Use Container Registry to create a registry in each development team’s project. Configure the Cloud Build build to push the Docker image to the project’s registry. Grant the operations team access to each development team’s registry.

45
Q

HipLocal’s.net-based auth service fails under intermittent load.

What should they do?
A. Use App Engine for autoscaling.
B. Use Cloud Functions for autoscaling.
C. Use a Compute Engine cluster for the service.
D. Use a dedicated Compute Engine virtual machine instance for the service

A

D.Use a dedicated Compute Engine virtual machine instance for the service

46
Q

Which service should HipLocal use to enable access to internal apps?

A. Cloud VPN
B. Cloud Armor
C. Virtual Private Cloud
D. Cloud Identity-Aware Proxy

A

D. Cloud Identity-Aware Proxy

NOTES:

https://cloud.google.com/iap/docs/concepts-overview

47
Q

HipLocal wants to reduce the number of on-call engineers and eliminate manual scaling.

Which two services should they choose? (Choose two.)
A. Use Google App Engine services.
B. Use serverless Google Cloud Functions.
C. Use Knative to build and deploy serverless applications.
D. Use Google Kubernetes Engine for automated deployments.
E. Use a large Google Compute Engine cluster for deployments

A

B. Use serverless Google Cloud Functions.

C. Use Knative to build and deploy serverless applications.

48
Q

In order to meet their business requirements, how should HipLocal store their application state?
A. Use local SSDs to store state.
B. Put a memcache layer in front of MySQL.
C. Move the state storage to Cloud Spanner.
D. Replace the MySQL instance with Cloud SQL.

A

B.Put a memcache layer in front of MySQL.

49
Q
Which service should HipLocal use for their public APIs?
A. Cloud Armor
B. Cloud Functions
C. Cloud Endpoints
D. Shielded Virtual Machines
A

C.Cloud Endpoints

50
Q

HipLocal wants to improve the resilience of their MySQL deployment, while also meeting their business and technical requirements.

Which configuration should they choose?
A. Use the current single instance MySQL on Compute Engine and several read-only MySQL servers on Compute Engine.
B. Use the current single instance MySQL on Compute Engine, and replicate the data to Cloud SQL in an external master configuration.
C. Replace the current single instance MySQL instance with Cloud SQL, and configure high availability.
D. Replace the current single instance MySQL instance with Cloud SQL, and Google provides redundancy without further configuration.

A

B. Use the current single instance MySQL on Compute Engine, and replicate the data to Cloud SQL in an external master configuration.

51
Q

Use HipLocal.

Technical Requirements -
“¢ The application and backend must provide usage metrics and monitoring. “¢ APIs require strong authentication and authorization. “¢ Logging must be increased, and data should be stored in a cloud analytics platform. “¢ Move to serverless architecture to facilitate elastic scaling. “¢ Provide authorized access to internal apps in a secure manner.
HipLocal’s .net-based auth service fails under intermittent load.

What should they do?
A. Use App Engine for autoscaling.
B. Use Cloud Functions for autoscaling.
C. Use a Compute Engine cluster for the service.
D. Use a dedicated Compute Engine virtual machine instance for the service

A

A. Use App Engine for autoscaling.