Welcome to Altruistiq! Thank you very much for being here. 🙏
For this assessment we will be using 4 things:
- The code in the repo
- Your laptop to run the code
- Your IDE which you will screenshare
- https://webwhiteboard.com/ for architecturing & brainstorming
This repo will help you kick-start your live coding session. The following has been set up (check package.json for full details) but you're free to use any package you may seem fit:
- express
- mocha
- babel
- axios
- lodash
Hot reloading is enabled and tests rerun when code changes.
Clone this repo, then
npm i
npm run init
Code automatically reloads upon code changes. You will need to refresh your browser if you use it.
npm start
To run test (code and tests are being watched so automatically reruns).
npm test
Please read through all the tasks to understand the full scope of this assessment.
Given the dataset in /lib
, sketch out the data model and its relations.
Can you write the SQL queries to create these tables?
Write an API to query emissions for a single company. It returns the following response:
{
"totalEmission": 10000,
"perCategory": {
"Transportation": {
"id": 1,
"emission": 1000,
"percentageOfTotal": 10,
},
"Electricity": {
"id": 2,
"emission": 9000,
"percentageOfTotal": 90,
},
}
}
Write an API that returns a single emission category for a single company, e.q. query by companyId and activityCategoryId.
{
"emission": 5000,
"percentageOfTotal": 8,
}
Write a couple of tests to make sure your API works as expected.
Secure the API endpoints however you see fit.
Make your API response under 1 second. Keep in mind that your API can be triggered multiple times per second.
Architecture the deploy of your API to AWS.