Prepare and test your skills

Prepare and test your skills

Free sample question with answers and detailed explanation below. The Professional Cloud Developer practice bank has an additional 608 practice questions.Try 10 free realistic questions: instant score, no credit card, and no account required.
Your team operates a high-throughput Java microservice on Google Kubernetes Engine (GKE) that connects to a Firestore database in Datastore mode using the google-cloud-datastore client library. Monitoring indicates elevated connection latency and request buffering under peak load.
Load metrics for each microservice instance show the following characteristics:
You need to switch to gRPC-based communication and optimize the connection pool to minimize latency and ensure high availability without over-provisioning resources. Which configuration should you implement?
DatastoreOptions with GrpcTransportOptions and set the channel pool size to 400 connections so each concurrent request receives a dedicated connection.This configuration enables gRPC transport via GrpcTransportOptions while allocating 400 separate gRPC channels in the pool—effectively mapping one dedicated TCP/HTTP2 connection to each of the 400 concurrent requests calculated for the workload (8,000 ÷ (1,000 ÷ 50) = 400).
A pool size of 400 connections would only be justified if each microservice instance sustained 4,000 to 20,000 concurrent outstanding requests (for example, 80,000 to 400,000 QPS at 50 ms latency), where keeping 10 to 50 streams per channel actually required 400 channels.
To balance low latency and resource efficiency, always divide total concurrent requests by 10 and 50 streams per channel rather than sizing one channel per concurrent request.
DatastoreOptions with HttpTransportOptions, increase the connect timeout, and instantiate a new Datastore client per request thread to avoid contention.HttpTransportOptions and per-request clients doHttpTransportOptions instructs the google-cloud-datastore Java client to communicate over standard HTTP rather than gRPC, with configurable timeouts such as setConnectTimeout. Instantiating a new Datastore client per request thread creates isolated client instances that do not share state or underlying network sockets across threads.
HttpTransportOptions keeps or reverts the client to HTTP transport, forfeiting gRPC multiplexing and persistent bidirectional channel efficiencies.setConnectTimeout only allows requests to wait longer during connection setup rather than reducing connection latency or buffering.DatastoreOptions requires updating client initialization and restarting the service.Using HttpTransportOptions would only be appropriate if network proxies or legacy firewall policies blocked HTTP/2/gRPC traffic, requiring a fallback to standard HTTP—and even then, the Datastore client should still be shared as a singleton rather than created per request.
Modern Google Cloud client libraries are thread-safe; sharing a single Datastore instance backed by a gRPC channel pool is the standard pattern for minimizing latency.
DatastoreOptions with GrpcTransportOptions and set the channel pool size to 2 connections to ensure redundancy while minimizing memory usage.Configuring GrpcTransportOptions with 2 connections enables gRPC transport and provides basic channel-level redundancy across two persistent HTTP/2 connections. This minimum threshold of 2 channels is often used as a baseline floor for low-volume workloads so traffic can fail over if one connection drops.
8,000 ÷ (1,000 ÷ 50) = 400 concurrent outstanding requests. Distributing 400 concurrent requests across 2 channels requires 200 concurrent streams per connection.Using 2 channels would be appropriate only if your calculated minimum pool size were less than 2—for example, a low-throughput service handling up to 100 concurrent requests ((QPS ÷ (1,000 ÷ latency)) ÷ 50 < 2), where 2 connections satisfy both concurrency and redundancy needs.
Even when calculations yield fewer than 2 channels, maintaining at least 2 ensures high availability, whereas high-QPS services must scale the pool proportionally to keep per-channel load between 10 and 50 streams.
DatastoreOptions with GrpcTransportOptions and reuse a shared client with a channel pool sized between 8 and 40 connections.gRPC is a high-performance RPC framework built on HTTP/2 that supports multiplexed concurrent streams over a persistent TCP connection. In the Java client library for Firestore in Datastore mode, setting GrpcTransportOptions enables gRPC transport instead of HTTP, while a channel pool (connection pool) maintains a shared cache of reusable connections across application threads.
1,000 ÷ 50 = 20 serial requests per second. Supporting 8,000 QPS requires 8,000 ÷ 20 = 400 concurrent outstanding requests per client instance.Unlike HTTP transport, single-channel configurations, or 1-to-1 connection pools, pairing GrpcTransportOptions with an 8 to 40 connection pool leverages HTTP/2 multiplexing within Google Cloud's recommended concurrency bounds, delivering both low latency and efficient resource utilization.
Answer them yourself and get your score the moment you finish. No account needed.
Full access includes
Keep the momentum going with these hand-picked practice scenarios
Last updated Validated