I have extract some notes from my notes:
one way to found which of four example is uniform function is that try by hand and take some examples. I will search for a method that we can easily infer just the second one has uniform capability. is there any hint or idea to quickly choose the second one instead of try by hand and examples one by one?
for the last one: $h(1)=1, (h3)=4, h(2)=4$ so means not uniform because $x=3$ and $x=2$ has the same slot.

You want to distribute stuff to $k$ slots. Computing over modulo $k-1$ would not make you attain $k$ slots, hence immediately, we reject the first and third choice.
You can then try some simple number, say when $k=4$ to reject the last case.
Note that $k-1$ and $k$ are coprime. if $a$ and $k$ are coprime, we know that $ax \pmod{k}$ would achieve a bijection.