At least $n$ queries are needed in the worst case.$^*$ Consider an algorithm which receives the answer $0$ on any query. After $n-1$ queries, it learns that $\langle v^{(1)},A \rangle = \cdots = \langle v^{(n-1)},A \rangle = 0$, where $v^{(i)}$ is the vector corresponding to the $i$'th query. We can find a non-zero vector $u$ which is orthogonal to all of $v_1,\ldots,v_{n-1}$. Thus we could have $A = u$ or $A = -u$. We claim that an answer which is valid for $A = u$ is not valid for $A = -u$. Since the algorithm cannot tell these two cases apart, it cannot guarantee outputting a valid solution.
To prove the claim, suppose without loss of generality that $u$ contains a positive entry. Therefore any optimal solution $I$ for $u$ satisfies $\sum_{i \in I} u_i > 0$. In contrast, $\sum_{i \in I} (-u)_i < 0$. We now distinguish between two cases:
- Case 1: Some entry of $u$ is non-positive. In this case, the optimal solution $J$ for $-u$ satisfies $\sum_{j \in J} (-u)_j \geq 0$, and so we are done.
- Case 2: All entries of $u$ are positive. If $n > 1$, this means that the unique optimal solution for $u$ is $\{1,\ldots,n\}$, whereas all optimal solutions of $u$ are either singletons or the empty interval, if we allow it. If $n = 1$, then this argument breaks unless we allow the empty interval as a solution. Indeed, if $n = 1$ and we don't allow the empty interval, then no queries are needed. This is the reason for the asterisk above.
A similar approach shows that $n$ queries are needed always. Suppose that after $n-1$ queries, the algorithm learns that $\langle v^{(i)}, A \rangle = c_i$ for $i = 1,\ldots,n-1$. The space of solutions to these equations includes a line $\alpha u + w$ (here $\alpha$ is the parameter), where $u \neq 0$. For large positive $\alpha$, any optimal solution for $\alpha u + w$ is also an optimal solution for $u$. This is since if $\sum_{i \in I} u_i > \sum_{j \in J} u_j$ then
$$
\sum_{i \in I} (\alpha u_i + w_i) - \sum_{j \in J} (\alpha u_j + w_j) =
\alpha \left(\sum_{i \in I} u_i - \sum_{j \in J} u_j\right) + \left(\sum_{i \in I} w_i - \sum_{j \in J} w_j\right),
$$
which is positive for large enough $\alpha$, say $\alpha > \alpha_{I,J}$. The claim follows since there are only finitely many pairs $I,J$.
Similarly, for large negative $\alpha$, any optimal solution for $\alpha u + w$ is also an optimal solution for $-u$. Above we have shown that an optimal solution for $u$ cannot be an optimal solution for $-u$ (unless $n = 1$ and we do not allow the empty interval).