The presentation of the dihedral group is $$ D_{2n}= \langle r,s \mid r^{n}=s^{2}=1, (sr)^2=1 \rangle. $$ Now, let $G$ be a group of order $2n$. Is it true that if $G$ contains two elements $a,b$ such that $ord(a)=n$, $ord(b)=2$ and $ord(ba)=2$, then $G\cong D_{2n}$ ?
Edit: If not, what are the conditions that $G$ has to fulfill in order to be isomorphic to $D_{2n}$ ?
YES, it is. Let's call $G_0$ your presentation of $D_{2n}$. The universal property of $G_0$ tells you that there is a morphism $G_0\to G$ which sends $r$ to $a$ dand $s$ to $b$.
Claim. $G$ is generated by $a$ and $b$.
For, it is enough to show that the various elements $a^k, ba^\ell$ are pairwise distinct (where $0\leq k,\ell\leq n-1$).
The only non trivial thing to prove is that $a^k= ba^\ell $ for some $k,\ell$ cannot happen. Assume the contrary, so that $b=a^m, m=k-\ell$, so $-(n-1)\leq m\leq n-1$. Taking inverse and using the fact that $b$ has order $2$, one may assume that $0\leq m\leq n-1$.
The order of $b$ is $2$, so if $n$ is odd it cannot happen. Write $n=2r$. Then $b=a^r$, the unique element of order of the cyclic group generated by $a$. Now $ba=a^{r+1}$, which has order $2r/gcd(2r,r+1)$. Now $gcd (2r,r+1)$ is $1$ or $2$ since $2(r+1)-2r=2$. Consequently, $o(ba)=2r$ or $r$.
Therefore, if $r\geq 3$ you have a contradiction. If $r=2$, o$(a^3)=4$ and you have a contradiction again.
To sum up, $G$ is generated by $a$ and $b$. Hence the morphism above is surjective, hence bijective.