Skip to content

Latest commit

 

History

History
 
 

backend

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Code challenge - backend

This code challenge tests your backend skills.

Scenario

We had a super GDPR compliant server for a list of fake users, but someone deleted the implementation! Oh no! Your task is to:

  1. Read this README
  2. Install dependencies with yarn or npm (we usually use yarn)
  3. Create the server implementation with the http server of your choice.
  4. Make sure that the tests pass (yarn test)
  5. (If you are applying for a job) Submit your work to us (See ../../README.md) and we will discuss it in the next interview!

MVP

  • Server runs on port 4848 (because reasons...)
  • /api/users endpoint serves all the data under data/data.json with status code 200
  • /api/users/${id} endpoint serves a single user data by ID
  • /api/users/xxx serves 404 not found.
  • All tests pass

Example query:

Query:

{
  user(id: 1) {
    name
    address {
      street
    }
  }
}

Result:

{
  "name": "Tevin Gislason",
  "address": {
    "street": "Vilma Freeway"
  }
}

Hints

  • The tests are done with Jest but you can use the test runner of your choice if needed.

  • You'll need a GitHub account to get the API token. See settings/tokens.

  • This project uses our styleguide, which might not fit 100% to your current coding style. Not to worry, we are quite flexible with it and formatting is handled by Prettier in pre-commit phase.

Bonus points

We use GraphQL a lot in our projects these days. Modify the server so that the data is queryable from /graphql endpoint and /graphiql serves GraphiQL IDE for exploring the data.

Hint: We quite often use Apollo for these kinds of tasks.