Round Price to Nearest Valid Tick
Asked at Akuna Capital · Coding Questions · Difficulty: Medium · Last asked Sep 22, 2025
Given price bands (each with a lower bound, upper bound, and tick `width`), snap an input price to the nearest valid tick. If the price is below the minimum, return the minimum; within a band, return `low + n*width` minimizing `|price - (low + n*width)|`. Inputs are doubles and prices may be negative.
Loading the problem…