
gRPC Interview Prep
Q1. What is gRPC?
1. Simple metaphor gRPC = express highway for data — faster and more structured than REST roads.
2. Deep dive theory
- Google Remote Procedure Call.
- Uses HTTP/2 + Protobuf for serialization.
- Supports bidirectional streaming.
- Strongly typed contracts.
Q2. How is gRPC different from REST?
1. Simple metaphor
- REST = postal service (JSON text, slower).
- gRPC = phone call (binary, faster, bidirectional).
2. Deep dive theory
- REST: JSON over HTTP/1.1, text-heavy.
- gRPC: Protobuf over HTTP/2, binary, smaller messages.
- REST: simple, widely adopted.
- gRPC: faster, but requires code generation + tooling.
Q3. What is Protobuf in gRPC?
1. Simple metaphor Protobuf = compressed recipe card — short, structured, easy to read by machines.
2. Deep dive theory
- Protocol Buffers = serialization format.
- Compact binary representation.
- Contract-first →
.proto
defines service + messages.
syntax = "proto3";
service Greeter {
rpc SayHello (HelloRequest) returns (HelloReply);
}
message HelloRequest {
string name = 1;
}
Q4. What are the communication types in gRPC?
1. Simple metaphor Think of gRPC calls like conversations:
- Unary = single Q\&A.
- Server streaming = waiter brings multiple dishes after one order.
- Client streaming = customer gives multiple orders, then gets one bill.
- Bi-directional = both sides chat freely.
2. Deep dive theory
- Unary.
- Server streaming.
- Client streaming.
- Bi-directional streaming.
Q5. What is HTTP/2 and why does gRPC use it?
1. Simple metaphor HTTP/1.1 = one-lane road. HTTP/2 = multi-lane expressway → multiple requests simultaneously.
2. Deep dive theory
- Multiplexed streams.
- Header compression.
- Binary framing.
- Server push.