Fidelity Investments OA 2023 | Design Data Structures, Heap Optimization, Real Time Updates and System Design Fundamentals

Question · Posted Jun 2026

Problem Statement Design a data structure to track stock prices over time. Implement the following operations: update(timestamp, price) Updates the stock price at a given timestamp. If the timestamp already exists, the previous price should be corrected. Otherwise, add a new stock price entry. current() Return the latest stock price. maximum() Return the maximum stock price recorded so far. minimum() Return the minimum stock price recorded so far. Example Input update(1, 10) update(2, 5) current() maximum() update(1, 3) maximum() minimum() ...

The full answer & interview discussion are available to premium members.

Log in Create a free account