US Navy interview question

How to integrate a function