Depends on what the job is though, if your building web apps and your unlikely to ever need to even use a built in sqrt function I don't think it's a good question. A good question would be one the candidate doesn't know but can think their way through. For a lot if candidates I'd imagine this question wouldn't let you learn to much about their problem solving.