Uswitch interview question

some calculations on a rate object