gRPC
A contract-first framework where a schema generates both ends of a call and every request rides one long-lived HTTP/2 connection. Interviewers use it as the internal-service counterpart to REST.
part ofAPI stylesoverview, primer and where to startread it →on this pageshowhide
explore
- Service Definitions and Stubs5 questions
- Call Types and Streaming5 questions
- HTTP/2 Transport Layer6 questions
- Deadlines and Metadata7 questions
- Interceptors and Middleware5 questions
- Load Balancing and Discovery7 questions
- Browser Clients and Trailers5 questions
- Reflection and Health Checking5 questions
- Backend Developerroleanchors this topic
- Full Stack Developerroleanchors this topic
- Java Backend Developerroleanchors this topic
- Kotlin Backend Developerroleanchors this topic
- MLOps Engineerroleanchors this topic
- AI Red Teamingrole
- API Designskill
- Forward Deployed Engineerrole
- Server-Side Game Developerrole
- Software Architectrole
questions
page 2 of 2Why is a blocking credential lookup inside a gRPC client-side interceptor worse than the same lookup in the calling code?
basics
~20 sTwo reasons. The wrapper usually runs on the thread driving the connection, and one connection carries many concurrent calls, so it stalls unrelated ones. And it runs inside the call, so its latency is spent out of the deadline the caller already set.
A gRPC server-side interceptor catches every handler exception so its audit write always happens; why do callers now see OK (0)?
basics
~20 sBecause the wrapper sits between the handler and the machinery that writes the call's status. Catching the failure and then completing the call normally means OK (0) goes on the wire, and the failure exists only in the server's own log.
A gRPC server starts closing a caller's connections with the debug data too_many_pings — what did the caller's keepalive settings do wrong?
basics
~20 sKeepalive pings were sent more often than the server tolerates, typically on connections with no active calls. The server counted strikes and, past its limit, sent a GOAWAY carrying ENHANCE_YOUR_CALM and the debug data too_many_pings.
In a gRPC service config, how do retryPolicy and hedgingPolicy differ, and what keeps either from amplifying a backend outage?
basics
~20 sA gRPC method config holds either a retryPolicy, which replays a call after a retryable status with backoff, or a hedgingPolicy, which sends staggered copies without waiting. retryThrottling, a per-server-name token budget, halts both when failures pile up.
A browser console's gRPC-Web server-streaming feed stops silently. Why is a cut response hard to detect, and what must the client check?
basics
~20 sgRPC-Web uses no HTTP/2 framing, so no stream-reset frame, connection-closing frame or transport ping tells the client anything. The response ends when its body ends, so a cut response looks complete - except the final trailer frame never arrived.
Across an organisation, would you put gRPC balancing in every client library or terminate every connection in a sidecar data plane?
basics
~20 sClient-side balancing costs no extra hop but duplicates the policy in every language and ships only when callers redeploy. A sidecar centralises the policy at the price of a hop, a process per workload, and a new failure domain.
Where should the .proto defining a gRPC service live, who owns it, and what does the generated-code step cost consumers?
basics
~20 sThe implementing team owns the file, but it should be published from one place every consumer builds against rather than copied per repository. The cost is a build-time dependency for every consumer: a caller built from generated code reaches a new method only after rebuilding.
In a gRPC bidirectional streaming call, must the server wait for the client's last message before replying?
basics
~20 sNo. The two directions of a bidirectional gRPC call are independent: the server may answer after the first message, interleave replies with incoming messages, or wait for the whole sequence. The application protocol decides, not gRPC.
In gRPC, how do grpc-encoding, grpc-accept-encoding and the Compressed-Flag byte negotiate message compression, and what happens when a receiver cannot decode the encoding?
basics
~20 sgrpc-encoding names the algorithm a sender uses, grpc-accept-encoding lists what it can decode, and each message's Compressed-Flag says whether that message is compressed. A server given an unsupported algorithm fails with UNIMPLEMENTED; a client fails with INTERNAL.
In gRPC, how is a service's fully qualified name derived from its .proto file, and what breaks when the package line changes?
basics
~20 sA service's fully qualified name is the proto package, a dot, then the name in the service stanza, and it is case-sensitive. Changing the package line renames the service, so callers built against the old name no longer reach it.
What does gRPC-Web's text variant change about a response body, and what trips decoders up?
basics
~20 sThe text variant, application/grpc-web-text, base64-encodes the whole body - frames, payloads and trailer block alike. A client asks for it with Accept: application/grpc-web-text. Its trap is that base64 padding does not line up with frame boundaries.
A team adds several large gRPC metadata keys to every call, and some calls now fail before the handler runs. Why?
basics
~20 sMetadata rides in a size-bounded field block. The gRPC specification suggests a default limit of 8 KiB on request metadata and trailers, and the HTTP/2 peer advertises its own limit, so an oversized block is rejected by the transport before any handler sees the call.
A gRPC call ends with an HTTP/2 stream reset and no grpc-status — how does the client decide what to report?
basics
~20 sThe client maps the reset's HTTP/2 error code onto a gRPC status. REFUSED_STREAM means the server never processed the call and becomes UNAVAILABLE; CANCEL becomes CANCELLED; most others become INTERNAL, since the call ended abnormally.
Curators debug a gRPC catalogue fleet through a reverse proxy mid-rollout and reflection hands them two definitions of one message. What happened?
basics
~20 sA reflection answer describes the instance that produced it. During a rollout the pool holds two builds with different descriptors, and separate calls through a reverse proxy can reach different instances, so two lookups return two versions of the same message.
A gRPC caller's channel was created hours ago, so a freshly doubled worker pool receives nothing from it — what moves those calls?
basics
~20 sNothing in gRPC rebalances an established connection on its own. New workers are picked up only when the caller re-resolves, which happens after a subchannel fails or after the server bounds connection lifetime and closes gracefully.
showing 31–45 of 45