In this challenge you will build a basic React application that lets a customer view the menu at a restaurant.
As part of the interview process we would like you to complete a coding challenge that demonstrates your knowledge of JavaScript and React which our entire codebase is built on.
When you complete the challenge you should upload your code to a private repo and share with: (smchalal, pdeona, gabceb, jonrose-dev or kylefinley). We also advise you reply to the initial email with the assignment and confirm you have shared with these users
- Run
npm install
oryarn
- Run
npm start
oryarn start
- Open your browser to localhost:3000
The goal of this challenge is to complete the requirements below while maintaining good code organization and using idiomatic React patterns. We don't expect perfect code, but we do want to see some consideration for a quality React application.
We don't want you to spend too much time on this -- we expect you to be able to complete the requirements in 2-4 hours. Overall we're looking for a jumping off point to have a conversation about your thinking and approach rather than a production-ready application.
- Reference the
EngineeringInterview-Designs.pdf
file for a general idea on the UI we expect. The design is up to you, but the Burger King UI on the last page is roughly the layout we're looking for. - The UI should look presentable, but we don't expect you to be a designer. Prefer a well-working application over design.
- Use any external packages you think would be helpful.
- Tests are not required.
-
At the top of the page display a navigation bar containing the sections from the menu. These should be displayed horizontally with their respective carousel image and name. The content for this menu should be fetched from the API (see below for API data).
-
Below the navigation bar show a grid of all the elements within the current selection. The cards should be in a 3-column layout, one item per column.
- If the user is on the main menu the elements should be the same as the top navigation bar.
- If the user has selected a section then it should be of all the items belonging to the selected section.
-
Each section in the top menu should be clickable, and when clicked the tiles should reflect the items that belong to the selected section. The selected section in the navigation bar should be styled in some way to indicate that it is the active filter.
-
The user should be able to navigate their browsing history and be able to go backwards and forwards through the sections they have viewed.
A separate Express server will be started when you run npm|yarn start
that acts as your API. During development you can hit this server from your React application by making requests to /api/..
(ex: fetch('/api/menu')
).
The data you'll fetch is probably more obtuse than you're used to -- we want to see how you'd handle difficult API response constraints. There is more data in the returned JSON than is necessary to complete this exercise.
There are three entity types you'll be dealing with:
GET /api/menu
The menu dictates what shows up in the top nav. It holds a list of references to Section
objects, which in this case are the individual options to be shown in the nav.
GET /api/sections
For the purposes of this exercise you can treat a section like a category ("Combo Meals", "Beverages", "Salads", etc.
). Each section holds a list of references to Item
objects.
GET /api/items
An item is the thing that you would order at the counter: "Double Whopper", "Coffee", "French Fries"
.
When showing images for the menu sections and the items you'll need to pull the image name from the API data and use it to render the image found at /images/:imageID
.