Number of connected components of degree 2 affine algebraic varieties Suppose an algebraic variety $V$ is given as the solutions to $q$ polynomial equations of degree $\le k$ with real coefficients
$$p_1(x_1,\dots,x_m)=0,\dots,p_q(x_1,\dots,x_m)=0$$
for $x\in\mathbb R^m$. It is a theorem due to Milnor that the sum of Betti numbers of $V$ is bounded by $k(2k-1)^{m-1}$. In particular this also bounds the number of connected components of $V$.
Question: Is this bound on the number of connected components of $V$ the best known bound? I am only interested in the case $k=2$. I suspect that for the varieties I am studying the number of connected components is bounded linearly in $m$. 
Milnor, John W., On the Betti numbers of real varieties, Proc. Am. Math. Soc. 15, 275-280 (1964). ZBL0123.38302. 
 A: No. There are better bounds for particular cases (for instance for $3$ quadrics as given in the reference below), and in general it remains an open problem to find sharp bounds on the maximal number of components of a real affine/projective variety of given degree. The paper here of Degtyarev, Itenberg, and Kharlamov, answers some of the questions above. 
Let $B^0_r(N)$, $0\leq r\leq N − 1$, denote the maximal number of connected components that a regular complete intersection of $r + 1$ real quadrics in $\mathbb{P}^N_{\mathbb{R}}$ can have. Then, it is straightforward to show that the number of components can grow exponentially in the dimension for a suitable number of quadrics

$B^0_{N−1}(N) = 2^N$ for all $N > 1$ (intersection of dimension zero).

However, if the number of equations is small, for instance three, then there is a quadratic upper bound in $N$ for $B^0_{k}(N)$.

Theorem. For all $N > 4$, one has $\frac{1}{4}(N − 1)(N + 5) − 2 < B^0_2(N)\leq \frac{3}{2}k(k − 1) + 2$, where $k = [\frac{N}{2}] + 1$.

