How can one calculate $342342^{1001}$ mod $5$? How can one calculate $342343^2$ mod $3$? I know that the answer is $1$.
And $342342^{1001}$ mod $5$. 
I know that
$
3^0 \mod 5 = 1 \\
3^1 \mod 5 = 3 \\
3^2 \mod 5 = 4 \\
3^3 \mod 5 = 2 \\\\
3^4 \mod 5 = 1 \\
3^5 \mod 5 = 3 \\
3^6 \mod 5 = 4 \\
$
So 1001 = 250 + 250 + 250 + 250 + 1, which is why the answer is also 1?

This is an observation but you can take it as an answer.
Let $n\in\mathbb{N}$ then $3|n\iff$ $3$ divides the sum of all the digits of $n$. Now consider $n=342343$ and sum of all of its digits $=19$. So clearly $n\equiv-2 (\mod 3)\implies n^2\equiv1(\mod 3)$ since $4\equiv 1(\mod 3)$.
For the second part observe this, $2^4\equiv 1(\mod 5)\implies 2^{250\times4}\equiv 1(\mod 5)\implies 2^{250\times 4+1}\equiv 2(\mod 5)\implies 2^{1001}\equiv 2(\mod 5)$
Now $342342\equiv 2(\mod 5)\implies 342342^{1001}\equiv 2^{1001}(\mod 5)\equiv 2(\mod 5)$
