This set follows the debugging section candidates reported in Amazon's online assessment from about 2019 to 2023: seven short functions, each meant to do what its docstring says, each with exactly one bug. That section u…
This set follows the debugging section candidates reported in Amazon's online assessment from about 2019 to 2023: seven short functions, each meant to do what its docstring says, each with exactly one bug. That section used C, C++ or Java; this set is in Python. Recent Amazon assessments use a different format, so treat this as practice for the skill: finding a fault fast against a written spec.
Each item is graded on its own, so every one you fix counts. The bug is in the function's code, never in its docstring; the fix is usually a line or two.
| Item | File | Function |
|---|---|---|
| Q1 | catalog/skus.py | normalize_sku |
| Q2 | catalog/ratings.py | rating_summary |
| Q3 | catalog/pages.py | page |
| Q4 | catalog/prices.py | in_price_range |
| Q5 | catalog/sellers.py | top_sellers |
| Q6 | catalog/inventory.py | merge_inventory |
| Q7 | catalog/duplicates.py | has_duplicates |
pytest tests/visible. Seven tests fail on the current code, one per item.Visible test command
pytest tests/visibleThe repository’s own tests. Run all tests includes them, and so does every submission.
Repository
legacy-debugging-set-catalog-helpers
Changes under src/ are evaluated.