There is absolutely no way to prepare such an exam without (justified) accusations of bias.
Arguably, though, this process would just move the problem of voter apathy back a step, unless there is some reason to expect that voting for exams is more motivating (or more reasonable to make mandatory) than voting for candidates. Also, it's not clear that the exam would be testing anything other than candidates' memory, as presumably the correct answers would have to be published in advance for the citizens to check.
In any case, the question isn’t whether an exam would be perfect, but whether it would be better than voting. There are certainly plenty of biases involved in the voting process: appearance, public speaking ability, etc. These biases might already be greater than any which arise from an exam.