In both the cases, the questions are not from the syllabus. For instance, if the test is on the cardiovascular system and you find a question on the muscle attachment of a bone, that would be considered out of syllabus. Why? Because the test was for cardiovascular and not skeletal system.
Anything beyond is exceeding the limits. I've heard out of... more than beyond... in the context of syllabus.