Scrivio Interview library
ConceptFoundations6 min read · updated 13 November 2026

Large systems usually offer more than one API style: REST over HTTP with JSON, gRPC with Protocol Buffers over HTTP/2, and GraphQL with a typed schema. Each fits some callers better than others.

Which style would you choose for a public partner API, internal high-volume service-to-service calls, and a mobile app whose screens need varied data, and which properties drive each choice?

For a public partner API I would choose REST with JSON, because every language and tool can call it, HTTP caching and status codes work as expected, and OpenAPI documents it well. For internal high-volume service-to-service calls I would choose gRPC, for compact binary messages, generated typed clients, streaming and deadlines carried with each call, accepting that it needs HTTP/2 end to end and a proxy for browsers. For a mobile app with varied screens I would choose GraphQL or a backend for frontend, so each screen gets exactly the fields it needs in one round trip, and I would weigh caching and operational cost in every case.

Why this question is asked

Large systems rarely use a single API style, and arguments about which one is best usually miss the point: each style is best for a particular kind of caller. Interviewers ask this question to see whether we choose by the properties that matter to each caller, such as reach, efficiency, flexibility, caching and operational cost, rather than by fashion. In this answer, we will recap the three styles, choose one for each of the three callers with the reasons, compare caching, and look at the operational costs that come with each.

1A Quick Recap of the Three Styles

REST models the API as resources addressed by URLs, such as /orders/42, and uses HTTP methods (GET, POST, PUT, DELETE) and status codes with, usually, JSON bodies. It rides on the most widely understood protocol on the internet.

gRPC defines services and messages in Protocol Buffers, a compact binary format with a schema, and generates client and server code in many languages. It runs over HTTP/2, supports streaming in both directions, and carries metadata such as deadlines with each call.

GraphQL exposes one typed schema of objects and fields through a single endpoint. The client sends a query naming exactly the fields it wants, possibly across several related objects, and receives exactly that shape back.

2Public Partner API: REST With JSON

Partners use every language, framework and integration tool imaginable, many of them low-code platforms and scripts. REST with JSON is the one style all of them can call with no special tooling, and a developer can try it with curl in a minute. HTTP semantics work as everyone expects: GET is safe and cacheable, status codes say what happened, and proxies, gateways and CDNs understand it. An OpenAPI description gives partners documentation, generated SDKs and test consoles.

Java
GET /v1/orders/42 HTTP/1.1
Authorization: Bearer ...
-> 200 OK
Cache-Control: private, max-age=30
{"id": 42, "status": "SHIPPED", "total": {"amount": "59.90", "currency": "EUR"}}

Notice that nothing in this exchange needs a library. That low barrier is worth more to a partner platform than a few milliseconds of encoding speed.

3Internal High-Volume Calls: gRPC

Between our own services, the trade-offs flip. We control both sides, so tooling is not a barrier, and at high volume the efficiency of the encoding and the safety of typed contracts pay off. Protobuf messages are smaller and cheaper to parse than JSON, generated stubs remove hand-written client code, and the schema makes breaking changes visible in code review.

Java
// inventory.proto
service InventoryService {
rpc Reserve(ReserveRequest) returns (ReserveReply);
rpc WatchStock(WatchRequest) returns (stream StockLevel); // server streaming
}
// Java caller: deadline travels with the call
ReserveReply reply = inventoryStub
.withDeadlineAfter(300, TimeUnit.MILLISECONDS)
.reserve(ReserveRequest.newBuilder().setSku("A-17").setQty(2).build()); // reserved: true

Streaming and deadlines are first-class: a deadline set by the caller is sent to the server, which can stop work when the caller has given up. The costs are real, though. gRPC needs HTTP/2 end to end, so every proxy and load balancer in the path must support it. Browsers cannot call gRPC directly and need gRPC-Web with a proxy. And binary messages are harder to inspect with everyday tools.

4Mobile App With Varied Screens: GraphQL or a Backend for Frontend

A mobile screen often needs pieces of several resources: an order with its items, each item's product name and image, and the shipment status. With plain REST, that is several round trips over a slow mobile network, or one endpoint that returns far more data than the screen uses. GraphQL lets the screen ask for exactly what it needs in one request.

Java
query OrderScreen {
order(id: 42) {
status
items { quantity product { name thumbnailUrl } }
shipment { carrier eta }
}
}
# one round trip, only these fields in the response

A backend for frontend, a small server-side API built for one client app, achieves the same with REST: it calls the services and returns exactly the shape that screen needs. GraphQL suits many screens changing often; a BFF suits a few stable screens and a team that prefers plain REST.

5Caching and Operational Cost

Caching differs sharply between the three. REST GET responses carry Cache-Control headers and have stable URLs, so browsers, CDNs and proxies cache them for free. GraphQL usually sends POST requests to a single /graphql URL, which shared caches do not cache, so cacheable GraphQL needs persisted queries sent with GET. gRPC has no standard HTTP caching at all; caching happens inside services.

Operational cost counts too. GraphQL lets clients write expensive queries, so it needs query depth and cost limits and monitoring per field, since a single URL tells us nothing about what was requested. gRPC keeps long-lived HTTP/2 connections and multiplexes calls on them, so connection-level load balancers send everything from one client to one server; it needs request-level balancing, through a proxy such as Envoy, a service mesh, or client-side balancing.

Choosing a style per caller
PropertyREST + JSONgRPCGraphQL
Best callerPublic partnersInternal servicesApps with varied screens
Reach and toolingUniversal, curl worksGenerated stubs, HTTP/2 onlyClient libraries, one endpoint
Payload efficiencyText, verboseBinary, compactExact fields, text
HTTP cachingBuilt in for GETNone standardNeeds persisted GET queries
Extra operations workLowHTTP/2-aware load balancingCost limits, field monitoring

6Follow-up questions

What would make you offer gRPC to external partners?

A small number of sophisticated partners with a real need that REST serves badly, typically high-volume or streaming data such as market prices or telemetry, where efficiency and server streaming matter. I would provide supported SDKs, keep the REST API as the default for everyone else, and consider exposing the same services through gRPC-JSON transcoding so both come from one contract.

Why not use GraphQL for internal service-to-service calls too?

Service-to-service calls are usually fixed and high-volume, so the flexibility of choosing fields at runtime adds little, while query parsing and resolver overhead add cost. gRPC's typed, compact calls with deadlines suit them better.

How do you keep the three consistent if you offer all of them?

By deriving them from one domain model and one set of services, so the styles are adapters, not separate implementations. Names, errors and authorisation rules then stay the same across styles.

7Conclusion

In this answer, we chose REST with JSON for public partners because of universal reach, HTTP caching and OpenAPI documentation, gRPC for internal high-volume calls because of compact messages, typed clients, streaming and deadlines, and GraphQL or a backend for frontend for a mobile app with varied screens. We saw that caching works naturally only for REST, and that GraphQL and gRPC each bring operational work: query cost limits and field monitoring, and HTTP/2-aware load balancing.

What to say in the interviewAbout 80 seconds aloud

Open with

I would choose by the caller. For the public partner API, REST with JSON, because every language and tool can call it, including scripts and low-code platforms, HTTP caching and status codes behave as everyone expects, and OpenAPI gives documentation and SDKs.

Then, if they want more

For internal high-volume service-to-service calls, gRPC: Protobuf messages are compact and cheap to parse, we get generated typed clients, streaming, and deadlines that travel with each call.

The costs are that it needs HTTP/2 end to end, browsers need gRPC-Web through a proxy, and load balancing has to understand long-lived HTTP/2 connections, otherwise all calls from one client land on one server.

For the mobile app with varied screens, GraphQL or a backend for frontend, so a screen fetches exactly the fields it needs in one round trip over a slow network.

On caching, REST GETs cache at CDNs and browsers for free, GraphQL usually posts to one endpoint and needs persisted queries over GET to be cacheable, and gRPC has no standard HTTP caching. GraphQL also needs query cost limits and per-field monitoring. So: REST for reach, gRPC for efficiency internally, GraphQL or a BFF for flexible client screens.

About this answer

Last updated
13 November 2026
Checked
Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the official documentation for the version you use. What the checks cover
Where the question comes from
Written by Scrivio for practice. It is not taken from an interview.
Report an issue with this answer

Copy the line below and send it to the author with what you found. It carries the address of this page.

Issue with "Which style would you choose for a public partner API, internal high-volume...": https://scrivio-interview-library.netlify.app/architecture/api-design-at-scale/14b5600cde/