5 GraphQL Interview Questions and Answers You Should Know
Tags: graphql, interview, interviewquestions, fullstack
Published: 2018-07-14 07:03:57

---
title: 5 GraphQL Interview Questions and Answers You Should Know
published: true
description: 5 GraphQL Interview Questions and Answers You Should Know
tags: graphql, interview, interview questions, fullstack
canonical_url: https://www.fullstack.cafe/blog/5-graphql-interview-questions-you-should-know
---
![5 GraphQL Interview Questions You Should Know](https://images.pexels.com/photos/527/man-person-people-train.jpg?auto=compress&cs=tinysrgb&dpr=2&h=350)
GraphQL is a query language for APIs and a runtime for fulfilling those queries with your existing data. GraphQL provides a complete and understandable description of the data in your API, gives clients the power to ask for exactly what they need and nothing more, makes it easier to evolve APIs over time, and enables powerful developer tools.

> Originally published on [FullStack.Cafe - Never Fail Your Tech Interview Again](https://www.fullstack.cafe)

### Q1: What is GraphQL?
> Topic: **GraphQL**<br/>Difficulty: ⭐⭐

GraphQL is a query language created by [Facebook](http://facebook.github.io/) in 2012 which provides a **common interface between the client and the server for data fetching and manipulations**.

The client asks for various data from the GraphQL server via queries. The response format is described in the query and defined by the client instead of the server: they are called **client‐specified queries**.  
The structure of the data is not hardcoded as in traditional REST APIs - this makes retrieving data from the server more efficient for the client.

🔗**Source:** [howtographql.com](https://www.howtographql.com/advanced/5-common-questions/)
### Q2: List the key concepts of the GraphQL query language
> Topic: **GraphQL**<br/>Difficulty: ⭐⭐⭐

**Key concepts of the GraphQL** query language are:

*   Hierarchical
*   Product‐centric
*   Strong‐typing
*   Client‐specified queries
*   Introspective

🔗**Source:** [blog.risingstack.com](https://blog.risingstack.com/graphql-overview-getting-started-with-graphql-and-nodejs/)
### Q3: Explain the main difference between REST and GraphQL
> Topic: **GraphQL**<br/>Difficulty: ⭐⭐⭐

The main and most important difference between REST and GraphQL is that *GraphQL is not dealing with dedicated resources, instead everything is regarded as a graph and therefore is connected and can be queried to app exact needs*.

🔗**Source:** [medium.com/codingthesmartway-com-blog](https://medium.com/codingthesmartway-com-blog/rest-vs-graphql-418eac2e3083)
### Q4: How to do Server-side Caching?
> Topic: **GraphQL**<br/>Difficulty: ⭐⭐⭐

One common concern with GraphQL, especially when comparing it to REST, are the difficulties to maintain server-side cache. With REST, it’s easy to cache the data for each endpoint, since it’s sure that the _structure_ of the data will not change.

With GraphQL on the other hand, it’s not clear what a client will request next, so putting a caching layer right behind the API doesn’t make a lot of sense.

Server-side caching still is a challenge with GraphQL.

🔗**Source:** [howtographql.com](https://www.howtographql.com/advanced/5-common-questions/)
### Q5: Are there any disadvantages to GraphQL?
> Topic: **GraphQL**<br/>Difficulty: ⭐⭐⭐⭐

Disadvantages:

*   You **need to learn** how to set up GraphQL. The ecosystem is still rapidly evolving so you have to keep up.
*   You need to send the queries from the client, you can just send strings but if you want more comfort and caching you'll use a client library -> **extra code** in your client
*   You need to define the schema beforehand => **extra work** before you get results
*   You need to have a graphql endpoint on your server => **new libraries** that you don't know yet
*   Graphql queries are **more bytes** than simply going to a REST endpoint
*   The server needs to do **more processing** to parse the query and verify the parameters

🔗**Source:** [stackoverflow.com](https://stackoverflow.com/questions/40689858/are-there-any-disadvantages-to-graphql)

> *Thanks 🙌 for reading and good luck on your interview!* <br/>*Check more FullStack Interview Questions & Answers on 👉 [www.fullstack.cafe](https://www.fullstack.cafe)*