Guest User

Untitled

a guest
Jul 20th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.48 KB | None | 0 0
  1. ## Problem
  2.  
  3. We are in need of a new search component to help our users discover our amazing deals. You are tasked to implement this feature.
  4.  
  5. This feature requires a single backend endpoint as well as the component that consumes it.
  6.  
  7. Please write your code in a git repository.
  8.  
  9. Ensure proper commit message through out the exercise so that we can understand your thought process.
  10.  
  11. ## Backend
  12.  
  13. 1. Write a search endpoint which returns a deal list that is paginatable
  14.  
  15. - You are allowed to use any backend language. Bonus point for writing it in Ruby/Elixir/Node
  16. - You do not need to implement the data store. Use mock data where possible. (Big enough to handle pagination)
  17. - Bonus point for writing tests
  18.  
  19. Here is the specification for the endpoint:
  20.  
  21. Request
  22.  
  23. ```
  24. GET /search
  25. {
  26. "query": String,
  27. "limit": Number,
  28. "page": Number
  29. }
  30. ```
  31.  
  32. Response
  33.  
  34. ```
  35. {
  36. "entries": [
  37. { "id": Number, "name": String, "discounted_price": String, "price": String, "outlet": {"id": Number, "name": String} }
  38. ],
  39. "page": {
  40. "total_entries": Number,
  41. "total_pages": Number
  42. }
  43. }
  44. ```
  45.  
  46. ## Frontend
  47.  
  48. 2. Build a search component that requests the search endpoint and display results, extend it to autocomplete on change, handle key navigation through the results and extend it to be infinitely scrollable.
  49.  
  50. - You are not allowed to use plug and play solution, but you may use other dependency to help build this widget.
  51. - You may use any modern frontend framework. Bonus point for using React
  52. - Bonus point for writing tests
Add Comment
Please, Sign In to add comment