GCP Cloud Professional Architect
GCP Cloud Professional Architect
GCP Cloud Professional Architect
PROFESSIONAL
ARCHITECT
Question 1:
You are using Cloud CDN to deliver static HTTP(S) website content
hosted on a Compute Engine instance group. You want to improve the
cache hit ratio. What should you do?
Customize the cache keys to omit the protocol from the key. (Correct)
Explanation
A is correct because, by default, Cloud CDN uses the complete request URL
to build the cache key. For performance and scalability, it’s important to
optimize the cache hit ratio. To help optimize your cache hit ratio, you can use
custom cache keys. By removing the protocol from the key, Cloud CDN will be
able to use the same cache for both HTTP and HTTPS requests for the same
object, thus optimizing the cache-hit ratio.
B is incorrect because shortening the expiration time will cause more cache
misses and thus, making the cache-hit ratio worse.
C is incorrect because Cloud CDN serves content from the closest location by
default.
Links:
https://cloud.google.com/cdn/docs/best-practices#cache-hit-ratio
https://cloud.google.com/cdn/docs/using-cache-keys#turn-on
Question 2:
Your architecture calls for the centralized collection of all admin activity
and VM system logs within your project. How should you collect these
logs from both VMs and services?
Install the Stackdriver Logging agent on a single compute instance and let
it collect all audit and access logs for your environment.
Explanation
A is incorrect because the VM logs are not collected by Stackdriver by default.
B is correct because you can view all activity and VM system logs in
Stackdriver if the Stackdriver Logging agent is configured on the VM. It
streams logs from common third-party applications and system software to
Logging. You can configure the agent to stream additional logs.
Links:
https://cloud.google.com/logging/docs/agent
https://cloud.google.com/logging/docs/agent/logging
Question 3:
You have an App Engine application that needs to be updated. You want
to test the update with production traffic before replacing the current
application version. What should you do?
Deploy the update using the Instance Group Updater to create a partial
rollout, which allows for canary testing.
Deploy the update in a new VPC, and use Google's global HTTP load
balancing to split traffic between the update and current applications.
Deploy the update as a new App Engine application, and use Google's
global HTTP load balancing to split traffic between the new and current
applications.
Explanation
A is incorrect because App Engine does not have an instance group updater
component.
C is incorrect because App Engine is not part of GCP’s VPC and there is no
need for deploying to another VPC anyways as App Engine supports traffic
splitting by default.
Links:
https://cloud.google.com/appengine/docs/standard/python/splitting-traffic
Question 4:
All Compute Engine instances in your VPC should be able to connect to
an Active Directory server on specific ports. Any other traffic emerging
from your instances is not allowed. You want to enforce this using VPC
firewall rules. How should you configure the firewall rules?
Create an egress rule with priority 1000 to deny all traffic for all
instances. Create another egress rule with priority 100 to allow (Correct)
the Active Directory traffic for all instances.
Create an egress rule with priority 100 to deny all traffic for all instances.
Create another egress rule with priority 1000 to allow the Active Directory
traffic for all instances.
Create an egress rule with priority 1000 to allow the Active Directory
traffic. Rely on the implied deny egress rule with priority 100 to block all
traffic for all instances.
Create an egress rule with priority 100 to allow the Active Directory traffic.
Rely on the implied deny egress rule with priority 1000 to block all traffic
for all instances.
Explanation
A is correct because every VPC network has two implied IPv4 firewall rules.
An Allow all Egress rule with the lowest priority that allows all instances to
send traffic to any destination and a Deny all Ingress rule with the lowest
priority to block all outside traffic from entering. The egress rule that allows
the traffic must have a higher priority than the ingress rule that blocks the
traffic. Note: in the context of firewall rules, a smaller number signifies higher
priority.
B is incorrect because the egress rule that allows the traffic must have a
higher priority than the ingress rule that blocks the traffic.
Links:
https://cloud.google.com/vpc/docs/firewalls#default_firewall_rules
Question 5:
Your customer runs a web service used by e-commerce sites to offer
product recommendations to users. The company has begun
experimenting with a machine learning model on Google Cloud Platform
to improve the quality of results. What should the customer do to
improve their model's results over time?
Build a roadmap to move the machine learning model training from Cloud
GPUs to Cloud TPUs, which offer better results.
Explanation
A is incorrect because analyzing training metrics does not help improve the
quality of results.
Links:
https://mlinproduction.com/model-
retraining/#:~:text=Rather%20retraining%20simply%20refers%20to,t%20inv
olve%20any%20code%20changes.
https://valohai.com/blog/when-should-a-machine-learning-model-be-
retrained/
Question 6:
A development team at your company has created a dockerized HTTPS
web application. You need to deploy the application on Google
Kubernetes Engine (GKE) and make sure that the application scales
automatically. How should you deploy to GKE?
Use the Horizontal Pod Autoscaler and enable cluster autoscaling. Use an
Ingress resource to load-balance the HTTPS traffic.
Explanation
A is incorrect because even though it is possible to use an Ingress resource
for load balancing, an ingress is mostly used when you want to expose
multiple services over a single URL. But in this case, we only want to expose a
single service and thus, Ingress is not the best option.
Links:
https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/
https://cloud.google.com/kubernetes-engine/docs/how-to/cluster-autoscaler
https://cloud.google.com/kubernetes-engine/docs/tutorials/hello-app
Question 7:
You need to design a solution for global load balancing based on the URL path
being requested. You need to ensure operations reliability and end-to-end in-
transit encryption based on Google best practices. What should you do?
Explanation
A is incorrect because GCP does not have a cross-region load balancer type.
C is incorrect because the SSL proxy load balancing does not support URL
maps.
D is incorrect because the SSL proxy load balancing does not support URL
maps.
Links:
https://cloud.google.com/load-balancing/docs/url-map
https://cloud.google.com/load-balancing/docs/ssl/#FAQ
Question 8:
You have an application that makes HTTP requests to Cloud Storage.
Occasionally the requests fail with HTTP status codes of 5xx and 429.
How should you handle these types of errors?
Explanation
A is incorrect because HTTP is better than gRPC.
C is incorrect because changing the storage type does not automatically fix
API errors.
Links:
https://cloud.google.com/storage/docs/retry-strategy
https://cloud.google.com/storage/docs/request-rate
Question 9:
You need to develop procedures to test a disaster plan for a mission-
critical application. You want to use Google-recommended practices and
native capabilities within GCP. What should you do?
Explanation
A is incorrect because activity logs don’t provide logging information about
the tests.
Links:
https://cloud.google.com/architecture/dr-scenarios-planning-
guide#test_your_plan_regularly
Question 10:
Your company creates rendering software which users can download
from the company website. Your company has customers all over the
world. You want to minimize latency for all your customers. You want to
follow Google-recommended practices. How should you store the files?
Save the files in a Regional Cloud Storage bucket, one bucket per zone of
the region.
Save the files in multiple Regional Cloud Storage buckets, one bucket per
zone per region.
Explanation
A is correct because it is recommended to use a multi-region when you want
to serve content to data consumers that are outside of the Google network
and distributed across large geographic areas, or when you want the higher
availability that comes with being geo-redundant. Objects stored in a multi-
region or dual-region are geo-redundant.
Links:
https://cloud.google.com/storage/docs/locations
Question 11:
Your company acquired a healthcare startup and must retain its
customers' medical information for up to 4 more years, depending on
when it was created. Your corporate policy is to securely retain this data,
and then delete it as soon as regulations allow. Which approach should
you take?
Store the data in Google Drive and manually delete records as they expire.
Anonymize the data using the Cloud Data Loss Prevention API and store it
indefinitely.
Store the data in Cloud Storage and run a nightly batch script that deletes
all expired data.
Explanation
A is incorrect because manually storing and deleting data on Google drive is
very tedious and error-prone.
B is incorrect because anonymizing the data is not a requirement here and the
data must be deleted as soon as the regulations allow.
Links:
https://cloud.google.com/storage/docs/lifecycle
Question 12:
You are deploying a PHP App Engine Standard service with Cloud SQL as
the backend. You want to minimize the number of queries to the
database. What should you do?
Set the memcache service level to dedicated. Create a cron task that runs
every minute to populate the cache with keys containing query results.
Set the memcache service level to shared. Create a cron task that runs
every minute to save all expected queries to a key called 'cached_queries'.
Explanation
A is correct because Memcache is a managed caching service that can be
used to cache SQL queries by hashing the queries and using them as keys. A
dedicated Memcache performs better than a shared Memcache.
B is incorrect because the queries can be cached when they are run and not
periodically using CRON.
Links:
https://cloud.google.com/appengine/docs/standard/php/memcache/using
https://cloud.google.com/appengine/docs/standard/php/memcache/using#co
nfiguring_memcache
Question 13:
You need to ensure reliability for your application and operations by
supporting reliable task scheduling for compute on GCP. Leveraging
Google best practices, what should you do?
Using the Cron service provided by App Engine, publish messages directly
to a message-processing utility service running on Compute Engine
instances.
Explanation
A is incorrect because a message publishing utility is required for Compute
Engine to consume the messages from.
C is incorrect because you need to write code to publish the messages from a
Kubernetes CRON job, which is not efficient for this use case.
D is incorrect because you need to write code to publish the messages from a
Kubernetes CRON job, which is not efficient for this use case.
Links:
https://cloud.google.com/architecture/reliable-task-scheduling-compute-
engine
Question 14:
Your company is building a new architecture to support its data-centric
business focus. You are responsible for setting up the network. Your
company's mobile and web-facing applications will be deployed on-
premises, and all data analysis will be conducted in GCP. The plan is to
process and load 7 years of archived .csv files totaling 900 TB of data
and then continue loading 10 TB of data daily. You currently have an
existing 100-MB internet connection. What actions will meet your
company's needs?
Compress and upload both archived files and files uploaded daily using
the gsutil -m option.
Explanation
A is incorrect because it will take a very long time to upload 900TB of data
with a 100MB connection.
C is incorrect because the Cloud VPN will use the existing 100MB connection
and it will take a very long time to upload the daily data through it.
D is incorrect because the Cloud VPN will use the existing 100MB connection
and it will take a very long time to upload the daily data through it.
Links:
https://cloud.google.com/transfer-appliance/docs/4.0
https://cloud.google.com/network-connectivity/docs/interconnect
Question 15:
You are developing a globally scaled frontend for a legacy streaming backend
data API. This API expects events in strict chronological order with no-repeat
data for proper processing. Which products should you deploy to ensure
guaranteed-once FIFO (first-in, first-out) delivery of data?
Explanation
A is incorrect because pub/sub does not guarantee message order and only
once delivery.
Links:
https://cloud.google.com/solutions/data-lifecycle-cloud-platform
https://cloud.google.com/pubsub/docs/pubsub-dataflow
Question 16:
Your company is planning to perform a lift and shift migration of their
Linux RHEL 6.5+ virtual machines. The virtual machines are running in an
on-premises VMware environment. You want to migrate them to
Compute Engine following Google-recommended practices. What should
you do?
1. Define a migration plan based on the list of the applications and their
dependencies.
2. Migrate all virtual machines into Compute Engine individually with
Migrate for Compute Engine.
Explanation
A is incorrect because VMware machines are migrated using Compute Engine
RunBooks.
C is correct because Runbooks are created from the Migrate for Compute
Engine Manager. The system queries VMware or AWS for VMs and generates
a CSV for you to edit.
Links:
https://cloud.google.com/migrate/compute-engine/docs/4.8/how-
to/organizing-migrations/creating-and-modifying-runbooks
https://cloud.google.com/architecture/migrating-vms-migrate-for-compute-
engine-getting-started
Question 17:
You need to deploy an application to Google Cloud. The application
receives traffic via TCP and reads and writes data to the filesystem. The
application does not support horizontal scaling. The application process
requires full control over the data on the file system because concurrent
access causes corruption. The business is willing to accept a downtime
when an incident occurs, but the application must be available 24/7 to
support their business operations. You need to design the architecture of
this application on Google Cloud. What should you do?
Explanation
A is incorrect because the application does not support horizontal scaling and
thus, a managed instance group is not required.
B is incorrect because the application does not support horizontal scaling and
thus, a managed instance group is not required.
Links:
https://cloud.google.com/compute/docs/instance-groups/creating-groups-of-
unmanaged-instances
https://cloud.google.com/load-balancing/docs/network
Question 18:
Your company has an application running on multiple Compute Engine
instances. You need to ensure that the application can communicate with an
on-premises service that requires high throughput via internal IPs while
minimizing latency. What should you do?
Explanation
A is incorrect because GCP used Cloud VPN to connect to on-premise
networks and not open VPN.
B is incorrect because direct peering works on public IPs and not internal IPs.
Links:
https://cloud.google.com/network-connectivity/docs/interconnect
https://cloud.google.com/network-connectivity/docs/direct-peering
Question 19:
You are managing an application deployed on Cloud Run for Anthos, and
you need to define a strategy for deploying new versions of the
application. You want to evaluate the new code with a subset of
production traffic to decide whether to proceed with the rollout. What
should you do?
Deploy a new service to Cloud Run with the new version. Add a Cloud
Load Balancing instance in front of both services.
In the Google Cloud Console page for Cloud Run, set up continuous
deployment using Cloud Build for the development branch. As part of the
Cloud Build trigger, configure the substitution variable
TRAFFIC_PERCENTAGE with the percentage of traffic you want directed
to a new version.
In the Google Cloud Console, configure Traffic Director with a new Service
that points to the new version of the application on Cloud Run. Configure
Traffic Director to send a small percentage of traffic to the new version of
the application.
Explanation
A is correct because Cloud Run allows you to specify which revisions should
receive traffic and to specify traffic percentages that are received by a
revision. This feature allows you to roll back to a previous revision, gradually
roll out a revision, and split traffic between multiple revisions.
Links:
https://cloud.google.com/run/docs/rollouts-rollbacks-traffic-migration
Question 20:
You are monitoring Google Kubernetes Engine (GKE) clusters in a Cloud
Monitoring workspace. As a Site Reliability Engineer (SRE), you need to
triage incidents quickly. What should you do?
Write a shell script that gathers metrics from GKE nodes, publish these
metrics to a Pub/Sub topic, export the data to BigQuery, and make a Data
Studio dashboard.
Explanation
A is correct because using the predefined dashboards and creating metrics
and alerting policies is the quickest way to triage events as they occur.
Links:
https://cloud.google.com/monitoring/charts/dashboards
Question 21:
You are implementing a single Cloud SQL MySQL second-generation
database that contains business-critical transaction data. You want to
ensure that the minimum amount of data is lost in case of catastrophic
failure. Which two features should you implement? (Choose two.)
Sharding
Read replicas
Semisynchronous replication
Explanation
A is incorrect because sharding does not prevent data loss.
Links:
https://cloud.google.com/sql/docs/mysql/backup-recovery/backups
https://cloud.google.com/sql/docs/mysql/backup-recovery/pitr
Question 22:
You are working at a sports association whose members range in age
from 8 to 30. The association collects a large amount of health data,
such as sustained injuries. You are storing this data in BigQuery. Current
legislation requires you to delete such information upon request of the
subject. You want to design a solution that can accommodate such a
request. What should you do?
When ingesting new data in BigQuery, run the data through the Data Loss
Prevention (DLP) API to identify any personal information. As part of the
DLP scan, save the result to Data Catalog. Upon a deletion request, query
Data Catalog to find the column with personal information.
Create a BigQuery view over the table that contains all data. Upon a
deletion request, exclude the rows that affect the subject's data from this
view. Use this view instead of the source table for all analysis tasks.
Explanation
A is correct because using a unique identifier for all users allows us to query
and delete data related to every user with ease.
B is incorrect because here the question is to delete the data on the user’s
request and not to detect personal information.
C is incorrect because views are read-only and we cannot delete data from a
view.
D is incorrect because overwriting the unique identifier will not delete the data
as required.
Links:
https://cloud.google.com/bigquery/docs/reference/standard-sql/dml-syntax
Question 23:
Your company has announced that they will be outsourcing operations
functions. You want to allow developers to easily stage new versions of a
cloud-based application in the production environment and allow the
outsourced operations team to autonomously promote staged versions
to production. You want to minimize the operational overhead of the
solution. Which Google Cloud product should you migrate to?
GKE On-Prem
Compute Engine
Explanation
A is correct because App Engine supports versions of services. Versions of
the same service can split traffic among each other which can be used to
upgrade or downgrade versions of your app by the operations team.
B is incorrect because GKE on-premise does not have direct support for
traffic splitting like App Engine.
Links:
https://cloud.google.com/appengine/docs/standard/python/splitting-traffic
Question 24:
Your company is running its application workloads on Compute Engine.
The applications have been deployed in production, acceptance, and
development environments. The production environment is business-
critical and is used 24/7, while the acceptance and development
environments are only critical during office hours. Your CFO has asked
you to optimize these environments to achieve cost savings during idle
times. What should you do?
Create a shell script that uses the gcloud command to change the
machine type of the development and acceptance instances to a smaller
machine type outside of office hours. Schedule the shell script on one of
the production instances to automate the task.
Explanation
A is incorrect because it is better to just shut down the instances when they
are not in use than to resize them periodically.
D is incorrect because preemptible VMs can shut down at any time regardless
of office hours. The development environments are critical during office hours
using preemptible VMs can cause downtime.
Links:
https://cloud.google.com/blog/products/storage-data-transfer/save-money-
by-stopping-and-starting-compute-engine-instances-on-schedule
https://cloud.google.com/compute/docs/instances/preemptible
https://cloud.google.com/compute/docs/instance-groups
Question 25:
You are moving an application that uses MySQL from on-premises to
Google Cloud. The application will run on Compute Engine and will use
Cloud SQL. You want to cut over to the Compute Engine deployment of
the application with minimal downtime and no data loss to your
customers. You want to migrate the application with minimal
modification. You also need to determine the cutover strategy. What
should you do?
Explanation
A is incorrect because it will cause downtime during the time it takes to create
a MySQL dump, upload it to cloud storage, and load it in Cloud SQL.
B is incorrect because it will cause downtime during the time it takes to create
a MySQL dump, upload it to cloud storage, and load it in Cloud SQL.
D is incorrect because it will cause downtime during the time it takes to create
a MySQL dump, upload it to cloud storage, and load it in Cloud SQL.
Links:
https://cloud.google.com/architecture/migrating-mysql-to-cloudsql-concept
Question 26:
Your organization has decided to restrict the use of external IP addresses
on instances to only approved instances. You want to enforce this
requirement across all of your Virtual Private Clouds (VPCs). What
should you do?
Remove the default route on all VPCs. Move all approved instances into a
new subnet that has a default route to an internet gateway.
Create a new VPC in custom mode. Create a new subnet for the approved
instances, and set a default route to the internet gateway on this new
subnet.
Implement a Cloud NAT solution to remove the need for external IP
addresses entirely.
Explanation
A is incorrect because external IPs are not managed through GCP routes and
thus, removing the routes does not automatically remove public IPs from VMs.
C is incorrect because Cloud NAT is used for egress traffic and the VMs will
not be able to receive any ingress traffic from the internet without public IPs -
which is against the requirements.
Links:
https://cloud.google.com/resource-manager/docs/organization-
policy/overview
https://cloud.google.com/compute/docs/ip-addresses/reserve-static-
external-ip-address
https://cloud.google.com/nat/docs/overview
Question 27:
Your company uses the Firewall Insights feature in the Google Network
Intelligence Center. You have several firewall rules applied to Compute
Engine instances. You need to evaluate the efficiency of the applied
firewall ruleset. When you bring up the Firewall Insights page in the
Google Cloud Console, you notice that there are no log rows to display.
What should you do to troubleshoot the issue?
Enable Firewall Rules Logging for the firewall rules you want to
(Correct)
monitor.
Install the Google Cloud SDK, and verify that there are no Firewall logs in
the command line output.
Explanation
A is incorrect because VPC flow logs are separate from Firewall rules and
enabling it does not make any changes to Firewall Rule logs.
C is incorrect because if the user was not assigned a proper IAM role, an
authorization error would show up.
D is incorrect because since Firewall logs are not enabled, the Cloud SQL will
not show any logs in the command line, and thus, verifying it does not solve
the problem.
Links:
https://cloud.google.com/network-intelligence-center/docs/firewall-
insights/how-to/using-firewall-insights
https://cloud.google.com/network-intelligence-center/docs/firewall-
insights/concepts/overview
Question 28:
Your company has sensitive data in Cloud Storage buckets. Data analysts
have Identity Access Management (IAM) permissions to read the
buckets. You want to prevent data analysts from retrieving the data in
the buckets from outside the office network. What should you do?
1. Create a firewall rule for all instances in the Virtual Private Cloud (VPC)
network for source range.
2. Use the Classless Inter-domain Routing (CIDR) of the office network.
Explanation
A is correct because, For all Google Cloud services secured with VPC Service
Controls, you can ensure that resources within a perimeter are accessed only
from clients within authorized VPC networks using Private Google Access with
either Google Cloud or on-premises.
Links:
https://cloud.google.com/vpc-service-controls/docs/supported-
products#table_storage
https://cloud.google.com/vpc-service-controls/docs/overview
https://cloud.google.com/vpc/docs/configure-private-google-access-hybrid
Question 29:
You have developed a non-critical update to your application that is running in
a managed instance group, and have created a new instance template with
the update that you want to release. To prevent any possible impact on the
application, you don't want to update any running instances. You want any
new instances that are created by the managed instance group to contain the
new update. What should you do?
Explanation
A is incorrect because a rolling restart operation will restart all instances.
Links:
https://cloud.google.com/compute/docs/instance-groups/rolling-out-updates-
to-managed-instance-groups
https://cloud.google.com/compute/docs/instance-groups/updating-
migs#choosing_between_automated_and_selective_updates
https://cloud.google.com/compute/docs/instance-groups/updating-
migs#opportunistic_updates
Question 30:
Your company is designing its application landscape on Compute Engine.
Whenever a zonal outage occurs, the application should be restored in
another zone as quickly as possible with the latest application data. You
need to design the solution to meet this requirement. What should you
do?
Create a snapshot schedule for the disk containing the application data.
Whenever a zonal outage occurs, use the latest snapshot to restore the
disk in the same zone.
Create a snapshot schedule for the disk containing the application data.
Whenever a zonal outage occurs, use the latest snapshot to restore the
disk in another zone within the same region.
Configure the Compute Engine instances with an instance template for the
application, and use a regional persistent disk for the application data.
Whenever a zonal outage occurs, use the instance template to spin up the
application in another region. Use the regional persistent disk for the
application data,
Explanation
A is incorrect because we want to create the instance in another zone but this
approach suggests creating the instance in the same zone, which is not of
much use.
Links:
https://cloud.google.com/compute/docs/disks/high-availability-regional-
persistent-disk
https://cloud.google.com/compute/docs/disks/create-
snapshots#:~:text=Create%20snapshots%20to%20periodically%20back,inst
ance%20within%20the%20same%20project.
Question 31:
Your company has just acquired another company, and you have been
asked to integrate their existing Google Cloud environment into your
company's data center. Upon investigation, you discover that some of
the RFC 1918 IP ranges being used in the new company's Virtual Private
Cloud (VPC) overlap with your data center IP space. What should you do
to enable connectivity and make sure that there are no routing conflicts
when connectivity is established?
Create a Cloud VPN connection from the new VPC to the data center,
create a Cloud Router, and apply new IP addresses so there is no
overlapping IP space.
Create a Cloud VPN connection from the new VPC to the data center, and
create a Cloud NAT instance to perform NAT on the overlapping IP space.
Create a Cloud VPN connection from the new VPC to the data
center, create a Cloud Router, and apply a custom route (Correct)
advertisement to block the overlapping IP space.
Create a Cloud VPN connection from the new VPC to the data center, and
apply a firewall rule that blocks the overlapping IP space.
Explanation
A is incorrect because the overlapping IP addresses already exist and we need
to ensure connectivity between the VPC and on-prem network, thus applying
new IPs is not an option.
D is incorrect because firewall rules are separate from routes in GCP and they
don’t have any role in ensuring connectivity between overlapping IP ranges.
Links:
https://cloud.google.com/network-connectivity/docs/router/how-
to/advertising-overview
https://cloud.google.com/nat/docs/overview
https://cloud.google.com/network-connectivity/docs/router/how-
to/advertising-custom-ip
Question 32:
You need to migrate Hadoop jobs for your company's Data Science team
without modifying the underlying infrastructure. You want to minimize
costs and infrastructure management effort. What should you do?
Explanation
A is incorrect because preemptible worker instances can provide more cost
savings compared to standard VMs.
Links:
https://cloud.google.com/dataproc/docs/concepts/compute/secondary-
vms#preemptible_and_non-preemptible_secondary_workers
https://cloud.google.com/architecture/hadoop/hadoop-gcp-migration-
overview
Question 33:
Your company has a project in Google Cloud with three Virtual Private Clouds
(VPCs). There is a Compute Engine instance on each VPC. Network subnets
do not overlap and must remain separated. The network configuration is
shown below. Instance #1 is an exception and must communicate directly with
both Instance #2 and Instance #3 via internal IPs. How should you accomplish
this?
Create two VPN tunnels via CloudVPN: 1 between VPC #1 and VPC #2 and
1 between VPC #2 and VPC #3. Update firewall rules to enable traffic
between the instances.
Peer all three VPCs: Peer VPC #1 with VPC #2 and peer VPC #2 with VPC
#3. Update firewall rules to enable traffic between the instances.
Explanation
A is incorrect because Cloud Router cannot create routes to instances that are
outside its network(separate VPCs).
Links:
https://cloud.google.com/vpc/docs/create-use-multiple-interfaces
Question 34:
You need to deploy an application on Google Cloud that must run on a
Debian Linux environment. The application requires extensive
configuration in order to operate correctly. You want to ensure that you
can install Debian distribution updates with minimal manual intervention
whenever they become available. What should you do?
Create a Compute Engine instance template using the most recent Debian
image. Create an instance from this template, and install and configure the
application as part of the startup script. Repeat this process whenever a
new Google-managed Debian image becomes available.
Create an instance with the latest available Debian image. Connect to the
instance via SSH, and install and configure the application on the
instance. Repeat this process whenever a new Google-managed Debian
image becomes available.
Create a Docker container with Debian as the base image. Install and
configure the application as part of the Docker image creation process.
Host the container on Google Kubernetes Engine and restart the container
whenever a new update is available.
Explanation
A is incorrect because repeating the deployment process every time a new
Debian image gets made available is not scalable.
Links:
https://cloud.google.com/compute/docs/os-patch-management
https://cloud.google.com/blog/products/compute/using-compute-engines-os-
patch-management-service
Question 35:
You have an application that runs in Google Kubernetes Engine (GKE).
Over the last 2 weeks, customers have reported that a specific part of
the application returns errors very frequently. You currently have no
logging or monitoring solution enabled on your GKE cluster. You want to
diagnose the problem, but you have not been able to replicate the issue.
You want to cause minimal disruption to the application. What should you
do?
1. Create a new GKE cluster with Cloud Operations for GKE enabled.
2. Migrate the affected Pods to the new cluster, and redirect traffic for
those Pods to the new cluster.
3. Use the GKE Monitoring dashboard to investigate logs from affected
Pods.
1. Update your GKE cluster to use Cloud Operations for GKE, and
deploy Prometheus.
(Correct)
2. Set an alert to trigger whenever the application returns an
error.
1. Create a new GKE cluster with Cloud Operations for GKE enabled, and
deploy Prometheus.
2. Migrate the affected Pods to the new cluster, and redirect traffic for
those Pods to the new cluster.
3. Set an alert to trigger whenever the application returns an error.
Explanation
A is incorrect because updating the cluster to use Cloud Operations for GKE
will enable logging for the application but the logs can be viewed in
Stackdriver Logging and not in GKE Monitoring.
C is correct because updating the cluster to use Cloud Operations for GKE
will enable logging for the application. Prometheus can be used to collect
custom metrics from the deployed application and the best way to detect
errors proactively is to set alerts in Stackdriver to notify the correct people
when an error occurs.
Links:
https://cloud.google.com/stackdriver/docs/solutions/gke
https://prometheus.io/
https://cloud.google.com/error-reporting/docs/notifications
Question 36:
You need to deploy a stateful workload on Google Cloud. The workload can
scale horizontally, but each instance needs to read and write to the same
POSIX filesystem. At a high load, the stateful workload needs to support up to
100 MB/s of writes. What should you do?
Explanation
A is incorrect because It is possible to attach a persistent disk to more than
one instance. However, if you attach a persistent disk to multiple instances, all
instances must attach the persistent disk in read-only mode. It is not possible
to attach the persistent disk to multiple instances in read-write mode.
D is incorrect because even though GCS Fuse can be used to allow multiple
instances to write to the same storage, Cloud Storage FUSE has much higher
latency than a local file system and one of the requirements is to have fast
read/write speed.
Links:
https://cloud.google.com/filestore/docs/mounting-fileshares
https://cloud.google.com/filestore
https://cloud.google.com/storage/docs/gcs-fuse#notes
Question 37:
Your company has an application deployed on Anthos clusters (formerly
Anthos GKE) that are running multiple microservices. The cluster has both
Anthos Service Mesh and Anthos Config Management configured. End users
inform you that the application is responding very slowly. You want to identify
the microservice that is causing the delay. What should you do?
Reinstall istio using the default istio profile in order to collect request
latency. Evaluate the telemetry between the microservices in the Cloud
Console.
Explanation
A is correct because the Anthos Service Mesh pages in the Google Cloud
Console provide both summary and in-depth metrics, charts, and graphs that
enable you to observe service behavior. You can monitor the overall health of
your services, or drill down on a specific service to set a service level
objective (SLO) or troubleshoot an issue.
Links:
https://cloud.google.com/service-mesh/docs/observability/explore-dashboard
https://cloud.google.com/anthos/config-management
Question 38:
You are working at a financial institution that stores mortgage loan
approval documents on Cloud Storage. Any change to these approval
documents must be uploaded as a separate approval file, so you want to
ensure that these documents cannot be deleted or overwritten for the
next 5 years. What should you do?
Create the bucket with uniform bucket-level access, and grant a service
account the role of Object Writer. Use the service account to upload new
files.
Use a customer-managed key for the encryption of the bucket. Rotate the
key after 5 years.
Create the bucket with fine-grained access control, and grant a service
account the role of Object Writer. Use the service account to upload new
files.
Explanation
A is correct because a bucker retention policy for 5 years ensures that the
objects in the bucket cannot be overwritten or deleted before 5 years.
Links:
https://cloud.google.com/storage/docs/bucket-lock
Question 39:
Your team will start developing a new application using microservices
architecture on Kubernetes Engine. As part of the development lifecycle, any
code change that has been pushed to the remote development branch on
your GitHub repository should be built and tested automatically. When the
build and test are successful, the relevant microservice will be deployed
automatically in the development environment. You want to ensure that all
code deployed in the development environment follows this process. What
should you do?
Install a post-commit hook on the remote git repository that tests the
code and builds the container when code is pushed to the development
branch. After a successful commit, have the developer deploy the newly
built container image on the development cluster.
Explanation
A is incorrect because asking all developers to set up commit-hooks locally is
not scalable as some people might choose to not follow the required process
and untested code might end up being deployed.
C is correct because a cloud build pipeline can test and build the code and
store it in the Container Registry. Another pipeline that watches for new
images can use the newly uploaded image and deploy it to the required
environment.
Links:
https://cloud.google.com/build/docs
https://cloud.google.com/container-analysis/docs/container-scanning-
overview
Question 40:
Your operations team has asked you to help diagnose a performance
issue in a production application that runs on Compute Engine. The
application is dropping requests that reach it when under heavy load.
The process list for affected instances shows a single application
process that is consuming all available CPU, and autoscaling has reached
the upper limit of instances. There is no abnormal load on any other
related systems, including the database. You want to allow production
traffic to be served again as quickly as possible. Which action should you
recommend?
Explanation
A is incorrect because changing the auto-scaling metric will not do anything
as the autoscaling has already reached the upper limit of instances and yet
the requests are failing.
D is correct because the quickest way to reduce the saturation levels on the
cluster is to increase the upper limit of instances and let the system scale up
to handle the required amount of load.
Links:
https://cloud.google.com/compute/docs/instance-groups/creating-groups-of-
managed-instances
https://acloudguru.com/hands-on-labs/creating-a-load-balanced-managed-
instance-group-on-google-cloud-platform
Question 41:
You are implementing the infrastructure for a web service on Google
Cloud. The web service needs to receive and store the data from
500,000 requests per second. The data will be queried later in real time,
based on exact matches of a known set of attributes. There will be
periods where the web service will not receive any requests. The
business wants to keep costs low. Which web service platform and
database should you use for the application?
Explanation
A is incorrect because the records will need to be loaded in Bigquery via
streaming inserts which are expensive. Also, the data will be queried later in
real-time, based on exact matches of a known set of attributes, which means
there will not be any advanced queries on data, thus using Bigquery is not the
best option here.
Links:
https://cloud.google.com/run/pricing
https://cloud.google.com/blog/topics/developers-practitioners/bigtable-vs-
bigquery-whats-difference
https://cloud.google.com/bigtable
Question 42:
You are developing an application using different microservices that
should remain internal to the cluster. You want to be able to configure
each microservice with a specific number of replicas. You also want to be
able to address a specific microservice from any other microservice in a
uniform way, regardless of the number of replicas the microservice
scales to. You need to implement this solution on Google Kubernetes
Engine. What should you do?
Deploy each microservice as a Pod. Expose the Pod in the cluster using a
Service, and use the Service DNS name to address the microservice from
other microservices within the cluster.
Deploy each microservice as a Pod. Expose the Pod in the cluster using an
Ingress, and use the Ingress IP address name to address the Pod from
other microservices within the cluster.
Explanation
A is correct because a Deployment provides declarative updates for Pods
and ReplicaSets which can be used to create multiple replicas of the pods
running under the deployment. A clusterIP service exposed the deployment
internally, which can be used by other services to communicate with the pods
using DNS names.
Links:
https://kubernetes.io/docs/concepts/workloads/controllers/deployment/
https://kubernetes.io/docs/concepts/services-networking/service/
Question 43:
Your company has a networking team and a development team. The
development team runs applications on Compute Engine instances that
contain sensitive data. The development team requires administrative
permissions for Compute Engine. Your company requires all network
resources to be managed by the networking team. The development
team does not want the networking team to have access to the sensitive
data on the instances. What should you do?
1. Create a project with a standalone VPC and assign the Network Admin
role to the networking team.
2. Create a second project with a standalone VPC and assign the Compute
Admin role to the development team.
3. Use Cloud VPN to join the two VPCs.
1. Create a project with a Shared VPC and assign the Network Admin role
to the networking team.
2. Create a second project without a VPC, configure it as a Shared VPC
service project, and assign the Compute Admin role to the development
team.
1. Create a project with a standalone VPC and assign the Network Admin
role to the networking team.
2. Create a second project with a standalone VPC and assign the Compute
Admin role to the development team.
3. Use VPC Peering to join the two VPCs.
Explanation
A is incorrect because there is no need to create 2 separate VPCs for the two
teams.
Links:
https://cloud.google.com/compute/docs/access/iam#compute.networkAdmin
https://cloud.google.com/compute/docs/access/iam#compute.admin
Question 44:
Your company wants you to build a highly reliable web application with a
few public APIs as the backend. You don't expect a lot of user traffic, but
traffic could spike occasionally. You want to leverage Cloud Load
Balancing, and the solution must be cost-effective for users. What
should you do?
Store static content such as HTML and images in Cloud CDN. Host the
APIs on App Engine and store the user data in Cloud SQL.
Store static content such as HTML and images in a Cloud Storage bucket.
Host the APIs on a zonal Google Kubernetes Engine cluster with worker
nodes in multiple zones, and save the user data in Cloud Spanner.
Store static content such as HTML and images in Cloud CDN. Use Cloud
Run to host the APIs and save the user data in Cloud SQL.
Explanation
A is incorrect because you cannot store HTML and static content on Cloud
CDN. It is used to cache static content which is stored at other places(Cloud
Storage).
C is incorrect because you cannot store HTML and static content on Cloud
CDN. It is used to cache static content which is stored at other places(Cloud
Storage).
Links:
https://cloud.google.com/storage/pricing
https://cloud.google.com/functions
https://firebase.google.com/docs/firestore
Question 45:
Your company sends all Google Cloud logs to Cloud Logging. Your
security team wants to monitor the logs. You want to ensure that the
security team can react quickly if an anomaly such as an unwanted
firewall change or server breach is detected. You want to follow Google-
recommended practices. What should you do?
Schedule a cron job with Cloud Scheduler. The scheduled job queries the
logs every minute for the relevant events.
Export logs to a Pub/Sub topic, and trigger Cloud Function with the
relevant log events.
Export logs to a Cloud Storage bucket, and trigger Cloud Run with the
relevant log events.
Explanation
A is incorrect because you need to write custom code to analyze the logs
using CRON jobs, which is inefficient and error-prone.
D is incorrect because you need to write custom code to analyze the logs
using Cloud Run. Writing SQL is better for anomaly detection than custom
code.
Links:
https://cloud.google.com/logging/docs/export
https://www.brainlabsdigital.com/marketing-library/the-complete-guide-to-
log-analysis-with-big-query/
Question 46:
You have deployed several instances on Compute Engine. As a security
requirement, instances cannot have a public IP address. There is no VPN
connection between Google Cloud and your office, and you need to
connect via SSH into a specific machine without violating the security
requirements. What should you do?
Configure Cloud NAT on the subnet where the instance is hosted. Create
an SSH connection to the Cloud NAT IP address to reach the instance.
Create a bastion host in the network to SSH into the bastion host from
your office location. From the bastion host, SSH into the desired instance.
Explanation
A is incorrect because Cloud NAT is used for outbound connections and not
for Inbound connections.
Links:
https://cloud.google.com/iap/docs/using-tcp-forwarding
Question 47:
Your company is using Google Cloud. You have two folders under the
Organization: Finance and Shopping. The members of the development team
are in a Google Group. The development team group has been assigned the
Project Owner role in the Organization. You want to prevent the development
team from creating resources in projects in the Finance folder. What should
you do?
Assign the development team group the Project Viewer role on the
Finance folder, and assign the development team group the Project Owner
role on the Shopping folder.
Assign the development team group only the Project Viewer role on the
Finance folder.
Assign the development team group only the Project Owner role on the
Shopping folder.
Explanation
A is incorrect because IAM policies are hierarchical and propagate down the
structure. The effective policy for a resource is the union of the policy set at
that resource and the policy inherited from its parent. Permission granted at
the organization level cannot be removed at the folder or project level.
B is incorrect because IAM policies are hierarchical and propagate down the
structure. The effective policy for a resource is the union of the policy set at
that resource and the policy inherited from its parent. Permission granted at
the organization level cannot be removed at the folder or project level.
C is correct because you need to remove the access at the Organization level
to prevent the development team group from getting access to the projects in
the Finance folder.
D is incorrect because IAM policies are hierarchical and propagate down the
structure. The effective policy for a resource is the union of the policy set at
that resource and the policy inherited from its parent. Permission granted at
the organization level cannot be removed at the folder or project level.
Links:
https://cloud.google.com/iam/docs/resource-hierarchy-access-control
Question 48:
You are developing your microservices application on Google Kubernetes
Engine. During testing, you want to validate the behavior of your
application in case a specific microservice should suddenly crash. What
should you do?
Add a taint to one of the nodes of the Kubernetes cluster. For the specific
microservice, configure a pod anti-affinity label that has the name of the
tainted node as a value.
Explanation
A is incorrect because we want to observe the behavior when a microservice
crashes and not for node failure.
B is correct because Istio Fault Injection allows you to inject faults to test the
resiliency of your application.
Links:
https://istio.io/latest/docs/tasks/traffic-management/fault-injection/
Question 49:
Your company is developing a new application that will allow globally
distributed users to upload pictures and share them with other selected
users. The application will support millions of concurrent users. You
want to allow developers to focus on just building code without having to
create and maintain the underlying infrastructure. Which service should
you use to deploy the application?
Cloud Endpoints
Compute Engine
Explanation
A is correct because App Engine is a platform as a service that allows
developers to just focus on their code and does not require any provisioning
or maintenance of infrastructure. It also scales horizontally based on load.
B is incorrect because Cloud Endpoints is used for building and deploying
APIs and not full-fledged applications.
Links:
https://cloud.google.com/appengine
https://cloud.google.com/endpoints
Question 50:
Your company provides a recommendation engine for retail customers.
You are providing retail customers with an API where they can submit a
user ID and the API returns a list of recommendations for that user. You
are responsible for the API lifecycle and want to ensure stability for your
customers in case the API makes backward-incompatible changes. You
want to follow Google-recommended practices. What should you do?
Use a versioning strategy for the APIs that increases the version
(Correct)
number on every backward-incompatible change.
Use a versioning strategy for the APIs that adds the suffix 'DEPRECATED'
to the current API version number on every backward-incompatible
change. Use the current version number for the new API.
Explanation
A is incorrect because creating a distribution list to inform all customers
whenever a backward-incompatible change is published is a manual process
and it is not scalable. The customers need to make updates from their side to
make use of the updated APIs, which might take time.
C is correct because a versioning strategy for the APIs will ensure that the
customers’ applications do not break when a backward-incompatible update
is released. The customers can keep using the old APIs and update them to
the newer version as and when required.
D is incorrect because changing the existing API prefix will break the
applications of the customers who are using that API.
Links:
https://restfulapi.net/versioning/
Question 51:
Your company has developed a monolithic, 3-tier application to allow
external users to upload and share files. The solution cannot be easily
enhanced and lacks reliability. The development team would like to re-
architect the application to adopt microservices and a fully managed
service approach, but they need to convince their leadership that the
effort is worthwhile. Which advantage(s) should they highlight to
leadership?
Explanation
A is incorrect microservices are not necessarily cheaper than monolithic
applications.
Links:
https://solace.com/blog/microservices-advantages-and-disadvantages/
Question 52:
Your team is developing a web application that will be deployed on
Google Kubernetes Engine (GKE). Your CTO expects a successful launch
and you need to ensure your application can handle the expected load of
tens of thousands of users. You want to test the current deployment to
ensure the latency of your application stays below a certain threshold.
What should you do?
Replicate the application over multiple GKE clusters in every Google Cloud
region. Configure a global HTTP(S) load balancer to expose the different
clusters over a single global IP address.
Explanation
A is correct because a load testing tool can simulate the required amount of
traffic and provide insights for latency and performance metrics.
Links:
https://jmeter.apache.org/
https://cloud.google.com/debugger
Question 53:
Your company wants to deploy several microservices to help its system
handle elastic loads. Each microservice uses a different version of software
libraries. You want to enable their developers to keep their development
environment in sync with the various production services. Which technology
should you choose?
A. RPM/DEB
B. Containers (Correct)
C. Chef/Puppet
D. Virtual machines
Explanation
A is not correct because although OS packages are a convenient way to
distribute and deploy libraries, they don't directly help with synchronizing.
Even with a common repository, the development environments will probably
deviate from production.
D is not correct because virtual machines run their own OS, which will
eventually deviate in each environment, just as now.
Question 54:
Your company wants to track whether someone is present in a meeting room
reserved for a scheduled meeting. There are 1000 meeting rooms across 5
offices on 3 continents. Each room is equipped with a motion sensor that
reports its status every second. You want to support the data ingestion needs
of this sensor network. The receiving infrastructure needs to account for the
possibility that the devices may have inconsistent connectivity. Which solution
should you design?
B. Have devices poll for connectivity to Cloud SQL and insert the latest
messages on a regular interval to a device-specific table.
Explanation
A is not correct because having a persistent connection does not handle the
case where the device is disconnected.
B is not correct because Cloud SQL is a regional, relational database and not
the best fit for sensor data. Additionally, the frequency of the writes has the
potential to exceed the supported number of concurrent connections.
C is correct because Cloud Pub/Sub can handle the frequency of this data,
and consumers of the data can pull from the shared topic for further
processing.
D is not correct because having a persistent connection does not handle the
case where the device is disconnected.
Links:
https://cloud.google.com/sql/
https://cloud.google.com/pubsub/
Question 55:
Your organization has a 3-tier web application deployed in the same Google
Cloud Virtual Private Cloud (VPC). Each tier (web, API, and database) scales
independently of the others. Network traffic should flow through the web to
the API tier, and then on to the database tier. Traffic should not flow between
the web and the database tier. How should you configure the network with
minimal steps?
Add tags to each tier and set up routes to allow the desired traffic flow.
Add tags to each tier and set up firewall rules to allow the desired
(Correct)
traffic flow.
Explanation
A is not correct because the subnetwork alone will not allow and restrict
traffic as required without firewall rules.
B is not correct because this adds complexity to the architecture and the
instance configuration.
C is not correct because routes still require firewall rules to allow traffic as
requests. Additionally, the tags are used for defining the instances the route
applies to, and not for identifying the next hop. The next hop is either an IP
range or instance name, but in the proposed solution the tiers are only
identified by tags.
D is correct because as instances scale, they will all have the same tag to
identify the tier. These tags can then be leveraged in firewall rules to allow and
restrict traffic as required because tags can be used for both the target and
source.
Links:
https://cloud.google.com/vpc/docs/using-vpc
https://cloud.google.com/vpc/docs/routes
https://cloud.google.com/vpc/docs/add-remove-network-tags
Gcp cloud
professional
architect