Skip to content

Instantly share code, notes, and snippets.

@imranismail
Last active July 20, 2018 07:30
Show Gist options
  • Save imranismail/a483657d862c5bd96d096c6f8b5fccd5 to your computer and use it in GitHub Desktop.
Save imranismail/a483657d862c5bd96d096c6f8b5fccd5 to your computer and use it in GitHub Desktop.
Fullstack Interview Question

Problem

We are in need of a new search component to help our users discover our amazing deals. You are tasked to implement this feature.

This feature requires a single backend endpoint as well as the component that consumes it.

Please write your code in a git repository.

Ensure proper commit message through out the exercise so that we can understand your thought process.

Backend

  1. Write a search endpoint which returns a deal list that is paginatable
  • You are allowed to use any backend language. Bonus point for writing it in Ruby/Elixir/Node
  • You do not need to implement the data store. Use mock data where possible. (Big enough to handle pagination)
  • Bonus point for writing tests

Here is the specification for the endpoint:

Request

GET /search
{
  "query": String,
  "limit": Number,
  "page": Number
}

Response

{
  "entries": [
    { "id": Number, "name": String, "discounted_price": String, "price": String, "outlet": {"id": Number, "name": String} }
  ],
  "page": {
    "total_entries": Number,
    "total_pages": Number
  }
}

Frontend

  1. 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.
  • You are not allowed to use plug and play solution, but you may use other dependency to help build this widget.
  • You may use any modern frontend framework. Bonus point for using React
  • Bonus point for writing tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment