Find position in array where element-wise multiplication with string of 1 and 0s results in max value
Let the array consist of the numbers $a_0,\ldots,a_{n-1}$, and let the mask be $b_0,\ldots,b_{k-1}$. Define
$$
A = \sum_i a_i x^i, \quad
B = \sum_j b_j x^{k-1-j}.
$$
Notice that
$$
AB = \sum_{i,j} a_i b_j x^{i+k-1-j},
$$
and so the coefficient of $x^{i+k-1}$ in $AB$ is
$$
\sum_{j=i}^{i+k-1} a_j b_{j-i}.
$$
Therefore if you can calculate $AB$, you can solve your problem.
You can calculate $AB$ in $O(n\log n)$ using FFT.