Choose a Representation
Only after state and operations: array or map, list or rows. What operations are frequent, what lookup is needed, does order matter, do duplicates matter, how large can it get — with the complexity annotated and DSA one link away.
Only after the state and the operations are known can "array or map or rows?" be answered — because the answer is whichever fits the access pattern the operations describe, and before the operations exist there is no access pattern to fit.
The same cart held two ways: an array, where adding an existing product is a scan, and a map keyed by product id, where it is a key lookup. Simplicity, lookup, ordering, serialisation and memory each move, and for ten items none of the movement is visible.
Five questions — what operations are frequent, what lookup is needed, does order matter, do duplicates matter, how large can it get — produce a recommendation with the case where it flips. The answer is derived, not remembered.
addItem on an array is O(n) because it scans; on a map O(1) average because it hashes. Write that beside the operation where it is true, link the structure that explains it, and say the honest thing: for ten items the difference is invisible.
Three questions flip the representation on their own: does order mean something, must each thing appear once, and what bounds how large it gets. Each has a case where the cart's answer changes and the array stops fitting.
The array cart and the map cart both pass every test; so does a cart that filters instead of finds. A reference solution is not the right answer — it is one answer whose trade-offs are explained, and the ability to say why yours differs is the understanding.