Back to Questions

Design a Data Structure for Stock Prices (Heaps)

109.2K viewsAsked at Netflix
Medium

Question Explain

Design a data structure that allows you to record the latest stock price and retrieve the maximum, minimum, and current price in $O(1)$ time. Use two heaps and a hash map.

Start Trying This Question Simulation

Practice answering orally or with text to get instant AI feedback.

Practice with This Question