Intercom coding challenge
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
app
bin
config
db
lib
public
spec
vendor
.gitignore
.rubocop.yml
Gemfile
Gemfile.lock
README.md
Rakefile
config.ru
package.json

README.md

Intercom Coding Test

Spec

We have some customer records in a text file (customers.json) -- one customer per line, JSON-encoded. We want to invite any customer within 100km of our Dublin office for some food and drinks on us. Write a program that will read the full list of customers and output the names and user ids of matching customers (within 100km), sorted by User ID (ascending).

  • You can use the first formula from this Wikipedia article to calculate distance. Don't forget, you'll need to convert degrees to radians.
  • The GPS coordinates for our Dublin office are 53.339428, -6.257664.
  • You can find the Customer list here.

Please don't forget, your code should be production ready, clean and tested!

Setup

$ git clone https://github.com/jalerson/intercom.git
$ cd intercom
$ bundle install
$ rake db:create
$ rake db:migrate
$ rails s