Code challenge:
This code challenge is meant to give an understanding of how you would approach a real-world problem. Please approach this challenge the way you would approach any programming task at work: your code should be production quality, it should be self-explanatory, and it should be done quickly. There is no time limit but it should not take more than a few hours.
Please create a new git repository for this challenge and regularly commit your code while working. Do not commit private information to the repository. (use .gitignore) Upload the repository to GitHub when done and send the link to it.
The challenge:
Create a Rails app. The app should accept the JSON payload in ‘message.json’ as an anonymous POST submission, then serialize it and save it in a sqlite-compatible database.
You can make the following assumptions about this part of the challenge:
-
There will be a regular flow of POST submissions from a remote server
-
The structure of ‘message.json’ will not change, but the values may change
-
Only relevant and useful data about the message should be kept
Separately, the same Rails app should provide a way for clients (like iOS and Android apps) to read messages from the database.
You can make the following assumptions about this part of the challenge:
-
There is no authentication layer and there are no users; all clients request data anonymously and all clients receive the same data
-
The client already knows the Ids of the messages it needs to retrieve from your app
-
The only thing the client will do with the data is render a simple view of the message