There are some excellent concepts to brush up on in this article. However, it would be best to be careful when sharing code for standard programming question algorithms. A couple of your examples are what I would accept from a competent junior or mid developer. From a senior developer (and especially a lead), I would expect them to think about the problem a little longer. For example, in your prime number example, I would hope a senior would recognize that the largest possible factor of a non-prime is (num / 2) and make that the upper bound on the check.
I'm not a fan of coding questions for leads. Instead, I think you should discuss architecture and other more abstract topics. However, I recognize that there are a lot of boilerplate interview styles out there.