Ready, steady... GO!
You will receive an email with the instructions of the access to this challenge, so you can do it whenever you want!
Ever heard of self-service beer tap dispensers? These are a new concept of drink dispenser that is already being used in many international music festivals to avoid long queues and crowds.
The user brings his or her glass and self-serves the beer. The system registers the amount dispensed and calculates the price of the service, transferring this information to the bar counter. Great innovation, isn't it?
Well, for this challenge we propose you to develop the API that controls this system and calculates the price of the drinks for each attendee, based on the amount dispensed.
The aim of this API is to allow organizers to set up these bar counters allowing the attendees self-serving.
So, once an attendee wants to drink a beer (0,0º, we are not promoting any kind of alcohol consumption! ) they just need to open the tap! The API will start counting how much flow comes out and, depending on the price, calculate the total amount of money.
You could find the whole description of the API and send some requests to a mock server at this URL.
The workflow of this API is as follows:
flow_volume. This config will help to know how much litres of beer comes out per second and be able to calculate the total spend.
open. With this change the API will start counting how much time the tap is open, and be able to calculate the total price later
close. At this moment, the API will stop counting and mark it closed.
At the end of the event the promoters will want to know how much money they make with this new approach. So, we have to provide some information about how many times a dispenser was used, for how long, and how much money made with each service.
ABOUT THE CREATOR
Mauro Gómez is the CTO and Co-Founder of Rviewer. Software Engineer with more than 7 years of experience both as a developer and as a researcher in the field.
He has done research in prominent places such as the Barcelona Supercomputing Center, and worked in leading companies such as Adsmurai, as Team Lead and Big Data Developer, or Sabentis, evolving its SaaS platform.
Ready to challenge yourself and build something you're proud of?
Gain the confidence you need with our new FREE HANDBOOK on mastering coding interviews.