Verisk interview question

They asked me to program a simple algorithm.