gRPC Interview Questions: Defend Your Trade-Offs

A repeatable define-cost-example structure for gRPC interview questions, with a full sample answer, a .proto evolution walkthrough, a gRPC vs REST table and a streaming scenario.

By AI Interview AssistantPublished 12 min read

Expect gRPC interview questions to start with a definition and then push you to justify a choice: why gRPC over REST here, what Protocol Buffers actually buy you, and what breaks when a stream stalls. Answer each in three moves: define the concept in one sentence, name the cost it carries, then give a concrete example from a system you can describe honestly. The interviewer is checking whether you can reason about trade-offs, not whether you memorised the docs.

The three-move answer: define, cost, example

Every gRPC answer you give should follow the same shape, because it gives the interviewer something to follow up on and shows judgment rather than recall.

  1. Define the concept in one sentence. No preamble, no history. "gRPC is a contract-first RPC framework that runs over HTTP/2 and uses Protocol Buffers by default."
  2. Name the cost it carries. What you give up or take on: tooling, debuggability, browser support, operational complexity. This is the step most candidates skip, and it is the one the panel remembers.
  3. Give a concrete example from a system you can describe honestly, with the before-and-after effect stated as your own experience, not a statistic.

Why this beats reciting docs: a definition alone shows you read a page. The cost shows you have shipped something. The example gives them a hook, and a hook is what they want, because it lets them test your depth on ground you chose.

One warning: pick a system you actually worked on. If you have only used REST, say so and answer from what you know about HTTP and typed contracts. Interviewers can tell when an example is borrowed, and a borrowed example collapses under the first follow-up.

Why gRPC exists: the problem it solves

It targets four problems: typed contracts across services, efficient payloads, multiplexed streams over one connection, and code generation in many languages.

The cost is real. Payloads are less human-readable on the wire, so you cannot poke an endpoint with curl and read the response. You take on a build step for code generation. Browser clients need a proxy or a different transport, because browsers do not expose the raw HTTP/2 framing gRPC relies on.

A worked size comparison

Assume a service returns a user record with an integer id, a 20-character email and a 12-character display name. Assume JSON overhead of roughly 40 bytes for field names, quotes, braces and commas, and a Protocol Buffers overhead of roughly 4 bytes for field tags and length prefixes. The string bytes themselves are the same in both.

JSON payload:   string bytes 32 + overhead 40 = ~72 bytes
Protobuf:       string bytes 32 + overhead  4 = ~36 bytes

So the binary form is about half the size here. That is not a law: with three short fields the gap is modest, and it grows with volume and schema reuse. Say "smaller for this shape of message because the field names are not on the wire" rather than "always smaller". The generated client stub is the other half of the win: you call a typed method and the compiler checks the arguments, where a hand-written REST client gives you a dictionary and a runtime surprise.

Protocol Buffers questions: schema, compatibility, cost

A .proto file declares message types, field numbers and service definitions. Field numbers matter more than names on the wire: the encoded payload carries the number, not the field name, so renaming a field is safe and renumbering it is a breaking change.

The compatibility rules you should be able to state without hesitation:

  • Never reuse a field number.
  • Mark retired fields with reserved so nobody claims the number later.
  • Adding a new optional field is safe for old readers, which simply ignore it.
  • Changing a field's type is not safe.

The cost: your build needs a codegen step, and debugging a binary payload is harder than reading JSON. Budget for tooling such as a schema registry or a reflection endpoint, or you will be decoding bytes by hand at 2am.

Before and after: adding a field to User

Here is the original schema:

syntax = "proto3";

message User {
  int64 id = 1;
  string email = 2;
}

And here it is after adding a display name and retiring an old field:

syntax = "proto3";

message User {
  reserved 3;
  reserved "legacy_handle";

  int64 id = 1;
  string email = 2;
  string display_name = 4;
}

An old client built against the first schema still works. It decodes fields 1 and 2 and ignores field 4, because unknown fields are skipped by number. A new client talking to an old server sees no display_name and gets the default empty string. That is why adding an optional field is safe in both directions, and why field 3 is reserved: if someone later used 3 for a different type, an old client would try to decode the new bytes as the old field and produce garbage or an error.

gRPC vs REST: the comparison the interviewer wants

Compare on named criteria, one line each, and pair every claim with the situation where it matters.

CriteriongRPCRESTWhen this matters
Contract and typing.proto contract, generated stubsOften OpenAPI, often hand-written clientsStrict multi-service contracts favour gRPC
Payload formatBinary by defaultUsually JSONHigh volume or many small messages favour gRPC
TransportHTTP/2HTTP/1.1 or HTTP/2Multiplexed streams need HTTP/2
StreamingUnary and three streaming modes built inUsually request-response, streaming bolted onProgress feeds and sync favour gRPC
Browser supportNeeds a proxy or gRPC-WebNativePublic browser clients favour REST
CachingNot a natural fitHTTP caching works out of the boxCacheable public reads favour REST
Tooling and debuggabilityCodegen step, binary payloadscurl and a browser tabFast incident debugging favours REST
Operational maturityStrong, more moving partsVery mature, fewer partsSmall teams may prefer the simpler stack

The recommendation by situation: internal service-to-service calls with strict contracts favour gRPC. Public or browser-facing APIs with caching needs favour REST. Mixed systems often use both, with gRPC inside the mesh and REST at the edge.

The mistake to avoid is declaring one "better" without naming the situation. Fix it by always pairing the choice with the context it fits: "gRPC for this call because both ends are ours and the contract is strict; REST for the public read path because it needs to be cacheable."

Full sample answer: why gRPC over REST here?

The setting is a backend role, and the question is about an internal call between two services you own.

"I would pick gRPC for the call between our order service and our inventory service because both ends are ours, the contract changes rarely, and we want the compiler to catch a mismatch before deploy. The cost I accepted is that the payload is binary, so we cannot curl the endpoint and read the response; we added a reflection endpoint and a small CLI so on-call can inspect a call without writing a client. The other cost is the codegen step in the build, which we paid once. Before the change, the two services shared a hand-written client and a JSON contract that drifted: a field rename shipped on one side and broke the other at runtime. After moving to a .proto, a rename that would break a caller fails the build instead. I would not use it for the public API, because browsers need a proxy and we want HTTP caching there."

That answer runs about 150 words and hits all three moves. What makes it work: the cost is named before the interviewer asks, the before-and-after is stated as a build failure versus a runtime failure rather than a percentage, and the last sentence volunteers the case where the choice would be wrong. That last sentence is what separates a reasoned answer from a memorised one.

Likely follow-ups after this answer:

  • "What breaks if you change a field type?" Direction: old readers misdecode new bytes, so treat it as breaking and add a new field instead.
  • "How do you debug a binary payload?" Direction: reflection, a decoding CLI, or logging at the boundary, not hex dumps.
  • "Why not just use JSON over HTTP/2?" Direction: you keep readability but lose the generated contract and the size win.

Streaming questions: unary, server, client, bidirectional

The four call types in one line each:

  • Unary: one request, one response. The default for most calls.
  • Server streaming: one request, a stream of responses. Good for a progress feed or a large result set.
  • Client streaming: a stream of requests, one response. Good for an upload that the server summarises.
  • Bidirectional: both sides stream. Good for a chat-like sync where either side can send at any time.

The cost of streaming is where interviews get interesting: backpressure, cancellation, error handling mid-stream, and harder testing and observability. A stream that stalls is harder to see than a failed request.

Worked scenario: a progress feed that loses its client

Assume a server-streaming call sends progress updates for a long job, one message every few seconds. The client disconnects mid-stream, perhaps because the user closed the tab.

What happens depends on the stack, so answer with the trade-off rather than a guarantee. On the server, the write to the stream eventually fails or the context is cancelled, and a well-written handler watches for cancellation and stops the work or marks it resumable. The trade-off: stopping the work saves compute but loses progress; continuing the work survives a reconnect but may burn resources for a user who never returns. A common middle path is to keep the job running server-side and let a reconnecting client resubscribe by job id, which costs you a place to store job state.

Expect the follow-up: "What happens to an in-flight stream when a pod restarts?" The honest answer is that the stream breaks, and your design decides what the client sees: a retry with resumption from a known offset, or a clean error the client can act on. Do not claim the stream survives; it does not.

Where gRPC answers go wrong under follow-up

Four mistakes show up again and again, each with the fix:

  • "gRPC is faster" with no qualifier. Fix: name the payload and transport assumptions and say "faster for this workload because the field names are not on the wire and the connection is multiplexed".
  • Claiming Protocol Buffers are always smaller. Fix: note that small messages with few fields can be close to JSON, and the win grows with volume and schema reuse.
  • Hand-waving schema evolution. Fix: give the reserved-field rule and one concrete breaking change you would refuse, such as changing a field's type in place.
  • Ignoring the browser and public-API case. Fix: mention the proxy or REST alternative and when you would pick it.

For the wider version of this reasoning across services, see backend interview trade-off reasoning and distributed systems trade-off questions. If your weak spot is the HTTP layer underneath, networking concepts and trade-offs covers it, and REST API design trade-off answers is the natural companion when the panel switches to REST.

The one rule to carry into the room

End every gRPC answer with the situation where your choice would be wrong. That single sentence is what separates a memorised answer from a reasoned one, and it invites the follow-up you are ready for. Before the interview, practise the define-cost-example structure out loud on three questions: why gRPC, how schema evolution works, and what happens when a stream stalls. Record yourself, listen back, and check your own answers. If you use an AI tool to rehearse, treat its wording as a prompt, verify the technical claims yourself, and answer in your own words.

Frequently asked questions

Do I need to know gRPC internals like HTTP/2 framing to pass the interview?

No. You need to know that gRPC runs over HTTP/2 and why that matters, mainly multiplexed streams over one connection. Framing details rarely come up unless the role is protocol or infrastructure work. If asked, say what you know, name the layer you would check, and steer back to the design decision.

What if the interviewer asks about gRPC-Web and I have only used server-side gRPC?

Say plainly that you have used gRPC between services, not from a browser, then reason from what you know: browsers do not speak the raw transport, so a proxy or a different transport sits in between. That answer shows honesty and a working model, which is stronger than a confident guess.

How do I answer a gRPC question if my only experience is REST?

Answer from the concepts you do know: typed contracts, payload size, caching and debuggability. Compare gRPC to what you have built with REST, and say where you would expect the costs to land. Interviewers accept limited exposure when the reasoning is sound and the boundaries of your knowledge are clear.

Is it acceptable to say 'I would use REST here' in a gRPC-focused interview?

Yes, if you justify it with the situation. A public, cacheable, browser-facing API is a good case for REST, and saying so with reasons shows judgment. The risk is dismissing gRPC outright. Pair your choice with the case where gRPC would win, so the panel sees a decision rather than a preference.

How deep should I go on Protocol Buffers encoding in a 45-minute interview?

Go as deep as the follow-up demands and no further. Know that field numbers travel on the wire, that unknown fields are skipped, and the reserved-field rule. If asked about varints or wire types, give the one-line idea and offer to go deeper, rather than reciting a spec you half-remember.

Preparing gRPC answers? See how AI Interview assistant works.

A tray being handed through a restaurant service window into a clean orderly kitchen

15 min read

REST API Interview Questions: Talk Through Design Decisions

REST API interview questions reward reasoning, not definitions. Learn a four-part answer pattern for resources, methods, idempotency, pagination and versioning.

  • Rest api interview questions
  • Rest api interview answers
A workstation with a monitor showing request and response arrows between two boxes, a keyboard and an API sketch

9 min read

Backend Development Interview Questions: Define, Then Trade Off

Backend development interview questions are trade-off questions in disguise. Learn a two-part answer shape, a worked idempotency answer and a 20-minute practice routine.

  • Backend development interview questions
  • Backend development interview answers
A wide checkpoint hall seen from above with several lanes guiding travellers toward different gates

14 min read

API Gateway System Design Interview: A Spoken Walkthrough

A time-boxed script for the API gateway system design interview: what to clarify, what to sketch, and how to defend routing, auth, rate limiting and resilience out loud.

  • Api gateway system design interview
  • Design api gateway