Designing low-cost and high-activity electrocatalysts is significant to enhance the slow kinetic process of oxygen evolution reaction (OER). Inspired by the Lego game, hierarchical CdP2–CDs–CoP nanoarrays were fabricated by combining negatively charged carbon quantum dots (CDs) with positively charged Co and Cd ions. Because of the low evaporation temperature of Cd and relatively high solubility product (Ksp) of Cd(OH)2, trace CdP2 is trapped on the surface of CdP2–CDs–CoP nanoarrays. When coupled with CDs, CdP2 enriches the defects and active sites of catalysts. The CdP2–CDs–CoP nanoarray, as a robust OER electrocatalyst, delivers an overpotential of 285 mV to drive a current density of 10 mA cm–2, demonstrating its superiority over commercial RuO2.