Object-Oriented Programming · Bloomberg · Medium
Problem You need to build a system that tracks stock trades and can return a ranking of stocks by their total traded quantity. The system should be efficient for high trade volumes and for scenarios where the ranking is requested repeatedly in quick succession. Implement the StockTracker class with the following methods: StockTracker() Creates a new, empty trade tracking system. void recordTrade(String stockName, int quantity) Logs a trade of quantity shares for the stock…
Checking your access…