Skip to content

Instantly share code, notes, and snippets.

@mavimo
Last active August 22, 2020 13:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mavimo/7a4d724ad47b314ba8d3b3333e28cac2 to your computer and use it in GitHub Desktop.
Save mavimo/7a4d724ad47b314ba8d3b3333e28cac2 to your computer and use it in GitHub Desktop.

ThumbsUP Stats (aka 👍 📈)

Welcome to ProntoPro's backend assignment!

Please read through the instructions below and don't hesitate to ask questions in case you need any clarification on the specs.

Good luck and have fun!

Introduction

We need to build a new product comprising two functionalities:

  • showing to the public the amount of "thumbs up" we received
  • showing to our internal marketing team some stats via a js app about how many "thumbs up" we received in the last 1 min, 5 mins and 15 mins

The underlying APIs will expose some JSON endpoints that will be consumed by our mobile apps and it will allow the users to send a "thumb up"; since mobile app is not yet available we have to define the API contract and send the specs to mobile-app developers. Also note that for the sake of this assignment no authentication mechanism is required for the public endpoint consumed from mobile app.

Services

After some considerations we decided to split the product in two backend services named public-service and private-service.

Public Service

This service will:

  • expose the API that allow us to receive the "thumbs up" from the mobile-app
  • host the web page showing up a public counter with the number of "thumbs up" we received
  • communicate to the private service about the "thumbs up" it received

Private Service

This service will:

  • receive data from the public service
  • expose the following API for the "thumbs up" stats for the js app to consume:
    Request: GET /stats
    Response: {
        "thumbsUp": {
            "1min": 1,
            "5mins": 10,
            "15mins": 100
        }
    }
    

Definition of done

  • You MUST use PHP for one service and Go for the other: it's up to you to decide which component should be built using which language
  • The two services must use a messaging mechanism such as HTTP, AMPQ or gRPC to communicate: data storage mechanisms such as database or files are not allowed as communication system
  • The js app that reads the data from private-service is taken care of by the frontend team, so you should not worry about it
  • Writing unit, integration or benchmark tests is optional but recommended
  • The presence of Makefile, Dockerfile and docker-compose.yml files to help setting up and running the project is optional but appreciated
  • A continuous integration pipeline definition (eg: .travis.yaml, Jenkinsfile, .github/workflow ...) is optional

Implementation hints

  • Start describing the list of interactions between public-service and private-service
  • Feel free to use any library that might help you get the job done faster or more conveniently
  • Consider the network to be not reliable
  • Add any third-party service you need in order to make the product work as expected
  • It is ok for the the private-service to lose data in case the process crashes or gets restarted

Assignment evaluation

Here's what we'll look into when evaluating your submission (items are sorted alphabetically and not by importance):

  • Code quality
  • Coding style
  • Documentation (eg: notes explaining the architecture, quality of code comments, setup instructions, etc.)
  • Git commit messages & content
  • Knowledge of languages / libraries
  • Product reliability
  • Software architecture
  • Tests

Assignement delivery

Work on your repository and send us the access to it once the work is completed; you can send the repo to us via mail (in a ZIP file) or make the project available (based on platform you use) to user:

If you want to use a different platform let us know how we can access.

The assignment do not have any time constraints (you can return it after a day or in two weeks), in any case we will consider the time you need to complete the assignment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment