Hmm, if someone says “I already know that” that’s cool, I can just ask them “How do you do it then?” and if the next sentence is anywhere close to “something something modulo” we can skip the coding part.
This behavior would be a strong tell to me that you haven’t had to work on teams with net-negative contributors, or worried about how to avoid hiring them.
Experienced developers know this is a serious problem.
In the same way I'd refuse if they'd begin asking me "how much is 10 divided by 2" or something.
"Oh but you can answer it in 2 min". Don't devalue your time. I bet they can ask something more relevant. I'm happy to solve a different coding exercise or test.