ExamGecko
Home Home / Google / Professional Cloud Developer

Google Professional Cloud Developer Practice Test - Questions Answers, Page 19

Question list
Search
Search

List of questions

Search

Related questions











You are developing a Java Web Server that needs to interact with Google Cloud services via the Google Cloud API on the user's behalf. Users should be able to authenticate to the Google Cloud API using their Google Cloud identities. Which workflow should you implement in your web application?

A.
1) When a user arrives at your application, prompt them for their Google username and password. 2) Store an SHA password hash in your application's database along with the user's username. 3) The application authenticates to the Google Cloud API using HTTPs requests with the user's username and password hash in the Authorization request header.
A.
1) When a user arrives at your application, prompt them for their Google username and password. 2) Store an SHA password hash in your application's database along with the user's username. 3) The application authenticates to the Google Cloud API using HTTPs requests with the user's username and password hash in the Authorization request header.
Answers
B.
1) When a user arrives at your application, prompt them for their Google username and password. 2) Forward the user's username and password in an HTTPS request to the Google Cloud authorization server, and request an access token. 3) The Google server validates the user's credentials and returns an access token to the application. 4) The application uses the access token to call the Google Cloud API.
B.
1) When a user arrives at your application, prompt them for their Google username and password. 2) Forward the user's username and password in an HTTPS request to the Google Cloud authorization server, and request an access token. 3) The Google server validates the user's credentials and returns an access token to the application. 4) The application uses the access token to call the Google Cloud API.
Answers
C.
1) When a user arrives at your application, route them to a Google Cloud consent screen with a list of requested permissions that prompts the user to sign in with SSO to their Google Account. 2) After the user signs in and provides consent, your application receives an authorization code from a Google server. 3) The Google server returns the authorization code to the user, which is stored in the browser's cookies. 4) The user authenticates to the Google Cloud API using the authorization code in the cookie.
C.
1) When a user arrives at your application, route them to a Google Cloud consent screen with a list of requested permissions that prompts the user to sign in with SSO to their Google Account. 2) After the user signs in and provides consent, your application receives an authorization code from a Google server. 3) The Google server returns the authorization code to the user, which is stored in the browser's cookies. 4) The user authenticates to the Google Cloud API using the authorization code in the cookie.
Answers
D.
1) When a user arrives at your application, route them to a Google Cloud consent screen with a list of requested permissions that prompts the user to sign in with SSO to their Google Account. 2) After the user signs in and provides consent, your application receives an authorization code from a Google server. 3) The application requests a Google Server to exchange the authorization code with an access token. 4) The Google server responds with the access token that is used by the application to call the Google Cloud API.
D.
1) When a user arrives at your application, route them to a Google Cloud consent screen with a list of requested permissions that prompts the user to sign in with SSO to their Google Account. 2) After the user signs in and provides consent, your application receives an authorization code from a Google server. 3) The application requests a Google Server to exchange the authorization code with an access token. 4) The Google server responds with the access token that is used by the application to call the Google Cloud API.
Answers
Suggested answer: D

Explanation:

https://developers.google.com/identity/protocols/oauth2#webserver

The Google OAuth 2.0 endpoint supports web server applications that use languages and frameworks such as PHP, Java, Python, Ruby, and ASP.NET. The authorization sequence begins when your application redirects a browser to a Google URL; the URL includes query parameters that indicate the type of access being requested. Google handles the user authentication, session selection, and user consent. The result is an authorization code, which the application can exchange for an access token and a refresh token.

You recently developed a new application. You want to deploy the application on Cloud Run without a Dockerfile. Your organization requires that all container images are pushed to a centrally managed container repository. How should you build your container using Google Cloud services? (Choose two.)

A.
Push your source code to Artifact Registry.
A.
Push your source code to Artifact Registry.
Answers
B.
Submit a Cloud Build job to push the image.
B.
Submit a Cloud Build job to push the image.
Answers
C.
Use the pack build command with pack CLI.
C.
Use the pack build command with pack CLI.
Answers
D.
Include the --source flag with the gcloud run deploy CLI command.
D.
Include the --source flag with the gcloud run deploy CLI command.
Answers
E.
Include the --platform=kubernetes flag with the gcloud run deploy CLI command.
E.
Include the --platform=kubernetes flag with the gcloud run deploy CLI command.
Answers
Suggested answer: A, C

Explanation:

https://cloud.google.com/run/docs/deploying#images

https://cloud.google.com/blog/products/containers-kubernetes/google-cloud-now-supports-buildpacks

You manage your company's ecommerce platform's payment system, which runs on Google Cloud. Your company must retain user logs for 1 year for internal auditing purposes and for 3 years to meet compliance requirements. You need to store new user logs on Google Cloud to minimize on-premises storage usage and ensure that they are easily searchable. You want to minimize effort while ensuring that the logs are stored correctly. What should you do?

A.
Store the logs in a Cloud Storage bucket with bucket lock turned on.
A.
Store the logs in a Cloud Storage bucket with bucket lock turned on.
Answers
B.
Store the logs in a Cloud Storage bucket with a 3-year retention period.
B.
Store the logs in a Cloud Storage bucket with a 3-year retention period.
Answers
C.
Store the logs in Cloud Logging as custom logs with a custom retention period.
C.
Store the logs in Cloud Logging as custom logs with a custom retention period.
Answers
D.
Store the logs in a Cloud Storage bucket with a 1-year retention period. After 1 year, move the logs to another bucket with a 2-year retention period.
D.
Store the logs in a Cloud Storage bucket with a 1-year retention period. After 1 year, move the logs to another bucket with a 2-year retention period.
Answers
Suggested answer: C

Explanation:

https://cloud.google.com/logging/docs/buckets#custom-retention

Your company has a new security initiative that requires all data stored in Google Cloud to be encrypted by customer-managed encryption keys. You plan to use Cloud Key Management Service (KMS) to configure access to the keys. You need to follow the 'separation of duties' principle and Google-recommended best practices. What should you do? (Choose two.)

A.
Provision Cloud KMS in its own project.
A.
Provision Cloud KMS in its own project.
Answers
B.
Do not assign an owner to the Cloud KMS project.
B.
Do not assign an owner to the Cloud KMS project.
Answers
C.
Provision Cloud KMS in the project where the keys are being used.
C.
Provision Cloud KMS in the project where the keys are being used.
Answers
D.
Grant the roles/cloudkms.admin role to the owner of the project where the keys from Cloud KMS are being used.
D.
Grant the roles/cloudkms.admin role to the owner of the project where the keys from Cloud KMS are being used.
Answers
E.
Grant an owner role for the Cloud KMS project to a different user than the owner of the project where the keys from Cloud KMS are being used.
E.
Grant an owner role for the Cloud KMS project to a different user than the owner of the project where the keys from Cloud KMS are being used.
Answers
Suggested answer: A, B

Explanation:

https://cloud.google.com/kms/docs/separation-of-duties#using_separate_project

You need to migrate a standalone Java application running in an on-premises Linux virtual machine (VM) to Google Cloud in a cost-effective manner. You decide not to take the lift-and-shift approach, and instead you plan to modernize the application by converting it to a container. How should you accomplish this task?

A.
Use Migrate for Anthos to migrate the VM to your Google Kubernetes Engine (GKE) cluster as a container.
A.
Use Migrate for Anthos to migrate the VM to your Google Kubernetes Engine (GKE) cluster as a container.
Answers
B.
Export the VM as a raw disk and import it as an image. Create a Compute Engine instance from the Imported image.
B.
Export the VM as a raw disk and import it as an image. Create a Compute Engine instance from the Imported image.
Answers
C.
Use Migrate for Compute Engine to migrate the VM to a Compute Engine instance, and use Cloud Build to convert it to a container.
C.
Use Migrate for Compute Engine to migrate the VM to a Compute Engine instance, and use Cloud Build to convert it to a container.
Answers
D.
Use Jib to build a Docker image from your source code, and upload it to Artifact Registry. Deploy the application in a GKE cluster, and test the application.
D.
Use Jib to build a Docker image from your source code, and upload it to Artifact Registry. Deploy the application in a GKE cluster, and test the application.
Answers
Suggested answer: D

Explanation:

https://cloud.google.com/blog/products/application-development/introducing-jib-build-java-docker-images-better

Your organization has recently begun an initiative to replatform their legacy applications onto Google Kubernetes Engine. You need to decompose a monolithic application into microservices. Multiple instances have read and write access to a configuration file, which is stored on a shared file system. You want to minimize the effort required to manage this transition, and you want to avoid rewriting the application code. What should you do?

A.
Create a new Cloud Storage bucket, and mount it via FUSE in the container.
A.
Create a new Cloud Storage bucket, and mount it via FUSE in the container.
Answers
B.
Create a new persistent disk, and mount the volume as a shared PersistentVolume.
B.
Create a new persistent disk, and mount the volume as a shared PersistentVolume.
Answers
C.
Create a new Filestore instance, and mount the volume as an NFS PersistentVolume.
C.
Create a new Filestore instance, and mount the volume as an NFS PersistentVolume.
Answers
D.
Create a new ConfigMap and volumeMount to store the contents of the configuration file.
D.
Create a new ConfigMap and volumeMount to store the contents of the configuration file.
Answers
Suggested answer: D

Explanation:

https://cloud.google.com/kubernetes-engine/docs/concepts/configmap

ConfigMaps bind non-sensitive configuration artifacts such as configuration files, command-line arguments, and environment variables to your Pod containers and system components at runtime.

A ConfigMap separates your configurations from your Pod and components, which helps keep your workloads portable. This makes their configurations easier to change and manage, and prevents hardcoding configuration data to Pod specifications.

Your development team has built several Cloud Functions using Java along with corresponding integration and service tests. You are building and deploying the functions and launching the tests using Cloud Build. Your Cloud Build job is reporting deployment failures immediately after successfully validating the code. What should you do?

A.
Check the maximum number of Cloud Function instances.
A.
Check the maximum number of Cloud Function instances.
Answers
B.
Verify that your Cloud Build trigger has the correct build parameters.
B.
Verify that your Cloud Build trigger has the correct build parameters.
Answers
C.
Retry the tests using the truncated exponential backoff polling strategy.
C.
Retry the tests using the truncated exponential backoff polling strategy.
Answers
D.
Verify that the Cloud Build service account is assigned the Cloud Functions Developer role.
D.
Verify that the Cloud Build service account is assigned the Cloud Functions Developer role.
Answers
Suggested answer: D

Explanation:

https://cloud.google.com/build/docs/securing-builds/configure-access-for-cloud-build-service-account

You manage a microservices application on Google Kubernetes Engine (GKE) using Istio. You secure the communication channels between your microservices by implementing an Istio AuthorizationPolicy, a Kubernetes NetworkPolicy, and mTLS on your GKE cluster. You discover that HTTP requests between two Pods to specific URLs fail, while other requests to other URLs succeed. What is the cause of the connection issue?

A.
A Kubernetes NetworkPolicy resource is blocking HTTP traffic between the Pods.
A.
A Kubernetes NetworkPolicy resource is blocking HTTP traffic between the Pods.
Answers
B.
The Pod initiating the HTTP requests is attempting to connect to the target Pod via an incorrect TCP port.
B.
The Pod initiating the HTTP requests is attempting to connect to the target Pod via an incorrect TCP port.
Answers
C.
The Authorization Policy of your cluster is blocking HTTP requests for specific paths within your application.
C.
The Authorization Policy of your cluster is blocking HTTP requests for specific paths within your application.
Answers
D.
The cluster has mTLS configured in permissive mode, but the Pod's sidecar proxy is sending unencrypted traffic in plain text.
D.
The cluster has mTLS configured in permissive mode, but the Pod's sidecar proxy is sending unencrypted traffic in plain text.
Answers
Suggested answer: C

You recently migrated an on-premises monolithic application to a microservices application on Google Kubernetes Engine (GKE). The application has dependencies on backend services on-premises, including a CRM system and a MySQL database that contains personally identifiable information (PII). The backend services must remain on-premises to meet regulatory requirements.

You established a Cloud VPN connection between your on-premises data center and Google Cloud. You notice that some requests from your microservices application on GKE to the backend services are failing due to latency issues caused by fluctuating bandwidth, which is causing the application to crash. How should you address the latency issues?

A.
Use Memorystore to cache frequently accessed PII data from the on-premises MySQL database
A.
Use Memorystore to cache frequently accessed PII data from the on-premises MySQL database
Answers
B.
Use Istio to create a service mesh that includes the microservices on GKE and the on-premises services
B.
Use Istio to create a service mesh that includes the microservices on GKE and the on-premises services
Answers
C.
Increase the number of Cloud VPN tunnels for the connection between Google Cloud and the on-premises services
C.
Increase the number of Cloud VPN tunnels for the connection between Google Cloud and the on-premises services
Answers
D.
Decrease the network layer packet size by decreasing the Maximum Transmission Unit (MTU) value from its default value on Cloud VPN
D.
Decrease the network layer packet size by decreasing the Maximum Transmission Unit (MTU) value from its default value on Cloud VPN
Answers
Suggested answer: C

Explanation:

https://cloud.google.com/network-connectivity/docs/vpn/concepts/choosing-networks-routing#route-alignment

Your company has deployed a new API to a Compute Engine instance. During testing, the API is not behaving as expected. You want to monitor the application over 12 hours to diagnose the problem within the application code without redeploying the application. Which tool should you use?

A.
Cloud Trace
A.
Cloud Trace
Answers
B.
Cloud Monitoring
B.
Cloud Monitoring
Answers
C.
Cloud Debugger logpoints
C.
Cloud Debugger logpoints
Answers
D.
Cloud Debugger snapshots
D.
Cloud Debugger snapshots
Answers
Suggested answer: C

Explanation:

https://cloud.google.com/debugger/docs/using/logpoints

Logpoints allow you to inject logging into running services without restarting or interfering with the normal function of the service

Total 265 questions
Go to page: of 27