Hatch interview question

To solve a BMD on spot.