0:00
1:13
1:13

REST vs GraphQL vs gRPC: Which API wins in system design interviews?

Tech

REST is not the answer to every API question, and if that's all you say in a system design interview, you might be in trouble. There are three protocols worth knowing, and each one has a job. REST is certainly your default for CRUD options. Resources as URLs, verbs as actions, and it rides on top of HTTP so you inherit caching, retries, and status codes for free. Then there is GraphQL, which is great for product UIs that need flexible, nested data. Clients write a query describing exactly the shape they want, and the server returns that — no more, no less. One round trip instead of a dozen like their might be with REST. Lastly, gRPC is for internal service-to-service calls where you want speed and strict contracts. Binary over HTTP/2, Protobuf schemas generate typed clients in every language, and you get streaming and multiplexing built in. It's significantly faster than JSON over REST when you're making millions of calls between services. \ So in the interview: default to REST, reach for GraphQL when the client needs flexible or deeply nested data, and drop gRPC when you're designing internal service communication at scale. Match the tool to the job. Watch the full video breakdown on hellointerview.com #shorts

ADVERTISEMENT
Comments 23 irmela_bärer: Graphql is very rare but gRPC should be the go to for machi…