ZS Associates interview question

calculate derivative