Direct numerical simulations (DNSs) of turbulent heat transfer over walls with regularly distributed hemispheric protrusions were conducted to explore how the arrangement and number density of hemispheres affect the turbulent heat transfer. For the rough walls, we considered eight rough surfaces, in which the number density, i.e., the number of hemispheres per unit area, and the distances between two neighboring hemispheres in the streamwise and spanwise directions were systematically varied. The friction Reynolds number was fixed at 660, and we considered an incompressible airflow with a Prandtl number of 0.71, neglecting the buoyancy effects. The results showed that the velocity roughness function strongly depends on the hemisphere arrangement and number density. The spanwise-aligned hemisphere array yields the larger velocity roughness function than its streamwise-aligned hemisphere counterpart, whereas the temperature roughness function depends only on number density. The Reynolds analogy factor decreases with increasing inner-scaled equivalent sand grain roughness, and the decreasing trend is weakly affected by the number density. We analyzed the momentum and heat transfer budgets and found that the pressure drag, which dominates the momentum transfer near the wall, is strongly affected by the hemisphere arrangement and number density. In contrast, the roughness-induced wall heat transfer term, which is the dominant contributor to near-wall heat transfer, depends only on the number density. This difference is the driving mechanism that causes dissimilar trends in momentum and heat transfer over walls with hemispheric protrusions.