The Optiver OA is genuinely hard. I've also assisted with their VO, and the overall intensity is high. The OA gives 90 minutes for a single problem, but it isn't a standard LeetCode algorithm question — it leans into an engineering scenario and comprehensive implementation, so reading, modeling, and edge handling all take time. Once the requirements are clear, though, the approach and code come together quickly, and the submission went through smoothly. If you want OA assist or OA live support, you can align your pacing with this debrief.
OA Overview
| Aspect | Details |
|---|---|
| Format | Online coding + a Zap-N game round |
| Time | 90 minutes (coding part) |
| Volume | 1 Medium system-simulation problem |
| Type | Engineering-scenario implementation, not a traditional algorithm |
| Focus | Modeling, state maintenance, edge handling |
The coding part is one Medium system-simulation problem, not a traditional algorithm question.
Optiver OA Problem: SmartDepot Vertical Warehouse
Problem
Implement a SmartDepot class that simulates storing and retrieving goods in an automated vertical warehouse:
- Each warehouse has several shelf levels, with capacity growing geometrically from bottom to top (1, 2, 4, 8...).
- The program records store/retrieve operations by timestamp, handling constraints on weight, shelf life, shelf capacity, and operation ordering.
- If an operation violates any constraint, return failure; otherwise update the warehouse state and return success.
Approach
At its core this simulates the store/retrieve process:
- Use a map keyed by warehouse and level to hold each level's goods, and a set to track currently present item IDs.
- On store, place items starting from the bottom shelf as specified.
- On retrieve, each time pick the lightest item on the current level (on a weight tie, the largest ID), then let the heaviest eligible item from the level below move up to fill the gap.
Just simulate in timestamp order; the crux is maintaining state correctly after each operation and covering edge cases. Since weight and time carry decimals, uniformly multiply by 1000 to convert to integers before comparing, avoiding floating-point error, and validate the warehouse, item ID, capacity, and shelf life before each operation.
Python Implementation
class SmartDepot:
"""Automated vertical-warehouse simulation: shelf capacity grows 1,2,4,8...
Weight and time are scaled by 1000 to integers to avoid float error."""
SCALE = 1000
def __init__(self, num_shelves):
# per-level capacity: 1, 2, 4, 8 ...
self.capacity = [1 << i for i in range(num_shelves)]
# shelf[i] = list of (weight_int, id, expire_int)
self.shelf = [[] for _ in range(num_shelves)]
self.ids = set() # item IDs currently in stock
def _to_int(self, x):
return round(x * self.SCALE)
def store(self, item_id, weight, expire, ts):
"""Store an item; return False if any constraint is violated. ts = timestamp."""
if item_id in self.ids:
return False # duplicate ID
if weight <= 0 or expire < ts:
return False # invalid weight / already expired
w, e = self._to_int(weight), self._to_int(expire)
for i in range(len(self.shelf)): # find the lowest shelf with room
if len(self.shelf[i]) < self.capacity[i]:
self.shelf[i].append((w, item_id, e))
self.ids.add(item_id)
return True
return False # all shelves full
def retrieve(self, shelf_idx, ts):
"""Retrieve from a level: pick lightest, largest ID on tie; heaviest below moves up."""
if shelf_idx < 0 or shelf_idx >= len(self.shelf):
return None
# drop expired items (shelf life earlier than current timestamp)
t = self._to_int(ts)
level = [it for it in self.shelf[shelf_idx] if it[2] >= t]
if not level:
self.shelf[shelf_idx] = []
return None
# lightest first; on a weight tie, largest ID first
chosen = min(level, key=lambda it: (it[0], -it[1]))
level.remove(chosen)
self.shelf[shelf_idx] = level
self.ids.discard(chosen[1])
# heaviest eligible item from the level below moves up to fill the gap
if shelf_idx + 1 < len(self.shelf) and self.shelf[shelf_idx + 1]:
lower = self.shelf[shelf_idx + 1]
heaviest = max(lower, key=lambda it: (it[0], it[1]))
lower.remove(heaviest)
self.shelf[shelf_idx].append(heaviest)
return chosen[1] # return the retrieved item ID
Complexity: each store is O(S) where S is the number of shelf levels; each retrieve is O(L) where L is the item count on the level (for picking lightest / heaviest below). Simulating in timestamp order is O(operations x per-operation cost).
Edge-Case Checklist
- Storing a duplicate item ID → failure.
- Non-positive weight, or shelf life earlier than the current timestamp → failure.
- Target shelf full, or all shelves full → failure.
- Retrieval level empty or all expired → return empty.
- Float weight / time uniformly scaled by
SCALEto integers before comparison — no precision error.
Zap-N: The Reaction-Game Round
Beyond coding, the Optiver OA has a Zap-N round — game-like, with 9 mini-games (memorizing numbers, shape matching and switching, and so on) that test reaction speed, memory, and task switching.
There's no "grinding" for this round; the point is to know the format in advance and stay focused:
- Learn the game types ahead of time to reduce on-the-spot adaptation cost.
- Keep a steady hand speed and rhythm; don't let a slip on one mini-game rattle your overall state.
- The task-switching games test resistance to interference; warm up with similar reaction mini-games when practicing.
Prep Strategy
- Model before you code: draw out the warehouse-shelf-item data structures clearly, pin down the store/retrieve rules and the fill-up logic, then start writing — avoid rewriting as you go.
- Convert all floats to integers: for any decimal comparison (weight, time, shelf life), scale by a fixed factor to integers — the universal trap-avoidance trick for these engineering problems.
- Edges over optimization: for a Medium system problem, most of the score is in correctness and edge cases; cover every constraint first, then talk performance.
- Warm up for Zap-N: the reaction round hinges on your in-the-moment state; just get a feel with similar mini-games before the test.
FAQ
Q1: How hard is the Optiver SWE OA?
Just one problem in 90 minutes, but it's not a standard algorithm question — it's a Medium system-simulation problem. The difficulty isn't in algorithmic tricks but in reading, modeling, and cleanly handling a stack of constraints (weight, shelf life, capacity, ordering); it demands a high level of meticulousness.
Q2: What's the format of the Optiver OA, and how many rounds?
Mainly coding (one system-simulation problem, 90 minutes) plus the Zap-N game round. Zap-N has 9 reaction/memory/task-switching mini-games testing overall cognitive ability, not programming.
Q3: What's the easiest trap in the SmartDepot problem?
Two: first, float precision — weight and time carry decimals, and comparing them directly is error-prone, so scale by a factor to integers; second, the "heaviest item from the level below moves up to fill the gap" logic after retrieval, which is easy to miss or reverse — sort it out together with the "lightest first, largest ID on a tie" selection rule.
Q4: Can you prepare for the Zap-N round?
You can't grind it, but you can learn the format and adjust your state ahead of time. Know roughly what the 9 mini-games test (number memory, shape matching, task switching), warm up with similar reaction games beforehand, and keep focus and a steady hand speed.
Q5: How do I prep for an engineering-heavy OA like Optiver's?
Practice system-simulation problems: model the entity relationships, operation rules, and constraints clearly before coding, and build the habits of "convert floats to integers" and "cover edges before optimizing." Optiver values engineering sense and implementation rigor over flashy algorithms.
Preparing for the Optiver SWE OA or another quant/trading firm's OA? We know the Optiver format — one 90-minute system-simulation problem plus Zap-N — and can help you nail entity modeling, constraint coverage, and float-precision handling in one pass, with full OA assist and OA live support.
Add WeChat Coding0201 now to get a one-on-one custom prep plan.
Contact
- WeChat: Coding0201
- Email: [email protected]
- Telegram: @OAVOProxy