CS FundamentalsHardProduct-company API design interview

A mobile home screen needs a user's name, the titles of their last 3 orders and their unread-notification count. The REST API needs 3 calls returning large objects. Which statement about GraphQL is correct?

  1. A. The client can ask for exactly those fields in one query, avoiding over-fetching and multiple round trips, though server-side caching and query cost control become harder
  2. B. GraphQL always makes the server faster
  3. C. GraphQL removes the need for authorisation
  4. D. GraphQL requires one endpoint per field

Correct answer: A. The client can ask for exactly those fields in one query, avoiding over-fetching and multiple round trips, though server-side caching and query cost control become harder

GraphQL lets clients shape responses, solving under- and over-fetching. The trade-offs: plain HTTP caching works less naturally with a single POST endpoint, and expensive nested queries need limits.

More Software Engineering, Git and Cloud Basics questions

Exams that ask this topic