I started with creating a circle (50pt diameter) and using a few lines and the Shape Builder Tool, I broke it into 4 equal pieces:
Then used Transform effects (Effect → Distort & Transform → Transform) to move the shape 50pt and create a bunch of copies.
Now Expanded with Object → Expand Appearance and ungrouped everything.
I now have a bunch of individual paths:
To get all the randomness, will require a use of various illustrator scripts, they are all available and I will try to link to them all.
Applying random color was easy enough, using the script from this answer, I just selected my group of colors and ran the script.
In your example, there are some pies (that's what I'm gonna call them) which are not there. To apply that randomly, I used the script Random Select by André Berg.
Simply set an amount to select (I did 20%) and delete the selected objects.
Now for the rotation; in your example, everything is done in 90° increments, so I used the same random selection script (this time on 25%) and then rotated by 90°.
In order to rotate the individual paths and not the entire selection, you have to use
Right click → Transform → Transform Each Alt+Shift+Ctrl+D
I then repeated this a few times (Random Select → Transform Each → Rotate 90°)
Now, with a bit of Illustrator scripting experience, you could actually create a script that rotates your paths by either
This would make it that you didn't need to randomly select and rotate a few times, just select all and run the script, then run again until satisfied with the outcome.
You can also use just one color and then use this random opacity script by Iaroslav Lazunov to make everything different tints of the same color (assuming that your background is white).
You can even do both for a nice effect.