PCD sample questions with answers
The other 118 questions are in the practice tool, with answers revealed as you go.
Start 20 questionsDesigning cloud-native applications
- During an incident, calls from a checkout service to a fraud-scoring service in GKE begin timing out, and failing calls keep piling up. The team needs the failures to be cut off quickly without changing application code. Which control should they add?
- A checkout service on GKE needs a promotional banner turned on for 10 percent of users and turned off later. Changes must reach running pods within about a minute, and no image rebuild may be required. Which approach fits best?
- A worker Deployment on GKE should add replicas when a Pub/Sub subscription's backlog grows and remove them when the backlog drains. Which combination makes this work?
- An order service calls a loyalty service to show reward points during checkout. When the loyalty service is down, checkout should still complete. What should the order service do?
- A Cloud Run aggregator calls pricing, inventory, and shipping APIs for every page view. The pricing API occasionally takes 20 seconds, which exhausts the request time budget and holds up the other calls. What design change best contains that risk?
- A legacy billing monolith must be replaced over the next year. You want a growing share of invoice requests sent to new Cloud Run services while the monolith keeps serving everything else, and you need to be able to roll a route back quickly. Which approach and traffic mechanism fit?
Building and testing applications
- Your Cloud Build pipeline must produce the same output when rerun a year from now, and auditors need to know exactly which compiler image each build used. How should the build steps reference that image?
- Your Cloud Build config produces an image for an Artifact Registry repository. The release team wants each build pushed with an immutable commit-SHA tag and also with a moving tag that always points at the newest build. How should the images section be written?
- Your release team needs every container image built by Cloud Build to carry a verifiable record of its source commit, the builder used, and the build steps, so a later admission policy can check where the image came from. What should the build configuration enable?
- A cloudbuild.yaml file has three steps in this order: build the image, push the image, then run unit tests. The tests sometimes fail, but by then the image has already been pushed. How should the pipeline be changed?
- A container build for a Go API needs a full compiler toolchain and downloaded modules, but the running service only executes one compiled binary. Which Dockerfile approach keeps the deployed image small?
Deploying applications
- You are releasing a new revision of a Cloud Run service. About 5% of traffic should reach it first, then larger shares as long as error rates stay low. Users must not experience any outage. How should you release it?
- Pods on your GKE node pool stay Pending with 'insufficient cpu' events during a traffic spike. You want new nodes added automatically whenever the scheduler cannot place pods. Which component should you enable?
- A GKE pod loads a large in-memory cache during startup, which takes about two minutes. Until the cache is ready the pod must receive no traffic, but Kubernetes must not restart it while it warms up. Which probe fits?
Integrating Google Cloud services
- A checkout request passes through an API gateway, a pricing service, an inventory service and a payment service. Users see slow responses, and you need a timeline for individual requests that shows how long each hop took. Which service should you use?
- A Pub/Sub push subscription delivers messages to a Cloud Run service, and the service returns HTTP 500 for some of them. What happens to those messages?
- Your Python service on Cloud Run throws exceptions that nobody notices. You want the stack traces grouped into distinct issues with occurrence counts, plus an alert when a new one appears. Which managed service fits?