Seven Peaks Software Interview Question

How to add a method to the function without modifying the original class?