Hello there potential teammate! With this short quiz we hope to get a sense of how you approach problems and devise solutions. To that end, we're hoping you'll find the following quiz interesting while not demanding a large time investment.
- Read through the mock ticket below.
- Download or clone the official repository.
- Complete the mock ticket.
- Zip up your changes.
- Send an email with your zip attached to hr@americanfinancing.net letting them know you've completed the quiz.
(Written by our Product Owner for maximum authenticity 😉)
For the sake of argument and certainly with a need to stretch your imagination, assume that we work for Open Table rather than the largest privately held, independent, and best mortgage origination company in metro Denver.
Here at Denver's Open Tables, we've decided to display a very basic website built in the following stack:
- Back-end: Ruby on Rails
- Front-end: HAML (templating)
- Database: SQLite
- Javascript: Webpacker/ES6/StimulusJS
As far as users are concerned, this website has the following features:
- When the page loads, the database is queried and returns the first 24 restaurants.
- The restaurant list is paginated.
- On the first page, the "Prev" link is disabled, naturally.
- Clicking "Next" advances the user one page forward, pulling the next 24 restaurants from the database.
- Unfortunately, this website has a bug. The "Next" button isn't disabled when you reach the end of the restaurant list, and it should be.
- This website is sorely lacking a feature as well. It assumes that no new restaurants will ever open, or that existing restaurants may one day close their doors for good. The original developer was kind enough to write an OpenTablePuller class to retrieves the restaurant data from the Open Table API, but was shortsighted and wrote no rake task that could be used to refresh the local data. We'd like to be able to run this rake task as
rails restaurant:pull
to refresh the SQLite database that's powering the front-end paginated list of restaurants.
- When the end of the restaurant list is reached, the "Next" link is disabled.
- To refresh the locally stored data, you have created a rake task that leverages the OpenTablePuller class, and this can be executing with the following:
rails restaurant:pull
. - Implementing the two items above does not break any existing functionality.
- Browser Support: Current versions of Chrome and Firefox (for simplicity's sake)
- Restaurant database entries are not required to maintain the same primary key between rake executions but no duplication should result