I am interested in examples of hypersurfaces $X, Y$ defined by polynomials $F(x_1, \cdots, x_n), G(x_1, \cdots, x_n)$ respectively, so that the intersection $X \cap Y$ has a singular locus of high dimension. I am interested in both cases where $F,G \in \mathbb{C}[x_1, \cdots, x_n]$, so that $X,Y$ are affine hypersurfaces in $\mathbb{A}^n(\mathbb{C})$, and when $F,G$ are homogeneous polynomials, so that $X,Y$ are hypersurfaces in $\mathbb{P}^{n-1}(\mathbb{C})$. In particular, I am interested to know if when say $F$ is non-singular, is it possible for the intersection $X \cap Y$ to have a singular locus of codimension 2 or less? Or is the hypothesis that one of the hypersurfaces $X,Y$ being defined by a non-singular polynomial sufficient to show that the singular locus of the intersection must have a low dimension?

Thanks for any help or reference.