Optiver Interview Questions
Showing 5 questions
Calculate the number of days between two given dates. The dates are provided in a specific format, and you need to compute the difference in days.
#1. Number of Days Between Two Dates
Design a data structure that acts as a Least Recently Used (LRU) cache. Implement methods to get and put key-value pairs, evicting the least recently used entry when the cache is full.
#2. LRU Cache
Implement a circular queue data structure with a fixed size. You'll need to handle enqueueing, dequeueing, and checking if the queue is full or empty efficiently.
#3. Design Circular Queue
You're given stock prices for multiple days. Determine the maximum profit you can achieve by making at most 'k' transactions (buy and sell) within the given timeframe.
#4. Best Time to Buy and Sell Stock IV
You're given daily stock prices. Find the maximum profit you can make by buying and selling the stock once. You must buy before you sell.
#5. Best Time to Buy and Sell Stock