- You can run this app using
bin/run
- Use
rake
command to run specs and rubocop tests
First of all, thank you for taking the time to complete this test task! The purpose of the task is to get an idea of your development style: the way you structure code, automated tests you add etc.
We publish our jobs to different marketing sources. To keep track of where the particular job is published, we create
Campaign
entity in database. Campaigns
are periodically synchronized with 3rd party Ad Service.
Campaign
properties:
id
job_id
status
: one of [active, paused, deleted]external_reference
: corresponds to Ad’s ‘reference’ad_description
: text description of an Ad
Due to various types of failures (Ad Service inavailability, errors in campaign details etc.)
local Campaigns
can fall out of sync with Ad Service.
So we need a way to detect discrepancies between local and remote state.
- Develop a Service(as in Service Object pattern), which would get campaigns from external JSON API(example link) and detect discrepancies between local and remote state.
- The purpose of the task is to work on business logic, so please don't create a Rails app. Rather stucture your project the following way:
|-- .ruby-version
|-- .ruby-gemset
|-- Gemfile
|-- lib
|-- source files go here
|-- spec
|-- specs go here
You're free to add gems you need(including those which are part of Rails).
- You don't have to put all your code into one class. Please use your best judgment to split the code up into separate components.
- Note Don't fork this repository. Create you own public repository and send us a link to it. You may describe some of the assumptions you had in the README file of your repository.
You're free to choose the output format which makes sense to you, we suggest the following:
[
{
"remote_reference": "1",
"discrepancies": [
"status": {
"remote": "disabled",
"local": "active"
},
"description": {
"remote": "Rails Engineer",
"local": "Ruby on Rails Developer"
}
]
}
]
Have fun!