I don't necessarily expect candidates to have perfect syntax for a given language. (there's a presumption that they would be able to look up correct syntax in practice) At the same time, if you're unable to express your ideas in something close to real code, it is a signal that you're not sufficiently familiar with the language you chose.