I created a video discussing how to compute the XOR of all numbers in the range $$$[L, R]$$$ in $$$O(1)$$$. It also talks about how to compute the number of set bits at position $$$p$$$ in the range $$$[L, R]$$$ (people usually get confused with off-by-one errors in these problems, Not anymore!).
Although not directly related, XORs and modulo 4 appeared in the last Codeforces Round. This trick is not known by many, so I decided to create a video.
https://youtu.be/v8G2gjQ_gp8?si=rG60v07Bn4mTL-dw
If you want to apply this info to an actual problem, here's a practice contest https://codeforces.net/group/7Dn3ObOpau/contest/539212
Update : I also created a practice contest https://codeforces.net/group/7Dn3ObOpau/contest/539212