- We have some customer records in a text file (customers.txt, attached) one customer per line, JSON-encoded. We want to invite any customer within 100km of our Dublin office (GPS coordinates 53.3381985, -6.2592576) to 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. Your program should be fully tested too.
- Install JDK 1.7+ (Required)
- Install Node 10+ (Required)
- Install Maven 3.5+ (Required)
- Install Docker 19+ (Not required)
- First option and recomended is to use docker. Within of the main project folder intercom-challenge run
docker-compose up --build -d
. This step will spend some minutes. After that, you can openlocalhost
on your browser and import the file to test 2nd challenge. - Second option is manual, run
mvn package && java -jar target/intercom-challenge-services-1.0.jar
within intercom-challenge-services folder. Runnpm install && ng serve -o
within intercom-challenge-front. After that, you can openlocalhost:4200
on your browser and import the file to test 2nd challenge. - Third option is also manual and using the API endpoint customers, look at
spec.yml file
that use the OpenAPI standard to understand how to consume the endpoint. For that, only runmvn package && java -jar target/intercom-challenge-services-1.0.jar
within intercom-challenge-services folder, and test using a client like Postman.
- Start and update all services in Docker-compose file:
docker-compose up --build -d
- Stop all services started:
docker-compose down
- Was created several unit tests, unit and integration tests.
- Within project main folder has the file customers.txt to be used in your tests.
- Make sure that ports used by projects:
80
,4200
and8080
are available in your test environment.