The 2 most common part(s) or condition(s) which cause the symptom Washer overflowing are listed below starting with the most likely. Check or test each item and watch any available videos.
RepairClinic Item # 1862767
If the washer is overflowing and power is shut off to the washer, the water inlet valve has failed. Replace it.
If the washer is overflowing the water pressure to the water inlet valve might be too low. The water inlet valve requires a minimum of 20 psi to shut off properly. If the pressure is lower, the valve may not close fully when the power is shut off. This results in the valve leaking water into the washer and causing it to overflow.