Background: Attention-deficit/hyperactivity disorder (ADHD) is often accompanied by impaired response inhibition; both have been associated with aberrant dopamine signalling. Given that prenatal exposure to alcohol or smoking is known to affect dopamine-rich brain regions, we hypothesized that individuals carrying the ADHD risk alleles of the dopamine receptor D4 (DRD4) and dopamine transporter (DAT1) genes may be especially sensitive to their effects. Methods: Functional MRI data, information on prenatal adversities and genetic data were available for 239 adolescents and young adults participating in the multicentre ADHD cohort study NeuroIMAGE (average age 17.3 yr). We analyzed the effects of DRD4 and DAT1, prenatal exposure to alcohol and smoking and their interactions on ADHD severity, response inhibition and neural activity. Results: We found no significant gene × environment interaction effects. We did find that the DRD4 7-repeat allele was associated with less superior frontal and parietal brain activity and with greater activity in the frontal pole and occipital cortex. Prenatal exposure to smoking was also associated with lower superior frontal activity, but with greater activity in the parietal lobe. Further, those exposed to alcohol had more activity in the lateral orbitofrontal cortex, and the DAT1 risk variant was associated with lower cerebellar activity. Limitations: Retrospective reports of maternal substance use and the cross-sectional study design restrict causal inference. Conclusion: While we found no evidence of gene × environment interactions, the risk factors under investigation influenced activity of brain regions associated with response inhibition, suggesting they may add to problems with inhibiting behaviour.