It should be noted that one might also use the alternate
percentile definition 1.3.6, in which case the 25th percentile is computed by considering
\begin{equation*}
(n-1)s+1 = (4-1)0.25+1 = 7/4 = 1.75\text{.}
\end{equation*}
So, m = 1 and r = 0.75. Therefore
\begin{equation*}
P^{0.25} = 0.25 \times 2 + 0.75 \times 5 = 4.25
\end{equation*}
which is still between 2 and 5 but now closer to 5. So, it is pretty obvious that you would want to settle ahead of time which method for computing percentiles is preferred and stick with it. (Note, when working online exercises you might need to work some of them both ways since you have no idea perhaps what the author might have chosen.