Medium👤 3-5 years👤 8-15 years 1 min read

REST vs GraphQL vs gRPC — when would you choose each?

Asked inAmazonGoogleMicrosoft
#rest#graphql#grpc#api design#protobuf
Report issue

⚡ Short Answer

REST: resource CRUD, public APIs, cache-friendly, ubiquitous. GraphQL: clients need flexible, exact field selection across many resources (avoids over/under-fetching) — great for varied frontends. gRPC: high-performance internal service-to-service (HTTP/2, Protobuf, streaming, codegen).

Coffee Chat Question

Concept Made Simple

REST vs GraphQL vs gRPC — when would you choose each?

🧠Mind Map Answer

Remember It Faster

RESTpublic CRUD, cacheable, simple
GraphQLclient-shaped queries, no over-fetch
gRPCinternal, fast, Protobuf, streaming

🔥What If?

Think Beyond the Expected

A mobile app over-fetches huge REST payloads and makes many round-trips — REST tweak or GraphQL?

You can fix REST with sparse fieldsets (?fields=) and composite endpoints, but if many clients need wildly different shapes across many resources, GraphQL lets each client request exactly what it needs in one round-trip. Choose by how variable the client needs are vs added server complexity.

😂Real World

Common architecture: REST/GraphQL at the public edge for clients, gRPC for fast internal service-to-service calls — each used where its strengths fit, not dogmatically.

🎯Interviewer's Expectation

Keywords they're listening for:

REST public/cacheableGraphQL flexible field selection / over-fetchgRPC internal/HTTP2/Protobuf/streamingchoose by use case

⚠️Common Mistakes

  • Picking GraphQL/gRPC by hype, not need
  • Ignoring GraphQL's caching/N+1 challenges
  • Exposing gRPC directly to browsers

Best Practices

  • Match protocol to the use case
  • REST/GraphQL at the edge, gRPC internally
  • Weigh added complexity vs benefit

🔁Follow-up Questions

  • 1What problems does GraphQL introduce (caching, N+1, complexity)?
  • 2Why is gRPC poor for browsers directly?
  • 3How do you cache GraphQL?

🧩Related Technologies

GraphQLgRPCProtobufHTTP/2

Continue Learning with AI

Take this question deeper with your favourite AI assistant. Pick a depth, copy the prompt, or open it directly — AI is your learning companion, not a shortcut.

Plain-language foundations

I'm preparing for a software engineering interview and want to understand this from scratch, as a beginner.

Topic: HATEOAS (REST APIs)
Interview question: "REST vs GraphQL vs gRPC — when would you choose each?"

Please:
1. Explain the core idea in simple, plain language, using an everyday analogy.
2. Define any technical terms you use.
3. Walk through one small, concrete example.
4. Finish with a single sentence I can easily remember.

Keep the tone friendly and assume I'm new to this topic.
Open inChatGPTGeminiClaude

Was this answer helpful?

Support our platform by exploring our recommended products.

As an Amazon affiliate, purchases through these links may earn us a small commission — at no extra cost to you. It helps keep Full Stack Interview Guru free.

Related Questions