They asked me to implement an inventory stock balance function. I responded by modeling the domain with small, single-responsibility classes (e.g., Product, Inventory, and StockTransaction), exposing methods to adjust stock (add, remove, transfer) and to compute current balance (get_stock_balance). I validated inputs, documented behavior for negative/oversell attempts, considered concurrency (locking or atomic updates) and wrote unit tests that cover normal flows, boundary cases, and concurrent updates. I emphasized readability, testability, and how the design allows adding features like per-location inventory or reservations without changing the core logic.