Back to problems

Simulation Problem Related to Basic Data Structures and Syntax

Algorithm · Tradedesk · Medium

Problem Design and implement a simulator for a basic shopping cart that can be accessed by multiple users at the same time. The cart must handle four kinds of commands: adding an item, removing an item, calculating the total price of all items currently in the cart, and displaying every item in the cart. Concurrency is a first-class concern — your implementation must remain correct when several users interact with the cart simultaneously. Operations The cart accepts the…

Checking your access…