You didn't mention if they require code that would actually run, or one that would not necessarily run as is but would just show them how would you solve the task.

I guess it's the second option. **The point is to show your software designing abilities and it doesn't depend if you spell a library function correctly.**

They might be also afraid of you using Google in an unfair way (cheating, copying whole solutions/getting help from people).

PS: They probably also don't insist on memorizing library functions (that wouldn't make sense): if you don't remember library function, just call a hypotetical one.