The problem with Excstacy/MDMA is that it dumps (primarily) serotonin into the brain all at once, which can cause short and (arguably) long term effects on the brain and body. Because there is a refractory period for the amount of serotonin that is available to the brain/body, there can a 'hangover' effect, which can often mimic various depressive symptoms....and also include cognitive issues.
The research is mixed about long term effects, some say that there are changes in brain structure of regular users, which can effect cognitive performance, while other research says that it isn't true and/or that if there are differences.....they disappear after awhile.
A physician and/or psychologist can administer various procedures/assessments to look into it further. Of course, many things can effect cognitive performance (sleep, meds, stress, nutrition, etc)....so it could also be completely unrelated.