Recall the semantics for the diamond and the box: for an arbitrary pointed model $\langle M, w\rangle$ we have:
Definition 1. $\langle M, w\rangle \models \diamondsuit(\phi)$ $=_{def}$ $\exists v \in M$ s.t. $wRv$ and $\langle M, v\rangle \models \phi$.
Definition 2. $\langle M, w\rangle \models \Box(\phi)$ $=_{def}$ $\forall v \in M$ s.t. $wRv$, then $\langle M, v\rangle \models \phi$.
Armed with these definitions, you can rephrase your questions as follows:
Question 1. Which worlds $w \in M$ point to some world $v\in M$ s.t. $\langle M, v\rangle \models q$?
Answer. This gives us an algorithm to get the answer: for each $w \in M$, $w$ belongs to the answer set if and only if there is at least one arrow from $w$ to a world $v \in M$ that satisfies $q$. Does $\color{red}{w_1}$ point to a $q$-world? No. But $\color{green}{w_2}$ does. $\color{red}{w_3}$ also doesn't point to a $q$-world. But $\color{green}{w_4}$ does. Does $w_5$ point to...well, like $w_3$ it points to nothing, so it obviously can't point to a $q$-world. So we have $\{\color{green}{w_2},\color{green}{w_4}\}$.
Question 2. Which worlds $w \in M$ are s.t.: all worlds $v\in M$ they point to are s.t. $\langle M, v\rangle \models p$?
Answer. Similarly for this: for each $w \in M$, $w$ belongs to the answer set if and only if all the arrows from $w$ point to a world $v \in M$ that satisfies $p$. $w_1$ points only to $w_2$, which satisfies $p$, so $\color{green}{w_1}$ does. $w_2$ points to $w_4$, which satisfies $p$, but $w_2$ also points to $w_3$, which does not satisfy $p$, so $\color{red}{w_2}$ isn't in the answer set. $\color{green}{w_3}$ points to nothing, so vacuously all the worlds it points to satisfy $p$. For exactly the same reason $\color{green}{w_5}$ is also in the answer set. $w_4$ points to itself and $w_2$, which do satisfy $p$, but it also points to $w_3$, which does not, so $\color{red}{w_4}$ is not in the set. This gives us the answer: $\{\color{green}{w_1},\color{green}{w_3}, \color{green}{w_5}\}$.