Full Stack Developer Interview Question

When would you pick GraphQL over REST for a new service?

What the interviewer is probing, how to structure your answer, and a spoken example you can adapt.

Quick answer

Pick GraphQL when several different clients need different shapes of the same connected data and you are tired of overfetching or shipping an endpoint per screen. Pick REST when the surface is small, HTTP caching matters, or the consumers are machines rather than screens. GraphQL does not remove complexity; it moves it from endpoint sprawl into resolver depth, query cost limits, and caching that you now own.

Why interviewers ask this

This checks whether you choose technology from constraints or from fashion. The interviewer wants to hear a real tradeoff, particularly around caching and query cost, because those are the two places GraphQL teams get hurt six months in. A candidate who can argue either side and then commit reads as someone safe to give architectural decisions to; a candidate who only lists GraphQL benefits does not.

How to structure your answer

  • State the condition that makes GraphQL worth it.
  • State the condition that makes REST the better default.
  • Name the operational costs GraphQL adds.
  • Land on a recommendation for the context you were given.

Example answer

Spoken example, first person

My deciding factor is client diversity. If there is one web client and the endpoints map cleanly to screens, REST is less machinery and you get HTTP caching, CDN behavior and debuggability with curl for free. Once you have a web app, a mobile app and a partner integration all wanting different slices of the same graph, REST turns into either fifty bespoke endpoints or fat responses that mobile users pay for on cellular data. That is when GraphQL pays. What I make sure the team knows up front is what comes with it. You need query depth and cost limits or a single nested query can hammer the database, you need dataloader style batching or resolvers produce N plus one queries by default, and HTTP caching mostly stops working because everything is a POST to one URL, so you cache at the resolver or entity level instead. On a mid sized product I would honestly start with REST and add GraphQL only when a second very different client appears.

Walking into this interview soon? GhostPilot listens to your live call, spots the question the moment it is asked, and puts a structured answer on your screen in real time. Try it on your next mock, or grab a $29 Session Pass, no subscription, for the real thing.

See how it works

Follow-up questions to expect

  • How would you stop a malicious deeply nested query?
  • How do you handle caching in GraphQL given everything is one endpoint?
  • How do you version a GraphQL schema without breaking clients?

Related full stack developer questions

Your interviewer will ask their own version of this. Paste your actual job description into the free Question Predictor and get the 20 questions that role is most likely to ask, with what each one is really probing.

Predict my questions

Rehearse the hard questions before they are asked

Practise with a live copilot, then walk in ready. A $29 Session Pass gets you through the interview with no subscription and no lock-in.

Get GhostPilot