You should not encounter any problems in the setup phase. If that happens - please let us know.
In general, please reach out if you have questions or concerns before and during the assignment.
When you're done, you can either:
-
Email your repo.
-
Setup a private GitHub repo and invite @hodbn and @itaischwartz as collaborators.
-
The assignment should take up to five hours. Code is never perfect :)
-
Don’t use any more third-party libraries (i.e., your
go.modmust not change). -
Don’t complete the implementation of the service’s logic (no need to implement
DELETE, etc). -
The code you add should be production-grade, it’s your judgment what that means.
This is an existing pet store service based on the pet store API with a simple monitoring stack of Prometheus and Grafana.
Add a requests-per-second metric to the server, partitioned by the route (bonus: also partition by HTTP method).
Note: Your code can assume the usage of the gorilla/mux framework.
foo@bar:~$ docker compose up --build
...
foo@bar:~$ # docker compose down -v
...The services will be available on:
-
petstore: http://localhost:9900/api
-
prometheus: http://localhost:9901/
-
grafana: http://localhost:9902/
Additionally, this setup will run a traffic generator against petstore with:
-
pet creations: ~1 rps
-
pet retrievals: ~5 rps
You can see the predefined dashboard on grafana (default creds are admin:admin). Before you complete the assignment it'll look like this:

After you're done, it should look like this:

You can build the service binary and run it with
foo@bar:~$ make run
CGO_ENABLED=0 go build -v -o server cmd/app/main.go
./server
INFO[0000] Starting HTTP serverThe server will serve the service on http://localhost:8080/api.
We've implemented some tests for you. You can run them with:
foo@bar:~$ make test
go test -race ./... -coverpkg=./... -coverprofile=cover.txt
? github.com/tanninio/home-assignment/internal/app [no test files]
? github.com/tanninio/home-assignment/internal/common [no test files]
ok github.com/tanninio/home-assignment/cmd/app 1.635s coverage: 64.0% of statements in ./...
ok github.com/tanninio/home-assignment/internal/adapters 1.972s coverage: 44.8% of statements in ./...
ok github.com/tanninio/home-assignment/internal/ports/http 2.255s coverage: 3.9% of statements in ./...