What causes electrical shock sensation in arm?

Shocks in arms. Lots of things could cause this, however the most common thing is neck pathology where the nerves travel down from the brain to to arms. If there is any narrowing or pinching of the nerves this could cause it. Be careful with your neck, it holds your head on. See your doctor for other causes that could present this way.
Nerves. Inflammation, irritation or contact with a nerve will cause an electrical type sensation distal to the contact site. I occasionally get this in my lateral knee when I run and always in my forearm when I do dips. It's related to muscle or facial compression of the nerve while exercising. If you have this sensation frequently or without obvious mechanical compression, discuss it with your doctor.