This is a follow-up on: Find a multivariate polynomial over finite field with given zeros (or number of zeros).
I am trying to find a polynomial $f \in \mathbb{F}_q[x_1, x_2, \dots, x_m]/(x_i^q-x_i)$ such that $f-1=0$ has precisely a given number of roots.
As answered by @qiaochu-yuan, this is always possible, and one can find the appropriate polynomial by solving linearly for the coefficients.
My question now is, when (and how) can one find such a polynomial $f$ such that $deg(f) \leq d_0$?