Intel Corporation interview question

Write a template method for add function.