This question evaluates the ability to design class interfaces, choose and justify data structures for ordered storage, and reason about sorting behavior and time complexity when recording timestamped trades.
Design a class that records daily stock trading activity and returns all recorded trades in sorted order.
Requirements:
getAllTrades()
that returns every recorded trade sorted by:
You should describe the class interface, the data structures you would use, and the time complexity of the main operations.