First 50 of 200 questions. Each one lists the choices, the correct answer, and an explanation. The checker at the top of this page saves progress in this browser when it is available.
Continue in the practice tool above to load more questions, 50 at a time.
Question 1Design highly scalable, secure, and reliable cloud-native applications
An application running on Cloud Run stores user session data in a local in-memory map on each instance. Users report being logged out intermittently. What design change best resolves this?
- Move session state to a shared external store such as Memorystore or Firestore. Correct answer.
- Enable session affinity so each user is always routed to the same instance.
- Increase the maximum number of instances to reduce the chance of a miss.
- Persist the session map to the container's writable filesystem layer.
Explanation
Cloud Run instances are ephemeral and each one keeps its own memory, so per-instance session state disappears on scale-in, redeployment, or host recycling. Session data must live in a shared service that every instance can read.
Question 2Design highly scalable, secure, and reliable cloud-native applications
An application needs strongly consistent transactions across three continents and must scale writes horizontally as volume grows. Which database fits?
- BigQuery with streaming inserts and MERGE statements.
- Cloud Spanner with a multi-region instance configuration. Correct answer.
- Firestore in Datastore mode with a single-region location.
- Cloud SQL for PostgreSQL with cross-region read replicas.
Explanation
Cloud Spanner is a globally distributed, horizontally scalable relational database that provides strong and externally consistent transactions across regions. Cloud SQL scales writes vertically and its cross-region replicas are asynchronous.
Question 3Design highly scalable, secure, and reliable cloud-native applications
A Cloud Run service loses in-flight requests whenever it scales down, and requests can take up to 10 seconds to complete. What should be done?
- Raise the request timeout to the 60-minute maximum.
- Handle SIGTERM and finish in-flight work within the termination grace period. Correct answer.
- Switch the service to the default compute service account.
- Set the maximum instances equal to the minimum instances.
Explanation
Before stopping an instance, Cloud Run sends SIGTERM and allows a grace period; an app that traps the signal, stops accepting new requests, and drains existing ones avoids dropped responses. Request timeouts and instance counts do not change the shutdown sequence.
Question 4Design highly scalable, secure, and reliable cloud-native applications
An application stores critical images and must survive the total loss of a region. Which bucket configuration meets this requirement?
- A zonal bucket with turbo replication disabled.
- A Nearline bucket with a lifecycle rule that deletes objects after 30 days.
- A Standard storage bucket with object versioning enabled.
- A multi-region or dual-region bucket with replication enabled. Correct answer.
Explanation
Only multi-region and dual-region buckets replicate object data across regions, so an object remains available when a whole region is lost. Single-region and zonal buckets keep data within one region or zone.
Question 5Design highly scalable, secure, and reliable cloud-native applications
Cloud Run scales to 200 instances and Cloud SQL for PostgreSQL begins rejecting new connections. Which change addresses the root cause?
- Cap the per-instance connection pool and front the database with a pooler. Correct answer.
- Raise the Cloud Run container concurrency to 250.
- Raise the Cloud SQL max_connections flag to 5000.
- Connect over the public IP with SSL required on every instance.
Explanation
Each Cloud Run instance opens its own connections, so the total grows with instance count until the database limit is hit. Bounding each instance's pool and multiplexing through a pooler (for example PgBouncer or the Cloud SQL managed pooler) keeps the connection count within the server limit.
Question 6Design highly scalable, secure, and reliable cloud-native applications
Which configuration serves static website assets from a Cloud Storage origin with low latency worldwide and reduced origin egress?
- A Cloud Armor security policy bound to the bucket.
- Object versioning plus a retention policy on the origin bucket.
- A copy of the bucket in every region refreshed by a scheduled job.
- A Cloud CDN-enabled external Application Load Balancer. Correct answer.
Explanation
Cloud CDN caches content at Google edge points of presence when the bucket is configured as a backend bucket of an external Application Load Balancer, which cuts latency and shields the origin from repeat requests.
Question 7Design highly scalable, secure, and reliable cloud-native applications
Pods in a GKE cluster must call Cloud Storage APIs without any exported service account key material. What should be configured?
- Set the GOOGLE_APPLICATION_CREDENTIALS environment variable to a downloaded key file path.
- Rely on the node's default service account, which has the Editor role.
- Mount a long-lived JSON key file into each pod from a Kubernetes Secret.
- Bind a Kubernetes service account to a Google service account with Workload Identity. Correct answer.
Explanation
Workload Identity lets a Kubernetes service account impersonate a Google service account so pods receive short-lived federated credentials from the metadata server. No key file is created, stored, or rotated.
Question 8Design highly scalable, secure, and reliable cloud-native applications
An application calls a third-party API that rejects traffic above 5 requests per second and returns HTTP 429 under load. Which service provides rate-limited dispatch with managed retries?
- Publish to Pub/Sub and let the subscriber call the API as messages arrive.
- Cloud Tasks queues with a max dispatch rate and a retry policy. Correct answer.
- Create one Cloud Scheduler job per outgoing request.
- Call the third-party API synchronously from the user request path.
Explanation
Cloud Tasks queues let you set a maximum dispatch rate plus a retry policy with backoff, so outbound calls stay within the third party's limit and failures are retried by the service rather than by user requests.
Question 9Design highly scalable, secure, and reliable cloud-native applications
A Cloud Run service handles CPU-bound requests with container concurrency set to 80. As traffic grows, latency climbs sharply even though the instance count stays below the maximum. What is the best fix?
- Raise the maximum instance limit, which the service has not yet reached.
- Lower container concurrency so each instance handles fewer requests. Correct answer.
- Move the service to the default compute service account.
- Raise the request timeout to 60 minutes so slow requests can finish.
Explanation
Concurrency determines how many requests share one instance's CPU; when each request saturates the CPU, a high value causes queueing and latency. Lowering concurrency, even to 1 for CPU-bound work, gives each request a full CPU allocation.
Question 10Design highly scalable, secure, and reliable cloud-native applications
Where should a production database password be kept for an application deployed to GKE?
- In Secret Manager, read at runtime by the pod's own identity. Correct answer.
- In a ConfigMap committed to the Git repository.
- As a plain environment variable in the Deployment manifest.
- In a container image layer built during the CI pipeline.
Explanation
Secret Manager stores secrets centrally with IAM-controlled access, versioning, and audit logging, and the workload fetches them at runtime using its own identity. Secrets in manifests, ConfigMaps, or images are readable by anyone with repository or image pull access.
Question 11Design highly scalable, secure, and reliable cloud-native applications
Events for the same account must be processed in the order they were published by a subscriber that runs many instances. What must be configured?
- The same data payload for all messages so the service groups them.
- An ordering key on publish plus message ordering enabled on the subscription. Correct answer.
- Exactly-once delivery enabled on the topic.
- A single subscription with the maximum acknowledgment deadline.
Explanation
Publishers attach an ordering key and the subscription enables message ordering, which makes Pub/Sub deliver all messages with the same key in publish order. The subscriber must also process a given key on one instance at a time to preserve that order end to end.
Question 12Design highly scalable, secure, and reliable cloud-native applications
In GKE, which probe determines whether a pod should currently receive traffic through a Service?
- A liveness probe, which restarts the container when it fails.
- A readiness probe, which removes the pod from Service endpoints when it fails. Correct answer.
- A startup probe, which runs only during container initialization.
- An exec probe scheduled to run once per hour.
Explanation
Readiness probes gate traffic: while the probe fails, the pod is removed from Service endpoints but is not restarted. Liveness probes exist to restart containers that are stuck, not to decide traffic eligibility.
Question 13Design highly scalable, secure, and reliable cloud-native applications
A BigQuery table holds 5 TB of data and is always queried by a date range, yet every query scans the full table. What reduces bytes scanned?
- Reserving additional slots for the project.
- Partitioning the table by the date column and filtering on it. Correct answer.
- Adding a clustered column on a high-cardinality UUID field.
- Copying the table into a dataset in a second region.
Explanation
Partitioning by date lets BigQuery prune partitions that the filter excludes, so only the matching partitions are read. Slots change how quickly a query runs, not how many bytes it scans.
Question 14Design highly scalable, secure, and reliable cloud-native applications
Users must download private Cloud Storage objects directly for a limited period without being granted IAM roles. Which mechanism should be used?
- Make the bucket public and rely on unguessable object names.
- Issue each user a long-lived OAuth token scoped to the project.
- Grant the allUsers principal the Storage Object Viewer role.
- A signed URL with a short expiration bound to the object. Correct answer.
Explanation
A signed URL grants temporary, cryptographically authorized access to one object using the signing identity's permissions, so recipients need no IAM role and access expires automatically.
Question 15Design highly scalable, secure, and reliable cloud-native applications
A Cloud Run service responds to requests quickly but then publishes to Pub/Sub from a background thread, and many of those publishes never happen. What explains this behavior?
- The container concurrency setting is too high for the workload.
- The revision's maximum instance count is set too low.
- CPU is throttled after the response unless CPU is always allocated. Correct answer.
- The runtime service account is missing the Pub/Sub Publisher role.
Explanation
By default Cloud Run allocates CPU only while a request is being processed and throttles it afterwards, so work started after the response may never complete. Setting CPU to be always allocated keeps the instance's CPU available between requests.
Question 16Design highly scalable, secure, and reliable cloud-native applications
You want to send 5% of production traffic to a new version on Cloud Run and revert instantly if error rates rise. Which approach fits?
- Run two projects and switch DNS records between them.
- Deploy the new revision with zero traffic, then split traffic by percentage. Correct answer.
- Set minimum instances to zero so traffic drains gradually to the new version.
- Deploy the revision to 100% and revert by redeploying the previous image.
Explanation
Cloud Run can route a percentage of traffic to each revision, so a new revision can be deployed without traffic, given a small share, and rolled back by adjusting the split rather than redeploying.
Question 17Design highly scalable, secure, and reliable cloud-native applications
Which Google Cloud service inspects HTTP(S) requests at the load balancer and blocks layer 7 attacks such as SQL injection?
- VPC firewall rules
- Cloud KMS
- Cloud NAT
- Cloud Armor security policies Correct answer.
Explanation
Cloud Armor security policies attach to external Application Load Balancers and provide preconfigured WAF rules, rate limiting, and layer 7 DDoS protection at the edge.
Question 18Design highly scalable, secure, and reliable cloud-native applications
A security team must stop Cloud Storage data from being copied to a project outside the organization, even by principals who hold valid IAM roles inside the perimeter. Which control achieves this?
- CMEK with a separate key ring per project.
- IAM conditions that restrict bucket access to business hours.
- Uniform bucket-level access enabled on every bucket.
- A VPC Service Controls service perimeter around the projects. Correct answer.
Explanation
VPC Service Controls define a perimeter that blocks access to Google Cloud APIs, including data export, from outside the perimeter regardless of IAM grants. Only identities and networks explicitly allowed can cross the boundary.
Question 19Design highly scalable, secure, and reliable cloud-native applications
A client retries failed RPCs on a fixed one-second interval, and all instances retry at the same moment, repeatedly overloading the backend. What should the client do instead?
- Use truncated exponential backoff with randomized jitter. Correct answer.
- Raise the client timeout to the server's maximum deadline.
- Disable retries entirely for all transient failures.
- Retry immediately up to ten times before surfacing the error.
Explanation
Truncated exponential backoff increases the wait between attempts, and jitter randomizes those waits so clients do not retry in lockstep against an already struggling backend.
Question 20Design highly scalable, secure, and reliable cloud-native applications
Each of several microservices needs to read one specific Cloud Storage bucket. Which practice follows least privilege?
- Grant roles/editor at the project level so all services can reach any resource.
- Use the Compute Engine default service account for every service.
- Create a dedicated service account per service with a role granted on that bucket. Correct answer.
- Share one service account across services and rotate its JSON key every 90 days.
Explanation
A dedicated service account with a role bound to the specific bucket gives each service only the access it needs and allows permissions to be revoked independently. Shared or default accounts accumulate far broader permissions.
Question 21Design highly scalable, secure, and reliable cloud-native applications
Read traffic to a Cloud SQL primary is saturating the instance during peak hours, and the underlying data changes only once per hour. Which mitigation requires the least architectural change?
- Add a read replica and continue sending all reads to the primary.
- Cache hot reads in Memorystore with a TTL shorter than the change interval. Correct answer.
- Resize the database to a larger machine type whenever peak arrives.
- Cache every query result permanently in each application instance's memory.
Explanation
A cache-aside layer in Memorystore absorbs repeated reads and, with a TTL below the data change interval, bounds staleness while removing load from the primary. This avoids the operational disruption of vertical scaling.
Question 22Design highly scalable, secure, and reliable cloud-native applications
A subscriber repeatedly fails on a malformed message and the subscription stalls behind it. Which configuration resolves this?
- Extend the topic's message retention duration to 31 days.
- Add a dead-letter topic with a maximum delivery attempt count. Correct answer.
- Point the subscription at an unauthenticated push endpoint.
- Enable flow control to limit outstanding messages.
Explanation
With a dead-letter topic and a maximum delivery attempt count, Pub/Sub forwards messages that repeatedly fail so the main subscription can continue processing healthy messages.
Question 23Design highly scalable, secure, and reliable cloud-native applications
A Cloud Run service must reach a Cloud SQL for PostgreSQL instance that has no public IP, and the connection must not traverse the public internet. What should be configured?
- An authorized network entry of 0.0.0.0/0 on the Cloud SQL instance.
- A Cloud NAT gateway in the default VPC without an attachment to the service.
- A Serverless VPC Access connector reaching the instance's private IP. Correct answer.
- The Cloud SQL Auth Proxy connecting over the instance's public IP with SSL enforced.
Explanation
A Serverless VPC Access connector places Cloud Run egress inside the VPC, where the instance's private IP is reachable without leaving Google's network. Without a connector, Cloud Run traffic is not part of the VPC.
Question 24Design highly scalable, secure, and reliable cloud-native applications
Which GKE configuration keeps the control plane and workloads available when a single zone fails?
- A regional cluster whose node pools span three zones. Correct answer.
- A zonal cluster with node auto-repair enabled.
- A cluster whose only node pool uses preemptible nodes.
- A zonal cluster with one node pool of three nodes in that zone.
Explanation
A regional cluster replicates the control plane across zones, and node pools spread over three zones let workloads be rescheduled to surviving zones when one fails.
Question 25Design highly scalable, secure, and reliable cloud-native applications
Pub/Sub can deliver the same message more than once, and each message causes an insert into Cloud SQL. How should the consumer prevent duplicate rows?
- Record processed message IDs under a unique constraint in the same transaction as the insert. Correct answer.
- Enable message ordering on the subscription.
- Increase the acknowledgment deadline to the maximum value.
- Create a separate subscription for each consumer instance.
Explanation
At-least-once delivery means duplicates are expected, so processing must be idempotent. Writing the message ID under a unique constraint inside the same transaction makes a repeated delivery a no-op.
Question 26Design highly scalable, secure, and reliable cloud-native applications
A Cloud Run service serves bursty, unpredictable traffic, and the first request after an idle period takes several seconds while the container starts. Which setting most directly removes that startup latency for the first request?
- Increase the container concurrency value.
- Extend the request timeout to the maximum.
- Raise the maximum instance count to the platform limit.
- Set the minimum instance count above zero. Correct answer.
Explanation
Minimum instances keeps a number of container instances warm and ready, so requests that arrive after an idle period are served without a cold start. Maximum instances and concurrency affect how existing traffic is spread once instances are running, not whether the first request waits for startup.
Question 27Design highly scalable, secure, and reliable cloud-native applications
A GKE Deployment runs six replicas of a stateless API. During a node drain for a cluster upgrade, the service briefly returns errors because too many pods are terminated at once. Which object keeps the service available during such voluntary disruptions?
- A HorizontalPodAutoscaler with a target CPU utilization of 60%
- A PodDisruptionBudget that sets minAvailable to four Correct answer.
- A ResourceQuota that caps the number of pods in the namespace
- A LimitRange that sets default container resource requests
Explanation
A PodDisruptionBudget constrains voluntary disruptions such as node drains so that a minimum number of pods stays available. The eviction API refuses to remove pods when doing so would violate the budget, forcing the drain to proceed gradually.
Question 28Design highly scalable, secure, and reliable cloud-native applications
Other workloads in the same VPC network must be able to call a Cloud Run service, and the service must be unreachable from the public internet. Which ingress setting should be applied to the service?
- --ingress=internal-and-cloud-load-balancing
- --ingress=internal Correct answer.
- --ingress=all
- --allow-unauthenticated
Explanation
The internal ingress setting restricts a Cloud Run service to callers that originate inside the VPC network. The internal-and-cloud-load-balancing setting additionally exposes the service to load balancer traffic, which is broader than the requirement.
Question 29Design highly scalable, secure, and reliable cloud-native applications
An internal web application must be reachable by employees through a browser with their corporate Google sign-in, without a VPN and without exposing the backend to the internet. Which component enforces the identity check?
- A Cloud Armor security policy attached to the backend
- A firewall rule that allows tcp:443 from 0.0.0.0/0
- Identity-Aware Proxy in front of the backend Correct answer.
- Cloud NAT on the subnet that hosts the backend
Explanation
Identity-Aware Proxy authenticates users against an identity provider and authorizes each request using IAM, so the application can stay private while employees reach it through a browser. It removes the need for a VPN or a publicly reachable backend.
Question 30Design highly scalable, secure, and reliable cloud-native applications
Cloud Bigtable stores sensor readings with the row key set to the reading timestamp, and writes concentrate on a single node while the other nodes stay idle. Which key change distributes the writes?
- Store the timestamp bytes in reversed order.
- Prefix the key with the sensor identifier, then append the timestamp. Correct answer.
- Replace the key with a cluster-wide monotonically increasing sequence number.
- Store all readings for a sensor in one row, one column per reading.
Explanation
Bigtable sorts rows lexicographically and splits them into tablets, so a key that begins with a high-cardinality value such as a sensor ID spreads sequential writes over many tablets. Keys dominated by a monotonic value funnel consecutive writes to the same tablet.
Question 31Design highly scalable, secure, and reliable cloud-native applications
Pods must accept connections only from other pods in the same namespace, and the rule must be enforced by the cluster dataplane. Which GKE feature should be configured?
- Binary Authorization policy
- A Kubernetes NetworkPolicy on the namespace Correct answer.
- A Cloud Armor security policy on the cluster
- PodSecurity admission labels on the namespace
Explanation
Kubernetes NetworkPolicy objects select pods and declare which peers may reach them, and GKE enforces these rules in the dataplane when network policy is available on the cluster. Traffic that no policy allows is dropped.
Question 32Design highly scalable, secure, and reliable cloud-native applications
An application overwrites objects in place, and operators must be able to retrieve the contents of a previous version after an overwrite. Which bucket feature provides this?
- Uniform bucket-level access
- Object Versioning Correct answer.
- A lifecycle rule that deletes objects after 30 days
- Requester Pays
Explanation
Object Versioning retains a noncurrent copy whenever an object is overwritten or deleted, so earlier generations can be restored by generation number. Without it, an overwrite permanently replaces the stored bytes.
Question 33Design highly scalable, secure, and reliable cloud-native applications
Service A runs on Cloud Run with its own service account and calls Cloud Run service B, which is deployed with authentication required. What must service A present so that B accepts the call?
- An API key created in the same project
- A Cloud Storage signed URL for service B
- An access token scoped to the cloud-platform OAuth scope
- An ID token whose audience is service B's URL Correct answer.
Explanation
Cloud Run validates the Google-signed ID token on an authenticated request and checks that its audience matches the target service URL. The caller obtains that token from the metadata server using its own service account, which must hold the Cloud Run Invoker role on the target.
Question 34Design highly scalable, secure, and reliable cloud-native applications
An API on GKE must add pods when the number of unacknowledged Pub/Sub messages per pod rises, rather than when CPU rises. What should be configured?
- A Vertical Pod Autoscaler that rewrites container requests and limits
- A PodDisruptionBudget with maxUnavailable of one
- A cluster autoscaler that raises the maximum node count of the node pool
- A HorizontalPodAutoscaler using an external Cloud Monitoring metric Correct answer.
Explanation
A HorizontalPodAutoscaler can consume external metrics exposed through the Cloud Monitoring adapter, so backlog size per pod becomes the scaling signal instead of CPU. The cluster autoscaler then adds nodes as the new pods become unschedulable.
Question 35Design highly scalable, secure, and reliable cloud-native applications
A Cloud Run container needs about 40 seconds of initialization before it can answer requests, and traffic is reaching instances before initialization finishes. Which configuration delays traffic until the instance is ready?
- A startup probe that passes only after initialization Correct answer.
- A request timeout raised to the maximum allowed value
- A larger container concurrency value
- A liveness probe that runs every ten seconds on the container
Explanation
A startup probe tells Cloud Run whether the container has finished starting, and no traffic is sent to the instance until the probe succeeds. A liveness probe instead restarts unhealthy instances and does not gate incoming requests.
Question 36Design highly scalable, secure, and reliable cloud-native applications
An application reads a database password from Secret Manager and must pick up a rotated value without being redeployed. How should the application reference the secret?
- Commit a Kubernetes Secret manifest that holds the password to Git
- Mount a fixed secret version as a file and restart pods after each rotation
- Copy the secret value into the container image at build time
- Request the "latest" alias at runtime and refresh the cached value periodically Correct answer.
Explanation
Resolving the latest alias at runtime means the next rotation is picked up on the following refresh without rebuilding or redeploying. Caching with a short time-to-live bounds the delay while avoiding a Secret Manager call on every request.
Question 37Design highly scalable, secure, and reliable cloud-native applications
A CI pipeline runs on an external platform and must call Google Cloud APIs without any long-lived service account keys stored in the pipeline. Which approach should be used?
- Sign requests with a key held in Cloud KMS and send it as the API key
- Use the Compute Engine default service account through the metadata server
- Download a service account JSON key and store it in the pipeline's secret store
- Workload Identity Federation with a pool and impersonation Correct answer.
Explanation
Workload Identity Federation exchanges the external platform's OIDC token for short-lived Google Cloud credentials using a workload identity pool and attribute mapping. Granting the pool permission to impersonate a service account lets the pipeline act with that identity without any exported key.
Question 38Design highly scalable, secure, and reliable cloud-native applications
Objects in a Cloud Storage bucket must be encrypted with keys that the security team controls and that Cloud KMS rotates on a schedule. Which configuration satisfies this?
- A CMEK key with automatic rotation, set as the bucket's default KMS key Correct answer.
- Client-side encryption with a key stored in the application's config file
- Google-managed encryption keys, which are the default
- Customer-supplied encryption keys sent with every request
Explanation
Setting a Cloud KMS key as the bucket's default gives customer-managed encryption keys to new objects, and configuring a rotation schedule on that key satisfies the rotation requirement. CMEK keeps key custody and lifecycle in the security team's project rather than with Google or the application.
Question 39Design highly scalable, secure, and reliable cloud-native applications
A latency-sensitive Deployment must be placed in the Guaranteed QoS class so that its pods are evicted last under node memory pressure. What must each container specify?
- A high-priority PriorityClass only
- Equal values for CPU and memory requests and limits Correct answer.
- Resource requests only, with no limits set
- A LimitRange with default limits on the namespace
Explanation
Kubernetes assigns the Guaranteed class only when every container in the pod sets memory and CPU limits equal to their requests. Such pods are ranked last for eviction under node pressure.
Question 40Design highly scalable, secure, and reliable cloud-native applications
A Cloud SQL for MySQL instance must fail over automatically when its zone becomes unavailable, with no data loss. Which configuration should be used?
- A regional instance that keeps a standby in a second zone Correct answer.
- Read replicas in two different zones promoted manually
- A single-zone instance with automated backups and binary logging
- Point-in-time recovery enabled on a single-zone instance
Explanation
A regional Cloud SQL instance maintains a synchronous standby in another zone and promotes it automatically when the primary zone fails. Because replication is synchronous, failover does not lose committed transactions.
Question 41Design highly scalable, secure, and reliable cloud-native applications
A read-heavy service queries Cloud SQL for catalog data that changes rarely, and the primary is saturated with reads. Which change adds an in-memory cache in front of the database?
- A larger Cloud SQL machine type for the primary
- A Memorystore for Redis cache-aside layer with a TTL Correct answer.
- A read replica that serves every read query in the region
- Point-in-time recovery enabled on the primary instance
Explanation
A cache-aside layer keeps frequently requested rows in Memorystore and serves them without touching Cloud SQL, with a TTL bounding staleness for data that changes rarely. Invalidating or updating the cache on writes keeps the values consistent enough for catalog data.
Question 42Design highly scalable, secure, and reliable cloud-native applications
A Cloud Run service talks to a legacy database that accepts at most 200 concurrent connections, and each service instance holds four connections. Which setting bounds database connections as traffic grows?
- Container concurrency set to 1
- Maximum instances set to 50 Correct answer.
- Minimum instances set to 50
- Request timeout set to 60 seconds
Explanation
Capping maximum instances at 50 limits the service to roughly 50 multiplied by 4, or about 200, simultaneous database connections. Minimum instances only affects warm capacity, and concurrency or timeouts do not bound the number of instances.
Question 43Design highly scalable, secure, and reliable cloud-native applications
Mobile clients upload files of up to 5 GB over networks that drop connections frequently, and failed uploads currently restart from byte zero. Which Cloud Storage capability should the clients use?
- A single-request media upload with client-side retries
- Signed URLs generated separately for each byte range
- Resumable uploads that continue from the last committed byte Correct answer.
- Parallel composite uploads with 32 chunks per file
Explanation
A resumable upload session records how many bytes were received, so after a dropped connection the client queries the session and continues from that offset instead of resending the whole object. This makes large transfers over unreliable networks practical.
Question 44Design highly scalable, secure, and reliable cloud-native applications
A workflow must create at most one task per order ID even when the submitting client retries, and no extra deduplication state may be maintained by the application. Which mechanism provides this?
- A Pub/Sub subscription with exactly-once delivery enabled
- A Cloud Tasks queue where the task name is derived from the order ID Correct answer.
- A Cloud Scheduler job created for each order
- A Pub/Sub topic with a single subscription
Explanation
Cloud Tasks rejects creation of a task whose name already exists in the queue during the retention window, so a deterministic name derived from the order ID gives deduplication without application state. The second submission receives an already-exists error and is discarded.
Question 45Design highly scalable, secure, and reliable cloud-native applications
A Firestore collection receives bursts of increments to a single counter document, and updates to that document exceed the sustained per-document write rate. Which design change removes the bottleneck?
- Move the counter into a subcollection of the same document
- Add a composite index that covers the counter field and timestamp
- Switch the database to Datastore mode so the counter updates faster
- Shard the counter across many documents and sum the shards on read Correct answer.
Explanation
Firestore sustains only a limited write rate on a single document, so a hot counter must be spread over multiple shard documents that are read and summed. This trades extra read work for parallelism on the write path.
Question 46Design highly scalable, secure, and reliable cloud-native applications
A gRPC client on GKE opens one long-lived HTTP/2 connection to a Kubernetes Service and therefore sends all calls to a single pod, while the other replicas sit idle. Which change distributes the calls across all pods?
- Raise the replica count of the Deployment that backs the Service
- Change the Service to type NodePort so each pod gets its own port
- Enable ClientIP session affinity on the Service
- Use a headless Service so the client resolves and balances across pod IPs Correct answer.
Explanation
A ClusterIP Service load balances per connection, so a single long-lived HTTP/2 connection pins a gRPC client to one pod. A headless Service returns all pod addresses through DNS, letting a gRPC client with a round-robin policy spread calls over every replica.
Question 47Design highly scalable, secure, and reliable cloud-native applications
An application stores orders and their line items and always reads line items together with their parent order. Which Cloud Spanner schema choice minimizes data transfer and latency for those reads?
- Interleave the line items table in the orders table Correct answer.
- Store each line item in its own table partitioned by the order date
- Store the line items in a separate table keyed by a random UUID
- Store the line items in a separate table with a secondary index on order_id
Explanation
Interleaving places child rows physically next to their parent row with the parent key as a prefix, so reading a parent and its children is a single local operation. This avoids the extra network round trips of a join across separate tables.
Question 48Design highly scalable, secure, and reliable cloud-native applications
A Cloud Run service is deployed to two regions and must be reachable at one global anycast IP address, with requests routed to a healthy regional deployment. Which load balancing design achieves this?
- Two regional external passthrough Network Load Balancers fronted by DNS round robin
- A single regional Application Load Balancer with two instance groups
- A global Application Load Balancer with a serverless NEG per region Correct answer.
- A Cloud Router with BGP routes advertised to both regions
Explanation
A global external Application Load Balancer exposes one anycast address and can reference serverless NEGs in multiple regions, routing each request to a healthy regional Cloud Run service. Regional load balancers or DNS-based approaches cannot present a single global IP with centralized routing control.
Question 49Design highly scalable, secure, and reliable cloud-native applications
A stateful workload on GKE runs three replicas that must each keep their data through a zonal failure and must be spread across zones. Which design supports this?
- A Deployment with emptyDir volumes and pod anti-affinity rules
- A StatefulSet with regional persistent disks in each zone Correct answer.
- A DaemonSet with hostPath volumes in each zone
- A StatefulSet with local SSDs and a PodDisruptionBudget
Explanation
A StatefulSet gives each replica a stable identity and its own PersistentVolumeClaim, and a regional persistent disk keeps data synchronously replicated across two zones, so a pod can be rescheduled in the surviving zone. Spreading the pods across zones keeps the quorum members apart.
Question 50Design highly scalable, secure, and reliable cloud-native applications
An API runs behind an internal load balancer in a producer project. Consumers in several other projects and VPCs must reach it privately, and their IP ranges overlap with the producer's ranges. Which connectivity option should the producer publish?
- A Private Service Connect service attachment Correct answer.
- A Cloud VPN tunnel from each consumer to the producer
- A VPC network peering between the producer and each consumer
- A Shared VPC host project that all the consumers join
Explanation
Private Service Connect lets a producer publish a service attachment that consumers reach through an endpoint in their own VPC, with no requirement that the address ranges be non-overlapping. It also avoids exposing the producer's network topology to consumers.