Interesting contrast though: for me leetcode, certain exams, and interviews often trigger hyperfocus. Studying and assignments, as well as day-to-day work, rarely do. I take a fair bit of medication so I can do my job. I'm trying to pivot towards something which more naturally engages my interest, maybe SRE or security work.
Interesting how we're all affected differently. I recommend skimming "delivered from distraction" if you haven't already, there are some good tips in there on how ADHD folks can deliberately create the right conditions for flow.