InterviewLegend

Merge Sort, Decorators & Subarray Sums

Alex Chen35 min readGuide updated

In July 2026 a quant developer intern in Singapore went through four virtual rounds, all in Python. Most of that loop was stateful builds. A blocking rate limiter, a rolling VWAP and basket pricing are all worked in the previous lesson. The rest tested algorithms and the language itself. Round one asked for a Premium question, then a decorator that adds a number to every element before the sort runs. Round three asked for the k-th largest sum among all contiguous subarrays.

The candidate's summary was short: the loop leaned toward engineering implementation plus concurrency, and "there are a lot of follow-ups." This lesson works both problems, then adds the one older array question DRW asked more than once, a stock-profit problem from 2023 and 2024.

The DRW angle
DRW checks the Python underneath the algorithm. The sort is the warm-up. The follow-up that changed "add 1" to "add x" tests whether you can write three nested functions and remember functools.wraps. Be ready to explain each layer out loud.

DRWPremium lesson · Coding round

The 4 DRW problems are below.

  1. A Premium questionCoding · Medium
  2. A Premium questionCoding · Medium
  3. A Premium questionCoding · Medium

+ 1 more in this lesson

Each with hints, the follow-up and a tested solution.

Get the DRW questions

$49 a year · all 122 companies · instant access

21,000+ candidate reports

DRW interview guide

Know what DRW asks before you walk in.

29 coding · 3 system design · 18 behavioral questions

Get Premium$49 a year · Instant access
Or start freeNo card.

Get their questions first.

Had your DRW interview?How we research

InterviewLegend is independent and not affiliated with or endorsed by any company it covers.