Spring / Spring gRPC Interview Questions
How does gRPC differ from traditional REST APIs?
The two differ at both the transport and payload layers. gRPC runs on HTTP/2, which multiplexes many logical streams over a single TCP connection and compresses headers; classic REST implementations typically run on HTTP/1.1, opening more connections and repeating full headers per request.
On the payload side, gRPC uses binary Protocol Buffers, while REST conventionally uses text-based JSON. Protobuf is more compact and faster to parse, but not human-readable without tooling, whereas JSON is easy to inspect with a browser or curl.
gRPC is also contract-first: the .proto file is the single source of truth that generates both client and server code. REST has no single enforced contract format - OpenAPI/Swagger can be layered on, but it's optional. Finally, gRPC natively supports four call shapes, including bidirectional streaming, where REST needs extensions like WebSockets or Server-Sent Events to achieve the same thing.
More Related questions...