$\newcommand{\Size}[1]{\left\lvert #1 \right\rvert}$$\newcommand{\Set}[1]{\left\{ #1 \right\}}$Just to complement the excellent answer (+1), if $n = 1$ you have
$$
w(x) = C (x - a_{1}) + 1,
$$
and
$$w(b_{1}) = C (b_{1} - a_{1}) = -2,$$
so there is a solution iff $b_{1} - a_{1} \in \Set{\pm 1, \pm 2}$.
If $n = 2$ you have
$$
w(x) = C (x - a_{1})(x - a_{2}) + 1,
$$
and need
$$
C (b_{1} - a_{1})(b_{1} - a_{2}) = -2 = C (b_{2} - a_{1})(b_{2} - a_{2}),
$$
and there are solutions for instance for
$$\tag1\label1
b_{1} = a_{1} + 1 = a_{2} - 2,
$$
so that $a_{2} = a_{1} + 3$
and
$$\tag2\label2
b_{2} = a_{1} + 2 = a_{2} - 1,
$$
say $a_{1} = 0, a_{2} = 3, b_{1} = 1, b_{2} = 2$, and then $C = 1$.
Actually, for the case $n = 2$ we have
$$
a_{2} - a_{1} = \Size{a_{2} - a_{1}}
\le \Size{b_{1} - a_{1}} + \Size{b_{1} - a_{2}} \le 3,
$$
so I think the general conditions for the existence of a solution are indeed $\eqref1$ and $\eqref2$.