I tend to think that if you're going to insist that someone write code without access to documentation and in an unfamiliar environment then you shouldn't ask for anything more than pseudocode. Otherwise you're just testing whether or not someone has memorized the standard library of whatever language you want.
You can argue that someone who has memorized the [Foo] standard library might be better at some things than someone who hasn't, of course. But I think that what you're testing for is at best tangental to the ability to design/write good code.
You can argue that someone who has memorized the [Foo] standard library might be better at some things than someone who hasn't, of course. But I think that what you're testing for is at best tangental to the ability to design/write good code.