Assume that an unfair coin is tossed \(3n\) times. Let \(p\) be the probability of head in each of the tosses. The sample space is \(\Omega_{3n}=\{H,T\}^{3n}\) - the set of all sequences of letters \(H\) and \(T\) of length \(3n\). The probability function is defined as \(\mathbb P(s)=p^{h(s)}\cdot(1-p)^{3n-h(s)}\) where \(h(s)\) is the number of letters \(H\) in the sequence \(s\in \Omega_{3n}\).
Let \(X\) be the number of heads in the first \(2n\) tosses and \(Y\) the number of heads in the last \(2n\) tosses. We can write \(X=A+B\) and \(Y=B+C\), where \(A\), \(B\), and \(C\) are the number of heads in the first \(n\), middle \(n\), and last \(n\) tosses. Then \(X\) and \(Y\) are binomial random variables with parameters \(2n\) and \(p\).
Each of them has expected value \(2np\) and variance \(2np(1-p)\). Each of \(A\), \(B\), and \(C\) is a binomial random variable with parameters \(n\) and \(p\).
Their covariance satisfies \begin{eqnarray*}\mbox{cov}(X,Y)&=&\mbox{cov}(A+B,B+C)=\mbox{cov}(A,B)+\mbox{cov}(A,C)+\mbox{cov}(B,B)+\mbox{cov}(B,C)\newline
&=& 0+0+\mbox{var}(B)+0=\mbox{var}(B)=np(1-p).
\end{eqnarray*}
It remains to find a pair \((n,p)\) such that \(np(1-p)=7\). There are infinitely many of them, and one such pair is \(n=28\) and \(p=\frac12\).