01. When a new version of a production service is released, all production traffic should move to it at once, and the previous version must stay deployed so that traffic can be switched straight back if the release misbehaves.
Which deployment strategy is this?
a) Recreate deployment
b) Blue/green deployment
c) Rolling deployment
d) Canary deployment
02. Your analysts need to run SQL against application events within seconds of those events being produced. You expect the event volume to grow quickly, and you want to lean on managed services rather than operate infrastructure.
What should you do?
a) Publish the events to a Pub/Sub topic and use a Dataflow streaming pipeline to write them into BigQuery.
b) Publish the events to a Pub/Sub topic and use Dataflow to write them into Cloud Storage.
c) Run Kafka on a large Compute Engine instance, stream the events into it, and use Dataflow to write them into Cloud Storage.
d) Publish the events to a Pub/Sub topic and use Dataflow to write them into Firestore in Datastore mode.
03. You are parsing a log file whose three columns are a timestamp, an account number held as a string, and a transaction amount held as a number. You need to compute the total transaction amount for each distinct account number efficiently, in a single pass over the file.
Which data structure should you use?
a) A linked list of account totals
b) A comma-separated string of account totals
c) A two-dimensional array of accounts and amounts
d) A hash table keyed by account number
04. An application stores each user's files in Cloud Storage under a per-user prefix, and the interface has to show that user's area from the moment their account is created, before any file has been uploaded. Cloud Storage has a flat namespace, so there is no directory object to create.
What should the application do when a user is created?
a) Create and then delete an object whose name is the subdirectory name.
b) Create an object whose name is the subdirectory name, that has WRITER access control list permission, and that is zero bytes in length.
c) Create an object whose name is the subdirectory name ending with a trailing slash (/) and that is zero bytes in length.
d) Create an object whose name is the subdirectory name, that is zero bytes in length, and whose Content-Type metadata is set to CLOUDSTORAGE_FOLDER.
05. As part of its expansion, HipLocal creates a separate Google Cloud project for each new part of the business, and an automated pipeline creates those projects. Every new project needs the same set of Google Cloud APIs turned on before any workload can be deployed into it.
They want that enablement to happen automatically as part of project creation. What should they do?
a) Have the project-creation pipeline call the Service Usage API to enable each required API on the new project.
b) Use the Service Management API to define a new managed service for each project.
c) Enable the APIs once at the folder level so that projects created underneath inherit them.
d) Have an engineer enable the required APIs in the Google Cloud console after each project is created.
06. Another team is building an integration that must run on the same Google Kubernetes Engine cluster as your application. They need to deploy and manage their own workloads there, and they must not be able to change yours.
What should you do?
a) Set up a new GKE cluster and give the other team Editor access using IAM.
b) Create a new namespace within the current cluster and give the other team Editor access using IAM.
c) Use IAM to give the other team Viewer access to the cluster project.
d) Create a new namespace within the current cluster and give the other team Admin access on the new namespace using Kubernetes RBAC.
07. A Cloud Run service is published through API Gateway using an OpenAPI specification. Every caller must present a valid credential before a request reaches the service, and you want the gateway to enforce that rather than the service itself.
What should you do?
a) Modify the service's code so that it validates the caller's credential on every request.
b) Rename the service so that its endpoint address is difficult to guess.
c) Add a security definition to the OpenAPI specification and apply it to the paths the gateway exposes.
d) Deploy a second serverless service in front of the first to check credentials before forwarding requests.
08. You develop and run scripts in Cloud Shell at a financial institution. The scripts currently write sensitive user data to files on the Cloud Shell virtual machine's ephemeral disk, and a new regulation forbids keeping that data on ephemeral storage. The data must outlive the session, be encrypted at rest, and remain reachable by other tools in the project, and you want to change as little of the existing code as possible.
Where should you store the user data?
a) Store user data on a persistent disk in a Compute Engine instance.
b) Store user data in a Cloud Storage bucket.
c) Store user data in BigQuery tables.
d) Store user data on a Cloud Shell home disk, and log in at least every 120 days to prevent its deletion.
09. A third-party web application needs to read and write a user's data held by your API, acting on that user's behalf. Users must be able to grant only the specific access the third party needs, withdraw it later, and never hand over their password.
How should the third-party application obtain access?
a) Use the OAuth 2.0 authorization code flow, so the user approves scoped access at your authorization server and the third party receives a token.
b) Issue each third party an API key scoped to your API, and let it call the API with that key.
c) Have the third party register with your authorization server and then call the API with the client identifier it is issued.
d) Have users give the third party their username and password so that it can sign in as them and store those credentials for use on later calls.
10. Your company runs a successful multiplayer game that is popular in the US and is now expanding to other regions. A new feature lets players trade points with each other, and players in different regions will trade with one another.
The game's MySQL backend is reaching the limits of the single Compute Engine instance that hosts it. The company wants a database that keeps a point transfer consistent no matter where the two players are, and that stays available across regions.
Which database should they choose?
a) BigQuery
b) Cloud SQL
c) Cloud Spanner
d) Cloud Bigtable