I am afraid the example
given by your friend is not analogous with interest-based transactions. Interest
deals do not work the way this example describes.
In the example, the borrower is in
default by virtue of his non-payment at the appointed time. Therefore, a penalty
cannot be objected to if it is agreed upon by both the parties beforehand.
However, in all interest deals, the borower is liable to the penalty (ie the
interest amount) even if he returns his money on the appointed time. For
example, if I borrow Rs 5000 from you and return it to you within the stipulated
period, I will still be required to pay an extra amount to you. So, you see,
this is different from the example your friend has given.