Solution (source code)

= Solution

Write each hyperplane as $h_j(x)=0$, normalized so that $h_j(0)=1$, and put
$$
P(x)=\prod_{j=1}^m h_j(x).
$$
Then $P(0)=1$ and $P$ vanishes at every other point of $\mathbb F_q^n$. Reduce $P$ modulo $x_i^q-x_i$ in every variable. This preserves its function on $\mathbb F_q^n$, does not increase total degree, and gives the unique representative with each variable degree at most $q-1$.

The unique reduced polynomial for the delta function at zero is
$$
\prod_{i=1}^n(1-x_i^{q-1}),
$$
whose total degree is $(q-1)n$. Hence
$$
m=\deg P\geq(q-1)n.
$$
Uniqueness follows equally from the Alon-Tarsi lemma on the grids $A_i=\mathbb F_q$.