It was a Development level question, complete project and it's structure was given. You need to change some sections of code in files.
When a customer opens a category page, like Electronics, in an E-commerce App, they expect to see everything under it: phones, cameras, smart home devices, etc.
Categories are organized in a parent-child hierarchy, so browsing a category must include products assigned to that category and every level beneath it, not just items tagged at the top level.
Results should also be region-specific and ranked by popularity. A customer in the US should only see US listings. Listings from other regions must never appear.
The current browse engine is broken. It misses products from subcategories, surfaces products from unrelated categories, leaks listings from other regions, and returns results in the wrong order.
Your task is to fix the engine so it returns only the correct, in-region products for the requested category in the correct ranked order.
Input file: data/categories.json
This file contains a flat list of category records. Each record includes:
Input file: data/products.json
One JSON object per line. Each line is one product listing.
Input file: data/requests.json
One JSON object per line. Each line is one browse request.
Each request includes:
Output file: data/results.json
A JSON array with one object per request in the same order as the input.
Each output object must include:


