Welcome and good luck!
This challenge is not pass / fail. We want you to perform as well as you can in an environment where you are comfortable.
This exercise is a short simulation of the environment that we work with every day. More important than actually solving the problems, we want to see how you go about solving problems and learning about the technologies that are essential in your job.
The goal of this challenge is to exhibit your working knowledge of Javascript, Postgres, Docker, and Git. We want you to use your problem solving and pattern recognition skills to come up with your own solution. Throughout the process your interviewer remains as a first class resource, and is available for pair programming and any questions. Do not hesitate to contact me at [email protected].
- Make a private clone the repo and work on your clone
- Click 'use this template' on the top right of the github page and create a private clone
- Do not fork it, as the fork will be public
- Complete the code to achieve the described task
- Complete a small technical write up describing what you did, in
./description.md
- Add @matt-forster to the private repository and email [email protected] with your completion.
The goal is to create a working NodeJS API that runs in Docker and communicates with a Postgres database. This repo has the framework and network already created through docker, so your task is to fill out the program and run it.
In the automotive industry a dealership can sell multiple vehicle makes, like Honda and Acura, often times on the same lot. We have to manage the relationship between a dealer and the vehicles available to them.
The goal is to list a set of dealers and a set of makes, and create an API to connect the two. The database will have the two models already loaded with some data. We need to create the relationship between them, and the API to manipulate that relationship.
The dealer model looks like this:
interface dealer {
dealer_id: string (uuid);
dealer_name: string;
}
The make model looks like this:
interface make {
make_id: string (uuid);
make_name: string;
}
You will need to come up for the model that represents the relationship between the dealer and the make.
Along with a short description document describing the structure, create a set of routes that:
- Lists the available dealerships in the system
- Lists the available makes in the system
- Returns a single dealership in the system
- Lists the makes that are related to a single dealership in the system
- Creates a relationship between a dealership and a make
We've created two folders, one representing the JS HTTP API and one representing the database schema and data.
./api/index.js
: The entrypoint where you should start the API server./database/database-schema.sql
: The schema file that contains the table and relation definitions
We've setup the network and image files for you in the ./api
and ./database
folders. Along with that, we've included some scripts on the root that will help run the stack:
docker:start
: Will pull, build and start the images.docker:stop
: Will stop the containers if they are running.docker:remove
: Will remove the built images. To make any changes to the built database schema (./database/database-schema.sql
), the image needs to be removed and rebuilt.docker:reset
: Will run the above scripts to reset if they are already running.
Some important addresses that you can use on your local host:
- API:
http://localhost:8888
- Database:
postgres://test:test@localhost:5432/challenge
- git
- github account
- docker & docker compose
- nodejs + package manager (latest)
- postgres client (to connect on your localhost and inspect the database, I recommend https://www.pgcli.com/)
- curl (to test your endpoints)
- HTTP Server Libraries: Express, Restify, Fastify
- NodeJS Postgres Client
- Postgres v10 Documentation
- NodeJS v14 Documentation