This is a verified interview question from Amazon. Candidates reporting seeing this problem in recent Online Assessments (OAs) and onsite rounds. Mastering "Category Browser Fix - Amazon Development Online Assesment" covers key patterns like System Design.
"It was a Development level question, complete project and it's structure was given. You need to change some sections of code in files. ### Problem 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: - category_id — unique identifier - name — display name - parent_id — parent category ID (null means it's a top-level category) ### Product listings Input file: data/products.json One JSON object per line. Each line is one product listing. ### Browse requests Input file: data/requests.json One JSON object per line. Each line is one browse request. Each request includes: - query_id — unique identifier - category_id — the category being browsed - region — region to filter by - max_results — number of results to return; if missing, default to 5 ### Output 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: - query_id — copied from input - matched_count — number of eligible products after region filtering (before applying max_results) - products — up to max_results products   "
Join thousands of developers practicing for Amazon.