Company: Amazon university talent Sde-1_10may
Difficulty: medium
Context 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. Issue 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. How categories are organized Input file: data/categories.json This file contains a flat list of category records. Each record includes: