Skip to main content

Explain the difference between REST and GraphQL. How does testing differ?

  • REST
  • GraphQL
  • API architecture

Answer it first, then compare. Nothing here is saved or scored.

Model answer

REST: fixed endpoints per resource, HTTP verbs for CRUD, multiple round trips for related data. GraphQL: single endpoint, client specifies exactly what data it needs, fewer round trips. Testing differences: REST, test each endpoint/method combo. GraphQL - test queries, mutations, and subscriptions; validate query depth limits, authorization per field, and N+1 query performance. Both need schema validation, auth testing, and error handling tests.

What interviewers listen for

  • Schema-first thinking
    You validate response shape before you assert on values, every time.
  • Status-code literacy
    You can defend why 401 vs 403 vs 422 matters for the consumer.
  • Contract awareness
    You know when consumer-driven contract tests beat end-to-end checks.
  • Auth fluency
    You can describe rotating tokens across parallel workers without secrets in logs.

See all 35 api testing questions

Written by , Senior QA Automation Engineer, 50+ QA candidate interviews conductedLast updated July 2026