DRW Coding Interview Questions
25 DRW coding interview problems with full optimal solutions — 8 easy, 12 medium, 5 hard. Every problem ships with multiple approaches (brute-force first, then the optimal), complexity tables for each, company-specific tips on what an DRW interviewer values, and a FAQ section.
Showing 5 problems of 25
- #4hardfrequently asked
4. Median of Two Sorted Arrays
DRW uses this as a pure algorithmic-difficulty benchmark — O(log(min(m,n))) via binary search on the smaller array. The connection to trading is direct: computing the combined median bid-ask spread from two sorted venue feeds without merging them. Sub-O(n) is the only acceptable answer.
- #23hardvery frequently asked
23. Merge K Sorted Lists
DRW asks Merge K Sorted Lists as a direct proxy for order-book consolidation: merge k sorted streams of price-level updates — one per venue — into a single sorted output. The min-heap approach is expected; naive pairwise merging is rejected. Throughput analysis is a required companion question.
- #42hardfrequently asked
42. Trapping Rain Water
DRW uses Trapping Rain Water as a signal-processing proxy: the 'trapped water' at each bar is analogous to the gap between realized P&L and the maximum achievable — a measure of strategy drag bounded by the maximum left and right extrema. Two-pointer O(n) is the expected answer; DRW wants to see the transition from O(n) space to O(1).
- #239hardvery frequently asked
239. Sliding Window Maximum
Sliding Window Maximum is a core primitive at DRW: rolling high-water mark over a price series, rolling maximum volume over the last k ticks, rolling max drawdown window. The monotone deque gives O(n) total — O(1) amortized per tick. DRW asks why O(n log k) with a heap is insufficient at 10M ticks/second.
- #1235hardfrequently asked
1235. Maximum Profit in Job Scheduling
DRW asks this problem because it is structurally identical to optimal trade-scheduling with non-overlapping execution windows: given a set of potential trades each with a start time, end time, and expected profit, select a non-overlapping subset that maximizes total profit. Weighted interval scheduling with binary search is the expected approach.