GCP Flashcards
Your company decided to use the Google Kubernetes Engine service with local PersistentVolumes to handle its batch processing jobs. These jobs only run overnight to process non-critical workloads and can be restarted at any time. You are tasked to
deploy the most cost-effective solution
What should you do?
A. Create a Google Kubernetes Engine Cluster. Enable autoscaling to automatically create and delete nodes.
B. Create a Google Kubernetes Engine Cluster and enable the node
auto-provisioning feature.
C. Create a Google Kubernetes Engine Cluster and enable Vertical Pod Autoscaling using the VerticalPodAutoscaler custom resource.
D. Create a Google Kubernetes Engine Cluster. Create a node pool and select the Enable preemptible nodes checkbox
D. Create a Google Kubernetes Engine Cluster. Create a node pool and select the Enable preemptible nodes checkbox.
Your team manager wants you to configure a group of autohealing Compute Engine instances that run on multiple zones for network load balancing. You want to accomplish this task with the least amount of steps possible. You have to ensure that all the Compute Engine instances are automatically recreated if they are unresponsive after three attempts with a 10-second interval.
What should you do?
A. Build a managed instance group. Activate the autoscaling setting.
B. Provision an HTTP load balancer that references its backend to an existinginstance group. Specify a balancing mode and set the maximum RPS (request per second) to 10.
C. Build a managed instance group. Set the Autohealing health check to healthy (HTTP).
D. Provision an HTTP load balancer that references its backend to an existing instance group. Configure the health check to healthy (HTTP).
C. Build a managed instance group. Set the Autohealing health check to healthy (HTTP).
Your team is developing a new application for your company. You want to use Jenkins as your CI/CD solution for your application. You want to deploy this solution as quickly as possible.
What should you do?
A. Deploy a new Kubernetes Engine cluster. Use kubectl to create deployment using Jenkins docker image.
B. Create an instance template with the Jenkins installation script as a startup script. Use the template to launch a managed instance group.
C. Go to Google Cloud Marketplace in the GCP console and search for Jenkins. Select and configure the appropriate Jenkins solution.
D. Deploy a new Compute Engine instance. Download and execute the Jenkins installer.
C. Go to Google Cloud Marketplace in the GCP console and search for Jenkins. Select and configure the appropriate Jenkins solution.
Your company has a live application deployed in a Google App Engine environment. You developed a new version of the application containing several new enhancements and you want to test it first with only 1% of users before entirely switching over to the
new version.
What should you do?
A. Use gcloud app create to deploy a new app with –traffic-split flag to split the traffic between the current and new app.
B. Deploy a new application that includes the enhancements. Configure App Engine to split traffic between the two applications.
C. Use gcloud app deploy to deploy a new version of the app with
–traffic-split flag to split the traffic between the current and new version.
D. Deploy a new version of the app that includes the enhancements. Configure App Engine to split traffic between the current and new versions.
D. Deploy a new version of the app that includes the enhancements. Configure App Engine to split traffic between the current and new versions.
Your team leader wants to get an email whenever a file is deleted from a Cloud Storage bucket. In relation to this, you created a program that accomplishes this requirement
and you are now ready to deploy.
What should you do?
A. Create a batch job with your code by using Cloud Dataflow. Configure the bucket as a data source.
B. Deploy your program to Google Kubernetes Engine (GKE). Configure a cron job to trigger the application using Cloud Pub/Sub.
C. Utilize App Engine and configure Cloud Scheduler to trigger the application using a Pub/Sub subscription.
D. Deploy your code to Google Cloud Functions. Set a Cloud Storage trigger when an object is deleted from your bucket.
D. Deploy your code to Google Cloud Functions. Set a Cloud Storage trigger when an object is deleted from your bucket.
Your company is planning to launch a web application to App Engine. It is crucial that your application can dynamically scale up and down based on the request rate. Moreover, you want to ensure that you have at least 3 unoccupied VMs at all times.
How should you configure your App Engine to support these scaling requirements?
A. Configure Basic Scaling setting with min_instances set to 3.
B. Configure Basic Scaling setting with max_instances set to 3.
C. Set Automatic Scaling settings with min_idle_instances set to 3.
D. Set Manual Scaling settings to 3 instances.
C. Set Automatic Scaling settings with min_idle_instances set to 3.
You are in charge of maintaining your organization’s GCP infrastructure and you need to perform some significant changes. You have to find a way to share the proposed changes with your entire team before deployment. You want to follow Google’s
recommended best practices.
What should you do?
A. Create Deployment Manager templates to define the proposed changes and save them into a Cloud Storage bucket.
B. Create Deployment Manager templates to define the proposed changes and save them into Cloud Source Repositories.
C. Manually perform the changes in the development environment. Execute the gcloud compute instances list command and store the displayed output into Cloud Source Repositories.
C. Manually perform the changes in the development environment. Execute the gcloud compute instances list command and store the displayed output into a Cloud Storage bucket.
A. Create Deployment Manager templates to define the proposed changes and save them into a Cloud Storage bucket.
You developed an application packaged in a container image and you are ready to deploy it on the Google Cloud Platform. You want to deploy the application to a cost-effective GCP service that provides a stable out-of-the-box HTTPS endpoint. The application only receives few client requests per day.
What should you do?
A. Use Cloud Run to deploy the container image.
B. Use a Compute Engine instance with Cloud IAP enabled to deploy the container image.
C. Use App Engine Flexible to deploy the container image.
D. Use Google Kubernetes Engine to create a cluster with horizontal pod scaling and cluster autoscaling enabled. Deploy the container image on the infrastructure you just created.
A. Use Cloud Run to deploy the container image.
You are training four newly hired junior cloud engineers in your company. Part of their training is to familiarize themselves with Cloud Spanner. You need to provide access to these four users to view and edit table information on a Cloud Spanner instance found in the test project.
What should you do?
A. Using the gcloud tool, execute the gcloud iam roles describe
roles/spanner.databaseUser command on Cloud Shell. Attach the users to the role.
B. Using the gcloud tool, execute the gcloud iam roles describe
roles/spanner.databaseUser command on Cloud Shell. Attach the users to a newly created Google group and add the group to the role.
C. Using the gcloud tool, execute the gcloud iam roles describe
roles/spanner.viewer –project my-project command on Cloud Shell.
Attach the users to the role.
D. Using the gcloud tool, execute the gcloud iam roles describe
roles/spanner.viewer –project my-project command on Cloud Shell.
Attach the users to a newly created Google group and add the group to the role
B. Using the gcloud tool, execute the gcloud iam roles describe
roles/spanner.databaseUser command on Cloud Shell. Attach the users to a
newly created Google group and add the group to the role.
Your team is building a cost-effective Disaster Recovery solution for your company.
You are tasked to archive 5 TB worth of data in Cloud Storage that is only accessed quarterly.
What should you do?
A. Use the Archive Storage class to store the data.
B. Use the Coldline Storage class to store the data.
C. Use the Nearline Storage class to store the data.
D. Use the Standard Storage class to store the data.
B. Use the Coldline Storage class to store the data.
You are asked to get a list of all the enabled APIs for all of the GCP Projects on your company’s GCP account as preparation for the upcoming audit. You have been instructed to use the gcloud command-line tool to complete this task.
What should you do?
A. Use the gcloud projects get-list command to get the Project ID. Invoke the gcloud services list –project {ProjectID} command to get the list of enabled GCP APIs.
B. Use the gcloud projects list command to get the Project ID. Invoke the gcloud services list –project {ProjectID} command to get the list of enabled GCP APIs.
C. Use the gcloud projects list command to get the Project ID. Invoke the gcloud services list –available –project {ProjectID} command to
get the list of enabled GCP APIs.
D. Use gcloud projects get-list command to get the Project ID. Invoke the gcloud services list –available –project {ProjectID} command to
get the list of enabled GCP APIs.
B. Use the gcloud projects list command to get the Project ID. Invoke the gcloud services list –project {ProjectID} command to get the list of enabled GCP APIs.
Your team is hosting a website on Google Cloud Storage (GCS). On the website, you provided links to PDF files found on your Cloud Storage. You noticed that the browser always prompts you to save the files on your local machine when you click the links on
the website. You want the PDF files to be displayed on the browser window right away instead of prompting users to save the files locally.
What should you do?
A. Activate Cloud CDN on your website
B. Edit the PDF objects in Cloud Storage and reconfigure their Content-Type metadata into application/pdf.
C. Activate the “Share publicly” setting on all the PDF objects in the bucket.
D. Add a new label to the GCS bucket with a key of Content-Type and value of application/pdf.
B. Edit the PDF objects in Cloud Storage and reconfigure their Content-Type metadata into application/pdf.
Your team is building an application hosted on a VM instance in Compute Engine. The application is designed to enhance and resize images. You want your application to be able to upload images on a Cloud Storage bucket. You want to do this with the least
number of steps possible without compromising security.
What should you do?
A. Create a Service Account with roles/storage.objectCreator (Storage Object Creator) role. Configure the VM instance to use the Service Account.
B. Create a Service Account with roles/storage.objectAdmin (Storage Object Admin) role. Configure the VM instance to use the Service Account.
C. Verify if the VM instance and the bucket have the same region.
D. Set the Cloud Storage bucket to public and configure the objects to have a randomized suffix in its object name.
A. Create a Service Account with roles/storage.objectCreator (Storage Object Creator) role. Configure the VM instance to use the Service Account.
Your company has decided to use Google Cloud Platform to host their applications. Your network team created a VPC on GCP and connected it to your company’s on-premises network via a secure VPN. You need to create a GCE instance to host an application. This instance should not be accessible from the public Internet.
What should you do?
A. Create the GCE instance outside the VPC.
B. Create the GCE instance with a deny-all egress firewall.
C. Create the GCE instance and enable the Private Google Access option.
D. Create the GCE instance with no External IP address.
D. Create the GCE instance with no External IP address.
Your development team wants to migrate an on-premises web application, which is hosted in multiple VMs, to the Google Cloud Platform. The new cloud infrastructure must be highly available and can scale automatically based on CPU usage. You must also be able to access the new VMs directly. You need to implement this with the least number of steps while maintaining operational efficiency.
What should you do?
A. Build an instance template on Compute Engine. Using the template, configure a managed instance group that scales vertically based on your preferred time of day.
B. Build an instance template on Compute Engine. Using the template, configure a managed instance group and enable autoscaling.
C. Deploy your application using Google Kubernetes Engine and enable horizontal pod autoscaling.
D. Research and implement third-party tools to build an automated workflow that scales the application up and down accordingly based on Cloud Monitoring CPU usage metrics.
B. Build an instance template on Compute Engine. Using the template, configure a managed instance group and enable autoscaling.
Your company created a Dataproc cluster running on a Virtual Private Cloud (VPC) network within a single subnet with a CIDR range of 10.0.0.0/24. You have to deploy new VMs that can communicate with your existing cluster. However, there are neither private nor alias IP addresses available that you can use in the VPC network. You must deploy the VMs with the least possible steps.
What should you do?
A. Expand the existing subnet range to 10.0.0.0/23.
B. Set up a new Secondary CIDR Range in the VPC. Configure the VMs to use IPs from the new CIDR range.
C. Set up a new VPC network and deploy the new VMs to it. Activate VPC Peering between the new VPC network and the Dataproc cluster’s VPC network.
D. Set up a new VPC network and deploy the new VMs to it with a subnet of 10.0.1.0/24. Perform VPC Network Peering between the Dataproc VPC network and the new VPC network. Set up a custom Route exchange between these networks.
C. Set up a new VPC network and deploy the new VMs to it. Activate VPC Peering between the new VPC network and the Dataproc cluster’s VPC network.
Your team deployed a new application on a VM instance on Google Compute Engine. You are expecting large traffic in the next coming weeks as your application becomes more popular. You want to launch multiple copies of your instance to handle this
traffic. You want to follow Google’s recommended best practices.
What should you do?
A. Create a snapshot of your instance’s base VM. Use the snapshot to launch new instances.
B. Create a snapshot of your instance boot disk. Create a custom image from the snapshot. Use the custom image to launch new instances.
C. Create a snapshot of your instance’s base VM. Use the snapshot to handle the large traffic.
D. Create a snapshot of your instance boot disk. Create a custom image from the snapshot to handle the large traffic
B. Create a snapshot of your instance boot disk. Create a custom image from the snapshot. Use the custom image to launch new instances.
Your team wants to deploy several VMs on Compute Engine. Part of the plan is to spin up the required VMs using a dedicated YAML file to ensure that all VMs are deployed correctly and consistently. You want to follow Google’s best practices.
Which method should you choose?
A. Managed Instance Group
B. Unmanaged Instance Group
C. Deployment Manager
D. Cloud Composer
A. Managed Instance Group
You have created a GCP project in the development environment to build and test various applications. Cloud SQL, Compute Engine, and Cloud Storage service are being heavily utilized by your applications and other system components. You need to set up a production environment for the company’s enterprise applications. You have to
ensure that the new production environment cannot connect or share resources with the development environment via any routes.
What should you do?
A. Create a new subnet for the production environment under the existing VPC. Verify if the necessary APIs are enabled. Ask the developer team to deploy the application in the new subnet.
B. Create a new project for the production environment. Enable APIs necessary for the application. Establish VPC Peering between the VPC on development and production environment. Ask the developer team to deploy the application in the
new project.
C. Create a new project as a host project for the Shared VPC. Attach the VPC from the development environment to the host project. Ask the developer team to deploy the application in the host project.
D. Create a new project for the production environment. Enable APIs necessary for the application. Ask the developer team to deploy the application in the new
project.
D. Create a new project for the production environment. Enable APIs necessary for the application. Ask the developer team to deploy the application in the new
project.
You are sharing a GCP project with your company’s mobile app development team. You are ready to deploy your web application, and you need to provision a Compute Engine instance. You don’t want the mobile development team accidentally deleting your instance from the project.
What should you do?
A. Provision a Preemptible VM.
B. Utilize a Shielded VM.
C. Activate the Enable Deletion Protection setting in the Compute Engine page using the Cloud Console.
D. Build an instance group
C. Activate the Enable Deletion Protection setting in the Compute Engine page using the Cloud Console.
You have a microservice running on Google Kubernetes Engine (GKE) cluster running on asia-southeast1 region. The GKE cluster has the autoscaler feature enabled. You realized that you need to monitor containers in your cluster. You have to deploy a monitoring pod on each node of your cluster that transmits container metrics to a
third-party cloud monitoring system.
What should you do?
A. Create a Service object that references the monitoring pod.
B. Deploy the monitoring pod into your GKE cluster inside a StatefulSet object.
C. Reference the monitoring pod into your cluster in a Deployment object.
D. Deploy the monitoring pod into your cluster in a DaemonSet object.
D. Deploy the monitoring pod into your cluster in a DaemonSet object.
Your team recently created a new deployment that creates two replicas in a Google Kubernetes Engine (GKE) cluster configured with a single preemptible node pool. After waiting for a few minutes, you noticed that the Pod’s status is still Pending after running kubectl get pods command.
What is the most likely cause of this issue? (*theres a screen shot in docs)
A. The pending Pod’s resource request is too small for the single cluster node
B. The pending Pod is stuck and can’t be scheduled to a node. There are too many Pods running in the cluster, and you don’t have enough node resources left.
C. The pending Pod was scheduled on a node that was getting preempted. You need to wait while it’s being scheduled to a new node.
D. The service account used for the node pool does not have the right permissions to pull images from Container Registry
B. The pending Pod is stuck and can’t be scheduled to a node. There are too many Pods running in the cluster, and you don’t have enough node resources left.
Your company has deployed multiple GCP resources that span across various projects and are linked to different billing accounts. Your finance team is currently analyzing cost patterns on your company’s cloud expenditure and asked you to provide a
dashboard to visualize all the costs incurred. You want to finish the task as quickly as possible.
What should you do?
A. Export your Cloud Billing data to BigQuery. Use the Data Catalog to visualize the Cloud Billing data.
B. Export your Cloud Billing data to BigQuery. Use Google Data Studio to visualize the data.Go to the Billing page in the GCP Console.
C. Export your Cloud Billing data to a CSV file.
D. Use the GCP Pricing Calculator to analyze the cost.
B. Export your Cloud Billing data to BigQuery. Use Google Data Studio to visualize the data.Go to the Billing page in the GCP Console.
You are the head engineer of a software development organization, and you control the IAM access for everyone. You granted the Project Creator role to all engineering team users, but you don’t want them to link projects to a billing account. It is also
essential that the finance team can link projects to a billing account, but they should not have the privilege to access or perform changes on any resource in the organization.
What should you do?
A. Grant the Billing Account User role on the billing account to all of the users in the finance team.
B. Grant the Billing Account User role on the billing account to all of the users in the engineering team.
C. Grant the Billing Account User role on the billing account as well as the Project Billing Manager role on the organization to all of the users in the finance team.
D. Grant the Billing Account User role on the billing account as well as the Project Billing Manager role on the organization to all of the users in the engineering team.
C. Grant the Billing Account User role on the billing account as well as the Project Billing Manager role on the organization to all of the users in the finance team.