It doesn't seem to me that the candidate's response for #2 is "correct" (as you say). The most simple refutation being a 5:12:13 primitive triangle scaled 199,999x (such that the smallest side is less than, but not equal to, a million). Result: 999995:2399988:2599987, which would not be uncovered by the above solution as both j and k exceed the upper bound of the loop.
As a more general critique of your test: which method is the best use of programmer time? The functions you request return static results, thus the performance hit should be one-time and cached. If so, why do you care?
Finally, yes, I agree that we as a general population are not well-prepared enough in math. Still, I think you're putting too much weight on it. (I've had university CS graduates—supposedly—deliver 100+ lines of nested ifs that mathematically resolved to no-op, so I feel your pain. I'm just not sure that you're approaching this in the best way.)
As a more general critique of your test: which method is the best use of programmer time? The functions you request return static results, thus the performance hit should be one-time and cached. If so, why do you care?
Finally, yes, I agree that we as a general population are not well-prepared enough in math. Still, I think you're putting too much weight on it. (I've had university CS graduates—supposedly—deliver 100+ lines of nested ifs that mathematically resolved to no-op, so I feel your pain. I'm just not sure that you're approaching this in the best way.)