Optiver Coding & Algorithms Interview Questions
Master your tech interview with our curated database of real questions from top companies.
Devise sequence-rule detection strategy
You are given an integer sequence with 2 ≤ n ≤ 50 terms, possibly following rules such as arithmetic/geometric progressions, alternating patterns, pol...
Optimize switching puzzle solution
Consider a switching puzzle on an m×n grid of lights where toggling a cell flips its state and that of its orthogonal neighbors (Lights Out variant). ...
Match alphanumeric patterns in a stream
Given a reference 7–8 character alphanumeric code and four candidate codes, select the exact match as quickly as possible. Design a system that: - Eff...
Minimize moves to transform floor layouts
You are given an initial arrangement of apartments across Floors 1–4 and a target arrangement. In one move you may reposition a single apartment to a ...
Design a balloon stability tracker
Implement a class BalloonFestival to manage hot-air balloons and wind fields over time, and to report rewarded balloons at inspection times. Methods a...
Design a satellite propagation simulator
Implement a SatelliteNetwork class to simulate message propagation over an undirected satellite graph. Provide these methods: ( 1) satellite_connected...
Design a queue and analyze tradeoffs
Design a FIFO queue data structure that supports enqueue, dequeue, peek, and isEmpty. Compare implementations using a singly linked list, a dynamic ar...
Solve a Skyscraper puzzle efficiently
Design and implement a solver for the Skyscraper logic puzzle on an N×N grid (3 ≤ N ≤ 7). Each row and column must contain the numbers 1..N without re...
Compare two programs for equivalence
You are given two short programs (or functions) that process an integer array A (|A| ≤ 10^ 5). Determine whether they are functionally equivalent for ...
Implement price-based order matcher
Design and implement a price-based order matcher for unit-sized orders. You are given an array orders where each element is [type, price]: type = 1 de...
Decide and implement DP/heap and approximation
You have 90 minutes to complete three related coding tasks: a) Dynamic programming: Given an integer array nums (n ≤ 2e 5) and a threshold T, design a...
Design a Balloon Festival Simulator
Implement a class BalloonFestival with the following API and rules. Goal Track hot air balloons (yours and competitors), evolving wind fields, and bal...
Identify OS component causing process starvation
A system with 2 CPU cores runs 5 identical processes continuously. Four processes get equal CPU time, but the fifth appears to get none. Which part of...
Simulate satellite message propagation with timing
Design and implement the SatelliteNetwork to process a stream of N instructions: - SatelliteConnected(SatelliteId): add a satellite; invoke ErrDuplica...
Compare common data structures and uses
Compare common data structures and select appropriate ones for specific tasks. For arrays, linked lists, stacks, queues, hash tables, binary search tr...
Solve three mini-game algorithm tasks
Solve three mini-game algorithm tasks: (a) Move-House Puzzle: Given initial and target arrangements of N labeled blocks ("houses") on a 2D grid with o...
Explain OS processes, threads, and memory
Explain core operating system concepts: processes vs threads, context switching, and scheduling (preemptive vs cooperative and common algorithms). Des...
Estimate expected comparisons in a BST
In a particular binary search tree, finding node A takes 1 comparison and finding node D takes 3 comparisons. What is the expected number of compariso...
Detect currency arbitrage with costs
You are given a K×K matrix R of currency exchange rates where R[i][j] is the amount of currency j obtainable for one unit of currency i, and R[i][i] =...
Count nonnegative buy/sell sequences
You must perform exactly 2n unit trades starting with 0 shares and ending with 0 shares. Each trade is either a buy (+1 share) or a sell (−1 share), a...