Linear algebra can be applied to exploit the structure of extraspecial groups. That's a p-group $G$ where the commutator subgroup equals the center $C$ and has order p. $V:= G/C$ is an elementary abelian p-group, because $G/C$ is abelian and $$[g,h^p]=gh^pg^{-1}h^{-p}=[g,h]h[g,h^{p-1}]h^{-1}=[g,h][g,h^{p-1}]=\cdots=[g,h]^p=1.$$
It's easy to see that $\varphi: V \times V \to C\cong \mathbb{F}_p,\; (\bar{x},\bar{y}) \mapsto [x,y]$ defines a bilinear form that is skew-symmetric because $[x,y]^{-1}=(xyx^{-1}y^{-1})^{-1}=[y,x]$ and non-degenerate (for, if $[x,y]=1$ for all $y$, then $x \in C$ and $\bar{x}=0$ in $V$).
Now, by linear algebra, each vector space that admits a non-degenerate skew-symmetric bilinear form can be decomposed into orthogonal subspaces $V=\oplus_{i=1}^n V_i$ where $V_i$ is two-dimensional with basis $\bar{x}_i,\bar{y}_i$ such that $\varphi(\bar{x}_i,\bar{y}_j)= \delta(i,j)$ and $\varphi(\bar{x}_i,\bar{x}_j)=\varphi(\bar{y}_i,\bar{y}_j)=0$ for all $i,j$.
In particular $\dim V=2n$ what shows $|G|=|C| \cdot |V|= p^{2n+1}$. Interpreting and the formularsformulas for $\varphi$ in $G$ finally givesgive the presentation $$\begin{array}{ll}G = \langle x_1,y_1,...,x_n,y_n,c \mid & c^p=[x_i,c]=[y_i,c]=1,[x_i,y_i]=c, \newline & x_i^p=c^{k_i}, y_i^p=c^{l_i},[x_i,x_j]=[y_i,y_j]=[x_i,y_j]=1\rangle \end{array}$$ where $i\neq j$ run through $1,...,n$ and $0 \le k_i,l_i < p$.
Putting some more work into it, one can show $k_i=l_i=1$ if p is odd while in case p=2 the two cases $(k_1,l_1)=(1,0),(1,1)$, $k_i=l_i=0$ if $i> 1$ occur.