The combined effect of Sections 197 to 206 of the Criminal Code of Canada bans for-profit gaming or betting [...] Many stores, radio stations, and other groups still wish to hold contests to encourage more purchases or increase consumer interest. These organizations take advantage of the fact that the law does allow prizes to be given for games of skill, or mixed games of skill and chance. In order to make the chance-based contests legal, such games generally consist of a mathematical skill testing question.
https://en.wikipedia.org/wiki/Skill_testing_question