Imagine we have a Product Listing website, powered up by this API (refer to the Routes section). Our website provides a platform for sellers to list their product and track the existing competition to optimize their price.
In order to empower our sellers, we are planning to build a new API endpoint which gives an average product price across all brand names, given a category. Say, for a smartphone category, we should see brands like Apple, Samsung etc. with their average prices.
Write a function in a language of your choice to support this API endpoint (you don't have to build the entire API, just the function). To test it, write unit tests using the provided JSON file (tests.json) that contains tuples of inputs and expected output.
- Clone the repo:
git clone [email protected]:kluein/coding-round-challenge.git
- Create a new branch:
git checkout -b your-name
- Copy your the files you might have prepared for your environment (eg. requirements.txt, vitual env, and so on for Python).
- Write your code using your language of preference.
- Write unit tests using
tests.json
. - Commit and push your changes at the end of the interview:
git push --set-upstream origin your-name