Thank you for your interest in working at Electricity Exchange. Before we proceed with more formal interviews, we ask that all candidates submit a coding challenge. The coding challenge is a foundational piece of our process and it's referenced later in our process during the technical interviews.
If at any point you have questions concerning the coding challenge and/or interview process, please do not hesitate to email [email protected]
This challenge is intended to assess your coding ability in NodeJS.
We expect that this challenge should not take you longer than 2 hours, but you are free to take as long as you need.
From the root directory there are a few commands that you can run
- npm install - Install all dependencies.
- npm start - Run the project.
- npm run test - Run the unit and e2e test suites (in order to run the e2e test suite you will need to have the application running already).
- npm run test:unit - Run the unit tests and prints coverage metrics.
- npm run test:e2e - Runs the end to end tests (in order to run the test suite you will need to have the application running already).
This project contains the beginnings of a simple REST api.
It consists of an SQLite database with two tables (Sites, Devices), and a simple webserver that currently exposes three RESTful endpoints.
You are expected to implement some new functionality, and ensure this new functionality is tested.
- Implement the endpoint that will make the tests defined in
test/tests/sites.spec.js
pass. - Add an endpoint to retrieve all active devices.
- Update all new and existing endpoints to verify that parameters received are of the correct type & valid, adding any tests you feel are appropriate.
If you can think of any other changes that would improve the project, feel free to outline them in the improvements.txt file in this repo.
Your submission will be reviewed on the following points:
- Your ability to follow the requirements
- Implementation of the requirements
- Code readability and maintainability
- Test quality and coverage
- src/index.js This file initialises the webserver and database and starts the server listening on localhost:3000
- src/lib/Database.js This file is responsible for initialising the database & ensuring migrations are applied.
- test/util/httpClient.js This file exposes a utility for making HTTP requests to the API when running your tests.
- test/tests/*.spec.js These files contain the integration tests for the implemented REST endpoints.
To submit your coding challenge, commit all your changes to the master
branch and run the following command:
git bundle create coding-challenge.bundle HEAD master
Visit the form located here to submit your coding-challenge.bundle
file. We do our best to review and respond to submissions within 5 business days.
Thanks for taking the time to do this coding challenge and here's hoping we talk soon!