Fortinet interview question

Write a convolution function from scratch