"Can any one help me to tell when eigenvalues of a symmetric matrix will repeat and also some example?"
The characteristic equation will have a form like
$$
p ( \lambda ) = \prod_{k=1}^{n} \left( \lambda - \xi_{k} \right)^{m_{k}}
$$
where $n$ is the number of distinct eigenvalues $\xi$, and $m_{k}$ is the algebraic multiplicity of each eigenvalue.
For the $2 \times 2$ matrix, the eigenvalue $\xi$ will be repeated twice:
$$
p(\lambda) = \left( \lambda - \xi \right)^{2} = \lambda^{2} - 2 \lambda \xi + \xi^{2}
$$
To construct matrices $\mathbf{A}$ with repeated eigenvalues, we can exploit the expression for the characteristic in terms of the trace and determinant:
$$
p(\lambda) = \lambda^{2} - \lambda \text{ tr}\left(\mathbf{A}\right) + \det \left( \mathbf{A} \right)
$$
Given
$$
\mathbf{A} =
\left[
\begin{array}{cc}
a & b \\
c & d \\
\end{array}
\right],
$$
control the eigenvalues via
$$
\begin{align}
\text{ tr} \left( \mathbf{A} \right) &= a+d = 2\xi ,\\
\det \left( \mathbf{A} \right) &= ad-bc = \xi^{2}.
\end{align}
$$
Simplest examples are
$$
\left[
\begin{array}{cc}
\xi & 0 \\
\alpha & \xi \\
\end{array}
\right],
\quad
\left[
\begin{array}{cc}
0 & -\xi \\
\xi & 2\xi \\
\end{array}
\right]
$$
with $\alpha$ an arbitrary complex constant.
For the symmetric matrix
$$
\left[
\begin{array}{cc}
a & b \\
b & c \\
\end{array}
\right]
$$
the constraints are
$$
\begin{align}
\text{ tr} \left( \mathbf{A} \right) &= a+c = \xi ,\\
\det \left( \mathbf{A} \right) &= ac-b^{2} = \xi^{2}.
\end{align}
$$
Examples of include
$$
\left[
\begin{array}{cc}
0 & 1 \\
1 & 2 i \\
\end{array}
\right]
$$
which repeats the eigenvalue $i=\sqrt{-1}$.