Skip to main content

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 12 problems of 25

  • #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.

  • #15mediumfrequently asked

    15. 3Sum

    DRW asks 3Sum to test whether candidates can combine sorting with two-pointer sweeps and suppress duplicates without extra memory. In trading contexts this pattern appears in three-asset arbitrage detection: find all triplets of prices summing to zero profit after costs.

  • #49mediumfrequently asked

    49. Group Anagrams

    DRW uses Group Anagrams to test hash-key design — the skill of choosing a canonical representation that correctly groups equivalent items. In trading systems this appears in instrument deduplication: grouping ticker aliases (GOOG / GOOGL, different listings of the same underlying) by a canonical identifier.

  • #56mediumfrequently asked

    56. Merge Intervals

    DRW frames Merge Intervals as an order-book depth aggregation problem: given a set of bid or ask price-quantity intervals, collapse overlapping ranges into consolidated depth levels. Sorting by start time is mandatory; the merge sweep is O(n).

  • #139mediumfrequently asked

    139. Word Break

    DRW surfaces Word Break to test DP on string segmentation — a pattern that maps to parsing FIX tag-value sequences and tokenizing structured market messages where the dictionary of valid tokens is known in advance.

  • #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.

  • #200mediumfrequently asked

    200. Number of Islands

    DRW uses Number of Islands as a graph traversal proxy — the same connected-component logic appears in counterparty exposure clustering and in detecting isolated market segments. BFS and DFS both work; interviewers ask you to compare them on memory use.

  • #207mediumfrequently asked

    207. Course Schedule

    DRW uses Course Schedule to probe topological sort and cycle detection — the same logic used in dependency resolution for trading system component startup ordering and in detecting circular position-dependency chains in risk models.

  • #238mediumfrequently asked

    238. Product of Array Except Self

    DRW uses this problem to test prefix-product reasoning without division — the same technique used to compute portfolio-weight normalization factors and running exposure metrics without re-scanning the full array. The O(n) no-division constraint is the key DRW signal.

  • #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.

  • #322mediumfrequently asked

    322. Coin Change

    DRW uses Coin Change to test unbounded knapsack DP — and immediately connects it to tick-size discretization: given a set of valid price increments (tick sizes), what is the minimum number of ticks to express an order quantity? The greedy approach fails for arbitrary denominations; DP is required.

  • #347mediumfrequently asked

    347. Top K Frequent Elements

    DRW asks Top K Frequent Elements to probe heap vs. bucket-sort trade-offs — decisions that matter when ranking the k most-traded instruments by volume or the k most-active order IDs in a session. O(n log k) with a heap is expected; O(n) with bucket sort earns extra credit.

DRW Coding Interview Questions — Full Solutions — InterviewChamp.AI