He got 85% correct, which also means he got 15% wrong (the 6 problems)
This means 6=15%
15 does not go into 100 evenly, but 5 does. And 3 happens to be a common factor for both 6 and 15. If you divide both sides by 3 you get:
2=5%
Now we need to find 100%. If 5% of the test is 2 questions, then 100% must be 40.
It's like solving proportions-
2:5
x:100
5 to 100: multiply by 20
2 to x: also multiply by 20
2 times 20 = 40 = 100%
The total number of questions on the test is 40 (questions).