Name: work-at-olist
Owner: Olist
Description: Apply for a job at Olist's Development Team
Created: 2016-04-06 04:07:28.0
Updated: 2018-01-18 00:46:32.0
Pushed: 2018-01-16 13:11:27.0
Homepage: null
Size: 18
Language: null
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Olist is a company that offers an integration platform for sellers and marketplaces allowing them to sell their products across multiple channels.
The Olist development team consists of developers who loves what they do. Our agile development processes and our search for the best development practices provide a great environment for professionals who like to create quality software in good company.
We are always looking for good programmers who love to improve their work. We give preference to small teams with qualified professionals over large teams with average professionals.
This repository contains a problem used to evaluate the candidate skills. It's important to notice that satisfactorily solving the problem is just a part of what will be evaluated. We also consider other programming disciplines like documentation, testing, commit timeline, design and coding best practices.
Hints:
You should implement a Python application that receives call detail records and calculates monthly bills for a given telephone number.
This Python application must provide a HTTP REST API to attend the requirements.
There are many telecommunications platform technologies that can potentially be clients of this system. Each one has its own communication flow. It's not safe to believe that when an already sent record can be resent or retrieved later. This context requires system flexibility in receiving information to avoid record loss.
There are two call detailed record types: Call Start Record and Call End Record. To get all information of a telephone call you should use the records pair.
Call Start Record information:
The Call End Record has the same information excepting origin and destination fields.
The phone number format is AAXXXXXXXXX, where AA is the area code and XXXXXXXXX is the phone number. The phone number is composed of 8 or 9 digits.
d": // Record unique identificator;
ype": // Indicate if it's a call "start" or "end" record;
imestamp": // The timestamp of when the event occured;
all_id": // Unique for each call record pair;
ource": // The subscriber phone number that originated the call;
estination": // The phone number receiving the call.
id": // Record unique identificator;
type": // Indicate if it's a call "start" or "end" record;
timestamp": // The timestamp of when the event occured;
call_id": // Unique for each call record pair.
To get a telephone bill we need two information: the subscriber telephone number (required); the reference period (month/year) (optional). If the reference period is not informed the system will consider the last closed period. In other words it will get the previous month. It's only possible to get a telephone bill after the reference period has ended.
The telephone bill itself is composed by subscriber and period attributes and a list of all call records of the period. A call record belongs to the period in which the call has ended (eg. A call that started on January 31st and finished in February 1st belongs to February period).
Each telephone bill call record has the fields:
The call price depends on fixed charges, call duration and the time of the day that the call was made. There are two tariff times:
Standard time call - between 6h00 and 22h00 (excluding):
Standing charge: R$ 0,36 (fixed charges that are used to pay for the cost of the connection);
Call charge/minute: R$ 0,09 (there is no fractioned charge. The charge applies to each completed 60 seconds cycle).
Reduced tariff time call - between 22h00 and 6h00 (excluding):
Standing charge: R$ 0,36
Call charge/minute: R$ 0,00 (hooray!)
It's important to notice that the price rules can change from time to time, but an already calculated call price can not change.
For a call started at 21:57:13 and finished at 22:10:56 we have:
Standing charge: R$ 0,36
Call charge:
Total: R$ 0,18 + R$ 0,36 = R$ 0,54
Have fun!