Register
Submit a solution
The challenge is finished.

Challenge Overview

In this contest, we want to create an command line tool to extract competitive products for HP products in the DB:
The process of the new functionality should be as below:
1. Get all the product types for all HP products from the database.
2. Then for each product type, we query BestBuy Product Info API by Product Category.  The Best Buy Product Categories can be derived from the Product Type field in our application.
3. It returns a list of Products in sorted list order by bestSellingRank asc. We'll get one of those lists for each Product Type/Category.  Here is sample query which returns Laptops with their selling rank info in ascending order: 

https://api.bestbuy.com/v1/products((categoryPath.id=abcat0502000))?format=json&show=sku,upc,name,categoryPath.name,salePrice,bestSellingRank&apiKey=<<api_key>>&sort=bestSellingRank.asc

4. Our app will then have to iterate through each HP product in our database
5. For each HP product in our database, it will scan through the (ordered) list of products for matching the products types with the appropriate list, and it will find the 5 Best Selling Products in the designated price range (within 20% higher and 20% lower range) for a product type. The price range searched will be based on the HP product price.
6. The matched best selling products (we call them competitive products) should be saved to the Product etc. tables (as existing API extractor code), the siteId for the competitive products should be configurable.  We'll need to add a manufacturer field to the Products table.  The current API Product Extractor process, which only queries for HP Products, needs to be updated to write to this field.  We'll need to populate this for the competitive products as well.
7. The associations between the competitive products and the HP products should be saved into the association table (which is a m-to-m table containing the hp productId and competitive product id). 

This new command line tool should have its own codebase, and as it shares lots of functionalities as the existing HP API Extractor codebase, so we want you to refactor the HP API Extractor codebase to reuse the common code as much as possible:
* Please move the common code into a separate codebase (and referenced by this tool and HP API Extractor as lib). Please also add unit tests for this common code. 
* Refactor the HP API Extractor codebase to use the common code as well. Note that a new bestSellingRank should be added to the Product table (New Column Name: bestBuyBestSellingRank), and please update the HP API Extractor to grab this value from best-buy API to store to the db.  

Final Submission Guidelines

- Upload all your source code in a zip file.
- Provide documentation for your application. It should contain complete build, deployment, and execution instructions.
- Screen sharing video is not required for this application.
- You should use the existing code found in the GitHub repositories as the starting point for this application.  The details for the GitHub repositories can be found in the Code Document forums attached to this challenge.
- This application uses the Vertica database as a persistence layer.  We have a docker script which configures this database for you.  The details can be found in the Code Document forums attached to this challenge.
 

 

Review style

Final Review

Community Review Board

Approval

User Sign-Off

ID: 30055297