About this question

Branchless Order Router: 4-Venue Tournament

Hard · low_latency · Quant Developer interview question · branchless, cmov, order-routing, low_latency, tournament, argmin

In high-frequency trading, order routing systems must select the best execution venue in nanoseconds. Standard if/else logic causes CPU branch misprediction penalties, but a branchless argmin implemented with ternary operators avoids this by compiling to CMOV (conditional move) instructions. This technique, structured as a tournament, finds the minimum-priced venue in constant, predictable time. Task Implement the function branchless_route(const double venues) to return the int index (0-3) of t