If $p$ and $q$ are distinct primes, construct all semidirect products of $\mathbb{Z}_p$ by $\mathbb{Z}_q$. This is exercise 7.29 in Rotman's book "An Introduction to the Theory of Groups". 
If $p$ and $q$ are distinct primes, construct all semidirect products of $\mathbb{Z}_p$ by $\mathbb{Z}_q$.
I don't really understand the question. The group is of course $\mathbb{Z}_p \rtimes \mathbb{Z}_q$, but that is not an answer, it's really just restating the question. So what is the answer? Is it just stating that the group has order $ pq $ and that, for $ a,b\in \mathbb{Z}_p $ and $ x,y\in \mathbb{Z}_q $,
$$ (a,x)(b,y)=(a\theta_x(b),xy)? $$
But again, I am not really doing anything but stating the obvious. What am I supposed to do? The exercise also ask me to compare the result with Theorem 4.20 about groups of order $ pq $. Am I supposed to find the identities like the ones in the theorem ($ b^p=1,a^q=1,aba^{-1}=b^m $)? If yes, how?
 A: To answer that question, one must analyse the homomorphisms $Z/q \to \operatorname{Aut}Z/p \cong Z/(p-1)$. There are exactly $\gcd(q,p-1)$ such homomorphisms; in particular, since $q$ is prime, there exist nontrivial homomorphisms iff $q$ divides $p-1$. Therefore:
If $q  \not \mid p-1$ then $Z/p \rtimes Z/q \cong Z/p \times Z/q \cong Z/pq$.
Otherwise, pick a nontrivial homomorphism $\theta:Z/q \to \operatorname{Aut}Z/p$, say with $\theta_x := \theta(x)$ and $\theta_1(1) =: m \neq 1 \in Z/p$, and construct the semidirect product $G = Z/p \rtimes_\theta Z/q$. To compare with Theorem 4.20, let $a = (0,1) \in G$, $b = (1,0) \in G$. Then $G$ is generated by $a,b$, and we have the relations (written multiplicatively, as in the book) $b^p = 1$, $a^q = 1$, $aba^{-1} = \theta_a(b) = b^m$, and $m^q \equiv 1 \mod p$ but $m \not\equiv 1 \mod p$ as desired.
A: I should like to note that, in the case $\ell:=\frac{p-1}{q}$ is an integer, there are exactly two semidirect products of $\mathbb{Z}_p$ by $\mathbb{Z}_q$, up to isomorphism.  One is the direct product $\mathbb{Z}_p \times \mathbb{Z}_q$.  The other is given by $$H=\big\langle r,s\,\big|\,r^q=1\,,\,\,s^p=1\,\text{ and }rsr^{-1}=s^{g^\ell}\big\rangle\,,$$
where $g\in \mathbb{Z}_p$ is a fixed generator of the group $\left(\mathbb{Z}_p\right)^\times \cong \mathbb{Z}_{p-1}$.
It can be easily seen that the group homomorphism from $G$ to $H$ induced by $a\mapsto s$ and $b\mapsto r^tsr^{-t}$, if $g^{t\ell}=m$, is an isomorphism of groups.  (See the definitions of $G$, $a$, $b$, and $m$ in Alex Provost's answer above.)
