The study you are thinking of is "The Camel Has Two Humps" by Dehnadi and Bornat, which was never officially published (and having read it, has several control issues that are cause for concern with respect to internal validity). However, most people continue to quote this study without realizing that the authors have retracted their original claims. In a larger, later follow-up replication study (Mental models, Consistency and Programming Aptitude by Bornat, Dehnadi, Simon), the authors state:
"We now report that after six experiments, involving more than 500 students at six institutions in three countries, the predictive effect of our test has failed to live up to that early promise. We discuss the strength of the effects that have been observed and the reasons for some apparent failures of prediction."