@Alexander I forgot to ask. is var products: [ProductID : Product] better or just var products: [Product] with the latter I'd have to search products or find a certain productID, the dictionary doesn't have that issue
@Alexander how else would like them up then? Name? Still My question is should I be using dictionary or array? I can always use array and loop through. But don't think that's a good choice...
@Alexander This is stupid to say, but when you see ["123" : productX, 345 : productY] vs [productX, productY], you might side with the shorter version. Because generally in the interviews, your mindset is aiming to get things done in lesser number of lines. But that seems totally wrong here. I should change my mindset