Optiver is one of the world's leading market makers. Their OA differs significantly from traditional tech companies — beyond standard data structures and algorithms, it incorporates trading logic, order book simulation, and probabilistic reasoning in financial scenarios. This guide breaks down the core question types and solving strategies based on the latest interview experiences.
Optiver OA Overview
| Aspect | Details |
|---|---|
| Platform | HackerRank |
| Duration | 90 minutes |
| Questions | 2-3 coding problems |
| Difficulty | Medium - Hard |
| Focus Areas | Simulation, Greedy, Math Reasoning, Low-latency Thinking |
Question Type 1: Trading Sequences
Problem Description
Given a sequence of trading prices prices[] and volumes volumes[], find the optimal trading window that satisfies specific conditions. Specifically, select a contiguous subarray [l, r] that maximizes weighted profit within that interval.
Solution Approach
This problem is essentially a weighted maximum subarray sum variant:
- Calculate profit at each time point:
profit[i] = (prices[i+1] - prices[i]) * volumes[i] - Apply a variant of Kadane's Algorithm for maximum contiguous subarray sum
- Handle edge cases: trading window must contain at least 2 time points
Python Solution
def max_trading_profit(prices, volumes):
n = len(prices)
if n < 2:
return 0
profits = [(prices[i+1] - prices[i]) * volumes[i] for i in range(n-1)]
max_profit = float('-inf')
current_sum = 0
for p in profits:
current_sum = max(p, current_sum + p)
max_profit = max(max_profit, current_sum)
return max(0, max_profit)
Time Complexity: O(n)
Space Complexity: O(n)
Question Type 2: Order Book Simulation
Problem Description
Implement a simplified order book system supporting:
ADD side price quantity: Add a limit order (side is BUY or SELL)CANCEL order_id: Cancel an orderMATCH: Execute matching when highest buy price ≥ lowest sell price
Solution Approach
This is a design + simulation problem. Core data structure choices:
- Buy orders: Max-heap (sorted by price descending)
- Sell orders: Min-heap (sorted by price ascending)
- Order index: HashMap for O(1) cancellation
Python Solution
import heapq
from collections import defaultdict
class OrderBook:
def __init__(self):
self.buy_orders = []
self.sell_orders = []
self.cancelled = set()
self.order_map = {}
self.order_id = 0
def add(self, side, price, quantity):
self.order_id += 1
order = (price, self.order_id, quantity)
self.order_map[self.order_id] = order
if side == 'BUY':
heapq.heappush(self.buy_orders, (-price, self.order_id, quantity))
else:
heapq.heappush(self.sell_orders, (price, self.order_id, quantity))
return self.order_id
def cancel(self, order_id):
if order_id in self.order_map:
self.cancelled.add(order_id)
return True
return False
def match(self):
trades = []
while self.buy_orders and self.sell_orders:
while self.buy_orders and self.buy_orders[0][1] in self.cancelled:
heapq.heappop(self.buy_orders)
while self.sell_orders and self.sell_orders[0][1] in self.cancelled:
heapq.heappop(self.sell_orders)
if not self.buy_orders or not self.sell_orders:
break
best_buy = -self.buy_orders[0][0]
best_sell = self.sell_orders[0][0]
if best_buy >= best_sell:
buy_order = heapq.heappop(self.buy_orders)
sell_order = heapq.heappop(self.sell_orders)
trade_qty = min(buy_order[2], sell_order[2])
trade_price = best_sell
trades.append((trade_price, trade_qty))
if buy_order[2] > trade_qty:
heapq.heappush(self.buy_orders,
(buy_order[0], buy_order[1], buy_order[2] - trade_qty))
if sell_order[2] > trade_qty:
heapq.heappush(self.sell_orders,
(sell_order[0], sell_order[1], sell_order[2] - trade_qty))
else:
break
return trades
Time Complexity: ADD O(log n), CANCEL O(1), MATCH O(k log n)
Space Complexity: O(n)
Question Type 3: Allocation
Problem Description
Given n traders and m trading opportunities, each trader has different capital limits and risk preferences. Allocate trading opportunities to traders to maximize total profit while satisfying each trader's constraints.
Solution Approach
This is a greedy + sorting problem:
- Sort trading opportunities by profit rate in descending order
- For each opportunity, find a trader who can handle the risk and has sufficient capital
- Apply greedy allocation strategy
def allocate_trades(traders, opportunities):
opportunities.sort(key=lambda x: -x[2])
assigned = [False] * len(traders)
total_profit = 0
for cap_req, risk, profit in opportunities:
best_trader = -1
min_excess = float('inf')
for i, (capital, tolerance) in enumerate(traders):
if not assigned[i] and capital >= cap_req and tolerance >= risk:
excess = capital - cap_req
if excess < min_excess:
min_excess = excess
best_trader = i
if best_trader != -1:
assigned[best_trader] = True
total_profit += profit
return total_profit
Preparation Strategy
Core Skills Required
- Low-latency thinking: Optiver values code efficiency — O(n²) is unacceptable for large inputs
- Financial intuition: Understand bid/ask spread, order matching fundamentals
- Edge case handling: Trading systems demand extreme precision
- Concurrency awareness: Some questions test understanding of race conditions
Recommended Practice Problems
| LeetCode # | Problem | Relevant Topic |
|---|---|---|
| 53 | Maximum Subarray | Trading Sequences |
| 1353 | Maximum Number of Events | Allocation |
| 295 | Find Median from Data Stream | Order Book |
| 480 | Sliding Window Median | Price Window Analysis |
FAQ
What platform does Optiver use for OA?
Optiver's OA is typically conducted on HackerRank, lasting about 90 minutes with 2-3 coding problems. Some roles (like Trader) include additional math and probability testing sections.
How difficult is the Optiver OA compared to LeetCode?
Optiver OA coding problems range from LeetCode Medium to Hard difficulty, but the style leans toward real trading scenario simulation rather than pure competitive programming. Candidates need basic financial market knowledge.
What's the difference between Optiver SWE and Trader OA?
SWE positions focus on data structures, algorithms, and system design. Trader positions emphasize mathematical reasoning, probability calculations, and mental math speed. Both involve trading-related scenarios but with different emphases.
What comes after the Optiver OA?
After passing the OA, candidates typically proceed to an HR phone screen, then technical interviews (1-2 rounds), and finally a Superday (full-day interview) including system design, behavioral interviews, and team matching.
How should I prepare for Optiver's trading simulation questions?
Start by understanding basic market maker concepts (bid-ask spread, order book, market making), then practice heap and priority queue problems on LeetCode. Consider participating in Optiver's Ready Trader Go competition for hands-on experience.
Preparing for Optiver OA?
oavoservice provides professional OA/VO assistance for quantitative firms including Optiver, Citadel, and Jane Street. Our team members come from top quantitative institutions with deep expertise in trading system design and algorithm interviews.
👉 Contact WeChat: Coding0201 | Get real questions and assistance
Contact
Email: [email protected]
Telegram: @OAVOProxy