Prepping for the 2027 recruiting cycle? Use code 2027RC for 10% off, valid until July 31st! Oh, and check out our members-only recruitment services.

Logo

Coding preview

Scheduling in Strides!

What this preview is

About this preview

Scheduling in Strides! is a medium quant coding problem on operating systems in Cpp.

Unlock full access to getcracked

Join to unlock this problem, detailed solutions, and our complete library of quant finance interview prep.

Implementing stride scheduling in C++

This medium-difficulty coding problem asks you to implement a deterministic, proportional-share CPU scheduler—a core operating-systems concept used to allocate processor time fairly among competing processes. You must correctly handle process arrival, departure, and the core scheduling loop under tight performance constraints.

The challenge lies in combining three things: computing stride values inversely proportional to ticket allocations, efficiently tracking and updating pass values for eligible processes, and handling both the logical correctness of tie-breaking (by lowest pid) and the performance requirements of up to 1 million scheduling ticks. A well-designed solution will use an appropriate data structure to keep the minimum-pass process accessible in logarithmic time, while managing the state transitions as processes arrive and leave.

  • Priority-queue and heap operations
  • Process state management and invariant tracking
  • Integer arithmetic and stride computation
  • Edge cases: empty scheduler, tie-breaking rules, initial pass assignment