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 7 problems of 25
- #1easyvery frequently asked
1. Two Sum
DRW uses Two Sum as a rapid-fire calibration question — they want to see the hash-map instinct fire in under 30 seconds. At a firm where order-matching engines process millions of ticks per second, the difference between O(n) and O(n²) lookup is not theoretical.
- #3mediumvery frequently asked
3. Longest Substring Without Repeating Characters
DRW uses this problem to test the sliding-window pattern — the same technique that powers rolling-window deduplication on market-data feeds and tick-data deduplication in low-latency pipelines. Getting to O(n) with a single hash-map pass is required; naive O(n²) solutions are rejected on sight.
- #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.
- #121easyvery frequently asked
121. Best Time to Buy and Sell Stock
At DRW, this is not just a coding question — it is a trading question in disguise. The optimal-entry / optimal-exit framing maps directly to how DRW thinks about position entry timing in its proprietary strategies. Expect the follow-up to jump from O(n) code to expected-value maximization under uncertainty.
- #146mediumvery frequently asked
146. LRU Cache
DRW uses LRU Cache because low-latency market-data systems rely on exactly this design: a bounded cache of recently-seen instrument snapshots, where the stale entry is evicted on each new quote. O(1) get and put are non-negotiable — the interviewer will ask for the doubly-linked-list proof.
- #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.
- #295mediumvery frequently asked
295. Find Median from Data Stream
Running median over a live stream is a first-class problem at DRW: median bid-ask spread, median fill latency, median position size across strategies. The two-heap technique gives O(log n) insertion and O(1) query. DRW will ask for the Fenwick tree variant when values are bounded integers.