That what practical tests are for. Throw a problem to solve, leave the programmer for an hour and see what he'll produce, while having normal access to the online world.
But you don't want to check encyclopedic knowledge during interview talk. You want to check how well he understands what he's doing, what is his approach to problems, what kind of problems did he solve in the past and how he did it, and lot of other things that don't require the only one correct answer (and cannot even be answered by one).
But you don't want to check encyclopedic knowledge during interview talk. You want to check how well he understands what he's doing, what is his approach to problems, what kind of problems did he solve in the past and how he did it, and lot of other things that don't require the only one correct answer (and cannot even be answered by one).