The problem is that people need to know the algorithm you're asking them to implement, which biases it towards memorization.
When you tell them how the algorithm works, it feels like you are not testing anything except syntax.
If you let people look it up, it feels like you aren't testing anything except their research skills.
It is difficult to have a test in a vacuum. It would probably be better to have a test with multiple steps.
Exercise 1:
a) Research the topic bubble sort. Explain what bubble sort does and write some notes or pseudo code that will help you implement it. Once you are done, we will disable internet access and close your browser.
b) Write a working bubble sort in COMPANY LANGUAGE.
c) Modify the bubble sort so that it can sort by multiple columns.
The first tests your research skills, the second your syntax skills and the third your ability to deal with changing requirements and implement novel functionality without research.