Interview code for Derivative Calculator