Both alternating current and direct current are measured in amperes. But how is the ampere defined for an alternating current?

Hint: Joule's heating effect is independent of the direction of the current.
Step 1: For a Direct Current (DC), 1 ampere = 1 coulomb/sec
Step 2: An AC current changes direction with the source frequency and the attractive force would average to zero. Thus, the AC ampere must be defined in terms of some property that is independent of the direction of the current.
Joule's heating effect is such property and hence it is used to define rms value of AC.