We investigate effects of charm-quark interactions in a quark–gluon plasma on the production of D and J/ψ mesons in high-energy heavy-ion collisions. Employing a previously constructed coalescence model that successfully reproduces the transverse momentum (pT) spectra and elliptic flow (v2(pT)) of light hadrons at RHIC from underlying light-quark distributions at the phase transition temperature Tc, D-meson and J/ψpT-spectra are evaluated. For the charm-quark distributions, we consider two limiting scenarios: (i) no rescattering, corresponding to perturbative QCD (pQCD) spectra and (ii) complete thermalization including transverse expansion. We find that D-mesons acquire a minimal v2 inherited from their light-quark content and corresponding semileptonic decay spectra of single electrons practically preserve the v2 of the parent particles, exhibiting marked differences between the pQCD and thermal scenarios for pT⩾1 GeV. Likewise, the pT-spectra and yields of J/ψ's differ appreciably in the two scenarios.