About this question

Macaulay and Modified Duration

Easy · options_pricing · Quant Researcher interview question · fixed-income, duration, bonds, discounting, risk

Macaulay duration measures the weighted-average time until a bond's cash flows are received, while modified duration measures the price sensitivity of a bond to a change in its yield-to-maturity. These metrics are fundamental in fixed-income portfolio management for hedging interest rate risk. Calculating them requires correctly discounting cash flows based on the bond's coupon frequency and yield compounding convention. Task Implement the function solution(face: float, coupon_rate: float, ytm: