Advertisement
Guest User

Untitled

a guest
Feb 24th, 2018
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.42 KB | None | 0 0
  1. # HelloFresh Senior Backend Developer Test
  2.  
  3. Hello and thanks for taking the time to try this out.
  4.  
  5. The goal of this test is to assert (to some degree) your coding and architectural skills. You're given a simple problem so you can focus on showcasing development techniques. We encourage you to overengineer the solution a little to show off what you can do - assume you're building a production-ready application that other developers will need to work on and add to over time.
  6.  
  7. You're **allowed and encouraged** to use third party libraries, as long as you put them together yourself **without relying on a framework or microframework** to do it for you. An effective developer knows what to build and what to reuse, but also how his/her tools work. Be prepared to answer some questions about those libraries, like why you chose them and what other alternatives you're familiar with.
  8.  
  9. As this is a code review process, please avoid adding generated code to the project. This makes our jobs as reviewers more difficult, as we can't review code you didn't write. This means avoiding libraries like _Propel ORM_, which generates thousands of lines of code in stub files.
  10.  
  11. _Note: While we love open source here at HelloFresh, please do not create a public repo with your test in! This challenge is only shared with people interviewing, and for obvious reasons we'd like it to remain this way._
  12.  
  13. ## Prerequsites
  14.  
  15. We use [Docker](https://www.docker.com/products/docker) to administer this test. This ensures that we get an identical result to you when we test your application out, and it also matches our internal development workflows. If you don't have it already, you'll need Docker installed on your machine. **The application MUST run in the Docker containers** - if it doesn't we cannot accept your submission. You **MAY** edit the containers or add additional ones if you like, but this **MUST** be clearly documented.
  16.  
  17. We have provided some containers to help build your application in either PHP, Go or Python, with a variety of persistence layers available to use.
  18.  
  19. ### Technology
  20.  
  21. - Valid PHP 7.1, Go 1.8, or Python 3.6 code
  22. - Persist data to either Postgres, Redis, or MongoDB (in the provided containers).
  23. - Postgres connection details:
  24. - host: `postgres`
  25. - port: `5432`
  26. - dbname: `hellofresh`
  27. - username: `hellofresh`
  28. - password: `hellofresh`
  29. - Redis connection details:
  30. - host: `redis`
  31. - port: `6379`
  32. - MongoDB connection details:
  33. - host: `mongodb`
  34. - port: `27017`
  35. - Use the provided `docker-compose.yml` file in the root of this repository. You are free to add more containers to this if you like.
  36.  
  37. ## Instructions
  38.  
  39. 1. Clone this repository.
  40. - Create a new branch called `dev`.
  41. - Run `docker-compose up -d` to start the development environment.
  42. - If you want to use Go, uncomment the Go container in the `docker-compose.yml` file. Add the commands you need in there to execute the application.
  43. - If you want to use Python, uncomment the Python container in the `docker-compose.yml` file first. Add the commands you need in there to execute the application.
  44. - Visit `http://localhost` to see the contents of the web container and develop your application.
  45. - Create a pull request from your `dev` branch to the master branch. This PR should contain setup instructions for your application and a breakdown of the technologies & packages you chose to use, why you chose to use them, and the design decisions you made.
  46. - Reply to the thread you're having with our HR department telling them we can start reviewing your code.
  47.  
  48. ## Requirements
  49.  
  50. We'd like you to build a simple Recipes API. The API **MUST** conform to REST practices and **MUST** provide the following functionality:
  51.  
  52. - List, create, read, update, and delete Recipes
  53. - Search recipes
  54. - Rate recipes
  55.  
  56. ### Endpoints
  57.  
  58. Your application **MUST** conform to the following endpoint structure and return the HTTP status codes appropriate to each operation. Endpoints specified as protected below **SHOULD** require authentication to view. The method of authentication is up to you.
  59.  
  60. ##### Recipes
  61.  
  62. | Name | Method | URL | Protected |
  63. | --- | --- | --- | --- |
  64. | List | `GET` | `/recipes` | ✘ |
  65. | Create | `POST` | `/recipes` | ✓ |
  66. | Get | `GET` | `/recipes/{id}` | ✘ |
  67. | Update | `PUT/PATCH` | `/recipes/{id}` | ✓ |
  68. | Delete | `DELETE` | `/recipes/{id}` | ✓ |
  69. | Rate | `POST` | `/recipes/{id}/rating` | ✘ |
  70.  
  71. An endpoint for recipe search functionality **MUST** also be implemented. The HTTP method and endpoint for this **MUST** be clearly documented.
  72.  
  73. ### Schema
  74.  
  75. - **Recipe**
  76. - Unique ID
  77. - Name
  78. - Prep time
  79. - Difficulty (1-3)
  80. - Vegetarian (boolean)
  81.  
  82. Additionally, recipes can be rated many times from 1-5 and a rating is never overwritten.
  83.  
  84. If you need a more visual idea of how the data should be represented, [take a look at one of our recipe cards](https://ddw4dkk7s1lkt.cloudfront.net/card/hdp-chicken-with-farro-75b306ff.pdf?t=20160927003916).
  85.  
  86. ## Evaluation criteria
  87.  
  88. These are some aspects we pay particular attention to:
  89.  
  90. - You **MUST** use packages, but you **MUST NOT** use a web-app framework or microframework.
  91. - Your application **MUST** run within the containers. Please provide short setup instructions.
  92. - The API **MUST** return valid JSON and **MUST** follow the endpoints set out above.
  93. - You **MUST** write testable code and demonstrate unit testing it (for clarity, PHPUnit is not considered a framework as per the first point above. We encourage you to use PHPUnit or any other kind of **testing** framework).
  94. - You **SHOULD** pay attention to best security practices.
  95. - You **SHOULD** follow SOLID principles where appropriate.
  96. - You do **NOT** have to build a UI for this API.
  97.  
  98. The following earn you bonus points:
  99.  
  100. - Your answers during code review
  101. - An informative, detailed description in the PR
  102. - Setup with a one liner or a script
  103. - Content negotiation
  104. - Pagination
  105. - Using any kind of Database Access Abstraction
  106. - Other types of testing - e.g. integration tests
  107. - Following the industry standard style guide for the language you choose to use - `PSR-2`, `gofmt`, etc.
  108. - A git history (even if brief) with clear, concise commit messages.
  109.  
  110. ---
  111.  
  112. Good luck!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement