The task is designed to need very little setup. Provided you have a version of PHP on your machine and git installed, you should be able to complete the task. We would recommend getting hold of a decent IDE, for this task we'd recommend Sublime Text as it's free and easy to get started with.
If you have any issues, please let us know as soon as possible.
To begin, clone this repository and start.
Dependent on your knowledge of PHP syntax and general experience, this task should take a couple of hours to complete. To submit the task, zip up the cloned repository and send it to us by email.
In the task-approach.md
file, describe how you would retrieve the following pieces of information from the stations.json
file.
- Get the total number of stations
- Get the total number of station groups
- Get the total people currently listening across all stations
- Get the station with the longest average listening duration
- Get the station with the highest peak listeners
- Get the amount of stations with 500 current listeners or more
- Get the amount of stations with 200 current listeners or more
- Get the amount of stations with 300 current listeners or less
- Get the country with the highest current listeners
- Get the country with the highest peak listeners
- Get the Amount of stations in Great Britain with 500 current listeners or more
Now using php in the index.php file load the data from stations.json
and calculate the answers to each
of the above.
By running php index.php
in the command line there should be an output that looks like this :
Total Number of Stations : xxx
Total Number of Station Groups : xxx
Total current listeners across all stations : xxx
The station with the longest listener duration is : xxx
The station wiht the highest peak listeners is : xxx
There are xxx stations with 500 listeners or more
There are xxx stations with 200 listeners or more
There are xxx stations with 300 listeners or less
The country with the most current listeners is xx
The country with the highest peak listeners is xx
Stations in Great Britain with 500 current listners or more : xxx, xxx, xxx
- Get the station with the highest peak listeners in Great Britain
- List the station group(s) with the most stations
If you are having trouble installing GIT here are some useful resources :
- Installing Git for Mac : https://www.atlassian.com/git/tutorials/install-git#mac-os-x
- Installing Git for Windows : https://www.atlassian.com/git/tutorials/install-git#windows
- Installing Git for Linux : https://www.atlassian.com/git/tutorials/install-git#linux